A demo todo app with Spring Boot and Nextjs.
The first thing you'll want to do is set up your Auth0 SPA App as well as the frontend. Instructions for that can be found here. Auth0 specific instructions can be found here.
Once the Auth0 SPA App and the frontend have been set up, you'll then need to run
# Make a copy of the secrets file for localhost
cp secrets-localhost.properties.SAMPLE secrets-localhost.properties
Then you'll need to fill in the auth0.domain
and auth0.clientId
fields with the credentials from you Auth0 App.
At this point, you should be able to run the app locally via
# Run the backend
mvn spring-boot:run
# Run the frontend
cd frontendDomain
npm run dev
Deploying to production consists of the following steps:
- Create the heroku app (if it doesn't already exist) and link it to your github repo.
- Push all changes to the master branch, or whatever branch you deploy from.
- If this is the first deploy, do the following
# Make your copy of the production secrets file
cp secrets-heroku.properties.SAMPLE secrets-heroku.properties
# FILL IN THE missing PROPERTIES in secrets-heroku.properties (auth0 creds can carry over from localhost file)
-
Don't forget to follow deployment instructions for the frontend at the bottom of here.
-
Once the frontend is deployed, you'll most likely need to update the
frontend.domain
property insecrets-heroku.properties
so that CORS will work. Once you've updated the values, you can update them in production via
./setHerokuEnv.sh --app APP-NAME-ON-HEROKU
- You may need to update values in production to point it to the newly hosted backend on heroku. Instructions for that can be found here.