application.properties for environment-specific settings. This guide covers all configuration options available in the application.
Configuration file location
The main configuration file is located at:Application configuration
Application name
The application is identified by its Spring application name:application.properties
Database configuration
OrgStack uses PostgreSQL as its primary database. All database settings are configured under thespring.datasource namespace.
Connection settings
JDBC connection URL for the PostgreSQL database.Format:
jdbc:postgresql://<host>:<port>/<database>The default configuration connects to a local PostgreSQL instance on port 5432 with database name
orgstack, matching the Docker Compose setup.Database username for authentication.
Database password for authentication.
Complete datasource configuration
application.properties
JPA and Hibernate configuration
OrgStack uses Spring Data JPA with Hibernate as the JPA implementation. These settings control how JPA interacts with the database.Schema management
Controls how Hibernate manages the database schema.Possible values:
validate- Validates the schema without making changes (recommended for production)update- Updates the schema automatically (use with caution)create- Creates the schema, destroying previous datacreate-drop- Creates schema on startup, drops on shutdownnone- No schema management
OrgStack uses
validate to ensure database schema matches entity definitions without automatic modifications. Schema changes should be managed through migrations.SQL logging
Controls whether SQL statements are logged to the console.Set to
true during development to see generated SQL queries.Formats SQL output for better readability when
show-sql is enabled.Open Session in View
Controls the Open Session in View (OSIV) pattern.
OSIV is disabled (
false) in OrgStack to prevent lazy loading issues and encourage explicit transaction boundaries. This follows best practices for clean layered architecture.Complete JPA configuration
application.properties
Server configuration
The HTTP port the Spring Boot application listens on.The backend API will be accessible at
http://localhost:8080.Environment-specific configuration
For different environments (development, staging, production), you can create environment-specific property files:Using environment variables
For sensitive configuration like database passwords, use environment variables:${VAR_NAME:default_value} uses the environment variable if set, otherwise falls back to the default.
Configuration validation
To verify your configuration is correct:Troubleshooting
Database connection refused
Database connection refused
Symptoms:
Connection refused or Could not connect to databaseSolutions:- Verify PostgreSQL is running:
docker ps - Check database URL matches your setup
- Ensure port 5432 is not blocked by firewall
- Verify credentials match between
application.propertiesanddocker-compose.yml
Schema validation errors
Schema validation errors
Symptoms:
Schema-validation: wrong column type encounteredSolutions:- Ensure database schema matches entity definitions
- Run database migrations if needed
- Temporarily use
spring.jpa.hibernate.ddl-auto=updateto sync schema (development only)
Port already in use
Port already in use
Symptoms:
Port 8080 already in useSolutions:- Change
server.portinapplication.properties - Stop the conflicting application
- Find and kill the process:
lsof -i :8080
Next steps
Data model
Learn about the entity structure and BaseEntity pattern
Development setup
Set up your complete development environment