Overview
This page provides a comprehensive reference for all configuration properties used by the Library Management API. The main configuration file is located at:Complete Properties File
Properties Reference
Application Properties
The name of the Spring Boot application. This appears in logs and actuator endpoints.Location:
application.properties:1Server Properties
The HTTP port on which the application listens for requests.Default:
Location:
8081Location:
application.properties:15Database Properties
PostgreSQL JDBC connection URL. Must be provided via the
Location:Examples:
db_url environment variable.Environment Variable: db_urlLocation:
application.properties:4Format:Database username for authentication. Must be provided via the
Location:
db_username environment variable.Environment Variable: db_usernameLocation:
application.properties:5Example:Database password for authentication. Must be provided via the
Location:
db_password environment variable.Environment Variable: db_passwordLocation:
application.properties:6JDBC driver class for PostgreSQL database connectivity.Value:
Location:
org.postgresql.DriverLocation:
application.properties:9This driver is provided by the
postgresql dependency in pom.xml.JPA/Hibernate Properties
Hibernate dialect for PostgreSQL-specific SQL generation and optimizations.Value:
Location:
org.hibernate.dialect.PostgreSQLDialectLocation:
application.properties:12This dialect enables PostgreSQL-specific features like:- Native UUID support
- Array types
- JSON/JSONB columns
- PostgreSQL-specific functions
Database schema generation strategy.Default:
Location:
Recommended Production Setting:
create-dropLocation:
application.properties:13Available Values:| Value | Behavior | Use Case |
|---|---|---|
create-drop | Creates schema on startup, drops on shutdown | Development/Testing |
create | Creates schema on startup, keeps on shutdown | Development |
update | Updates schema to match entities | Development |
validate | Validates schema, no modifications | Production |
none | No schema management | Production |
Security Properties
JWT token issuer identifier. Used in the
Location:
Used In:This value is validated when tokens are verified to ensure they were issued by this API.
iss claim of generated tokens.Environment Variable: user_jwtLocation:
application.properties:17Used In:
JwtUtils.java:31Example:Secret key used to sign and verify JWT tokens using HMAC256 algorithm.Environment Variable:
Location:
Used In:
key_jwtLocation:
application.properties:18Used In:
JwtUtils.java:34Generating a Secure Key:Environment-Specific Configuration
Development Environment
Production Environment
Testing Environment
application-test.properties
Additional Configuration Options
Logging Configuration
Add these properties to control logging levels:Connection Pool Configuration
Optimize database connection pooling:Performance Tuning
API Documentation Configuration
Validation and Troubleshooting
Verifying Configuration
Check that all required environment variables are set:Common Configuration Errors
Application fails to start - Missing database configuration
Application fails to start - Missing database configuration
Error:
Error creating bean with name 'dataSource'Cause: Required database environment variables not setSolution:JWT tokens fail to validate
JWT tokens fail to validate
Error:
JWTVerificationExceptionCause: security.jwt.key.private mismatch between environmentsSolution: Ensure the same JWT secret is used across all instances:Port already in use
Port already in use
Error: Or set via environment variable:
Port 8081 is already in useSolution: Change the server port:Database schema issues in production
Database schema issues in production
Error: Schema validation failuresCause: Using
create-drop in productionSolution: Change DDL auto mode:Configuration Hierarchy
Spring Boot loads configuration in the following order (later sources override earlier ones):- Default properties in
application.properties - Profile-specific properties (
application-{profile}.properties) - Environment variables
- Command-line arguments
Related Documentation
- Database Configuration - Detailed database setup guide
- Security Configuration - JWT and security configuration
- Deployment Guide - Production deployment instructions