Spring-React is my template repository for a full-scale web application using SpringBoot, React CRA, and PostgreSQL.
- Run
gradlew bootRun
to launch app - Find app at
localhost:8080
Before starting to develop run gradlew bootJar
- In one terminal
gradlew bootRun
- In second terminal go into the
frontend
directory then runnpm start
Find the app at localhost:3000
and frontend changes there
Environment needed during deployment such as heroku
JDBC_DATABASE_URL
JDBC_DATABASE_USERNAME
JDBC_DATABASE_PASSWORD
Note: Above three automatically set by heroku by adding postgresql addon
JWT_SECRET
(secret used for JWT validation. HS512 at least 512 bits)JWT_EXPIRE_MS
(amount of time in milliseconds when an auth token expires)BUILD_TYPE
(BUILD_TYPE usuallyprod
for deployment)
Note: prod
must be set when running jar (see Procfile
)
java -Dspring.profiles.active=prod -jar build/libs/jarFile.jar
gradlew bootRun -PBUILD_TYPE=dev
- buildType:prod
ordev
(default)
gradlew help
- helpgradlew tasks
- view tasksgradlew <task>
- run a task