Skip to content

Project Configuration

Subhrodip Mohanta edited this page Apr 3, 2026 · 1 revision

Project Configuration

This project uses standard Spring Boot configuration patterns, leveraging application.properties and environment-specific profiles.

Profiles

We use three main profiles to manage different environments:

Profile Purpose Data Source
dev Local development Local MySQL / MariaDB
test Unit and Integration testing In-memory H2 Database
prod Production deployment Cloud-managed MySQL

Activating a Profile

To run the application with a specific profile:

./mvnw spring-boot:run -Dspring-boot.run.profiles=dev

Environment Variables

The application uses environment variables for sensitive or environment-specific data. These are defined in your .env file and mapped in the application*.properties files.

Key variables include:

  • MYSQL_DB_HOST: The hostname of your MySQL server.
  • MYSQL_DB_PORT: The port (default 3306).
  • MYSQL_DB_UNAME: Database username.
  • MYSQL_DB_PASSWD: Database password.
  • JWT_SECRET: Secret key for signing JWT tokens.
  • JWT_EXPIRATION: Token expiration time in milliseconds.

Application Properties

  • src/main/resources/application.properties: Base configuration shared across all environments.
  • src/main/resources/application-dev.properties: Overrides for local development.
  • src/main/resources/application-test.properties: Optimized for fast testing with H2.
  • src/main/resources/application-prod.properties: Hardened settings for production.

Clone this wiki locally