Skip to content

ucsb-cs156-f22/team03-f22-7pm-4

Repository files navigation

STARTER-team03

TODO: Add a codecov badge for the main branch here. What's shown is an example, but you need to visit codecov to get the markdown for your repo; don't just try to edit the markdown in the example below. The token value won't match your repo. Be sure to adjust the default branch from master to main.

codecov

TODO: Add a link to the deployed Heroku app for your team here, e.g.

TODO: Leave the results of the TODOS, but remove all of the TODO instructions from the readme.

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

SQL Database access

On localhost:

  • The SQL database is an H2 database and the data is stored in a file under target
  • Each time you do mvn clean the database is completely rebuilt from scratch
  • You can access the database console via a special route, http://localhost:8080/h2-console
  • For more info, see docs/h2-database.md

On Heroku:

  • The SQL database is a postgres database provisioned automatically by Heroku
  • You can reset it with heroku pg:reset --app app-name-goes-here
  • More info and instructions for access the SQL prompt are at docs/postgres-database.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages