Coder Social home page Coder Social logo

team04-w22-5pm-1's Introduction

STARTER-team04-courses

Storybook is here:

The GitHub actions script to deploy the Storybook to QA requires some configuration; see docs/github-actions.md for details.

If these repos are not yet setup, see the setup steps in docs/storybook.md.

Setup before running application

Before running the application for the first time, you need to do the steps documented in docs/oauth.md.

Otherwise, when you try to login for the first time, you will likely see an error such as:

Authorization Error; Error 401: invalid_client; The OAuth client was not found.

Getting Started on localhost

  • Open two separate terminal windows
  • In the first window, start up the backend with:
    mvn spring-boot:run
    
  • In the second window:
    cd frontend
    npm install  # only on first run or when dependencies change
    npm start
    

Then, the app should be available on http://localhost:8080

If it doesn't work at first, e.g. you have a blank page on http://localhost:8080, give it a minute and a few page refreshes. Sometimes it takes a moment for everything to settle in.

If you see the following on localhost, make sure that you also have the frontend code running in a separate window.

Failed to connect to the frontend server... On Heroku, be sure that PRODUCTION is defined.  On localhost, open a second terminal window, cd into frontend and type: npm install; npm start";

Getting Started on Heroku

On Heroku, you'll need to set the following configuration variable:

  • Using the Heroku CLI:
    heroku config:set PRODUCTION=true --app <heroku app name>
    
  • Or set it on the Heroku Dashboard: image

You'll also need to follow the OAuth set up instructions here: docs/oauth.md.

If you get the following message on Heroku, it probably means that you failed to setup the PRODUCTION environment variable.

Failed to connect to the frontend server... On Heroku, be sure that PRODUCTION is defined.  On localhost, open a second terminal window, cd into frontend and type: npm install; npm start";

Accessing swagger

To access the swagger API endpoints, use:

To run React Storybook

Accessing Database Console

  • On localhost only: http://localhost:8080/h2-console See also: docs/h2-console.md
  • On Heroku, with CLI:
    • Use: heroku psql --app app-name-here

    • Note that this requires that you have the psql CLI tool installed on your system.

    • This does work on CSIL, but you may need heroku login -i in order to login on CSIL

    • Example:

      [pconrad@csilvm-03 ~]$ heroku psql --app demo-spring-react-example
      ›   Warning: heroku update available from 7.59.1 to 7.59.2.
      --> Connecting to postgresql-tapered-84555
      psql (13.4, server 13.5 (Ubuntu 13.5-2.pgdg20.04+1))
      SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
      Type "help" for help.
      
      demo-spring-react-example::DATABASE=> 
      
  • On Heroku, without CLI:
    • Upper right of dashboard, select "More" then "Run Console"

      Heroku Dashboard; More; Run Console
    • Enter psql $DATABASE_URL and click Run

      Enter psql $DATABASE_URL and click Run
  • Cheatsheet of psql commands: https://www.geeksforgeeks.org/postgresql-psql-commands/

team04-w22-5pm-1's People

Contributors

pconrad avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.