Budg1 Spring project.
- Java SDK 21.
- SpringBoot 3.
- JWT using jwtk-jjwt.
- Postgres.
- Redis.
- Liquibase.
You can use Nix for a portable dev environment. Launch the shell to have Java 21, Newman and Liquibase:
nix-shell
Using Gradle Versions Plugin:
./gradlew dependencyUpdates
All configurations should be done in .env file, create it if not exists.
- Generate secret key for token generation:
Place generated value:
openssl rand -base64 64 | paste --delimiters '' --serial
TOKEN_SECRET=<YOUR_BASE_64_GENERATED_SECRET>
- Token expiration is seven (7) days by default, you can modify it:
TOKEN_EXPIRATION_IN_DAYS=<YOUR_EXPIRATION_DAYS>
- Setup your database properties:
DATASOURCE_DRIVER=org.postgresql.Driver DATASOURCE_URL=jdbc:postgresql://localhost:5432/budgi DATASOURCE_USERNAME=budgi DATASOURCE_PASSWORD=budgi
- Setup your redis properties:
REDIS_HOST=localhost REDIS_PORT=6379 REDIS_PASSWORD=budgi
- Dockerize with Jib:
./gradlew jibDockerBuild
- Start Docker Postgres server using Docker Compose:
cd ./docker docker compose up -d
- Start server:
./gradlew bootRun
- Start Docker server using Docker Compose:
cd ./docker docker compose -f ./compose-app.yml up -d
Check status navigating to health page.
- Install Newman or Postman CLI.
- Run tests:
newman run ./postman_collection.json # OR postman collection run ./postman_collection.json