-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: remove jpa stuff from configuration * doc: Add backend README.md
- Loading branch information
1 parent
85880d4
commit c18b79e
Showing
3 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Backend | ||
|
||
## Environment Variables | ||
|
||
### Database | ||
|
||
**``SPRING_DATASOURCE_URL``**: JDBC url to a postgres database. E.g.: `jdbc:postgresql://HOST:PORT/DATABASE` | ||
|
||
**``SPRING_DATASOURCE_USERNAME``**: Account username for the postgres database. | ||
|
||
**``SPRING_DATASOURCE_PASSWORD``**: Account password for the postgres database. | ||
|
||
### Other | ||
|
||
**``JWT_KEY``**: Key to sign all jwts. **A change in production would invalidate all json web tokens!** | ||
|
||
## Local Development | ||
|
||
We recommend using JetBrains IDE `IntelliJ IDEA`. The backend is a `Spring Boot Application`. | ||
For local development we've set up a docker-compose file and a local application config. | ||
|
||
Run the local docker-compose file: | ||
```bash | ||
docker-compose -f docker-compose-local.yml up -d | ||
``` | ||
|
||
And **then** start the application with the `local` profile. | ||
```bash | ||
./mvnw spring-boot:run -Dspring-boot.run.profiles=local | ||
``` | ||
|
||
**NOTE**: You can run the application in IntelliJ with a `Spring Boot` Run Configuration. There you have to set `Active Profiles` to `local`. | ||
|
||
## Deployment | ||
|
||
The application includes a `Dockerfile` and can be run everywhere. This project initially aimed to teach us the basics of | ||
cloud work, so it will be automatically deployed to [Render](https://render.com). | ||
|
||
**Please make sure to set all required environment variables before running the application.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
spring: | ||
datasource: | ||
driver-class-name: org.postgresql.Driver | ||
jpa: | ||
hibernate: | ||
ddl-auto: update | ||
database-platform: org.hibernate.dialect.PostgreSQLDialect | ||
driver-class-name: org.postgresql.Driver |