Skip to content

Latest commit

 

History

History
109 lines (85 loc) · 2.84 KB

README.md

File metadata and controls

109 lines (85 loc) · 2.84 KB

Budg1 Spring API

Budg1 Spring project.

Test

Technology Stack

Development

Technology Stack

You can use Nix for a portable dev environment. Launch the shell to have Java 21, Newman and Liquibase:

nix-shell

Check dependencies

Using Gradle Versions Plugin:

./gradlew dependencyUpdates

Configuration

All configurations should be done in .env file, create it if not exists.

  • Generate secret key for token generation:
    openssl rand -base64 64 | paste --delimiters '' --serial
    Place generated value:
    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

Generate docker image

  • Dockerize with Jib:
    ./gradlew jibDockerBuild

Run server

Java

  • Start Docker Postgres server using Docker Compose:
    cd ./docker
    docker compose up -d
  • Start server:
    ./gradlew bootRun

Docker


Check status navigating to health page.

Integrations tests

  • Install Newman or Postman CLI.
  • Run tests:
    newman run ./postman_collection.json
    # OR
    postman collection run ./postman_collection.json