- 
                Notifications
    
You must be signed in to change notification settings  - Fork 9
 
Configuration Management
This document covers the configuration architecture of the Effective Office system, including application settings, environment variables, deployment configurations, and configuration best practices. It focuses on how configuration is structured across the Spring Boot backend and deployment environments.
For information about database migrations and schema management, see Database & Configuration. For deployment procedures and Docker setup, see Docker Deployment.
The Effective Office system uses a layered configuration approach with Spring Boot profiles, environment variables, and external credential files. Configuration is separated into application-level settings, feature-specific configurations, and deployment-specific overrides.
The main application configuration is defined in application.yml with modular profile inclusion and environment variable substitution.
| Configuration Section | Purpose | Key Settings | 
|---|---|---|
| Server | HTTP server configuration | Port 8080, context path /api
 | 
| Spring Profiles | Module inclusion | 
repository profile included | 
| JPA/Hibernate | Database ORM settings | DDL auto-update, PostgreSQL dialect | 
| Flyway | Database migrations | Enabled by default, baseline on migrate | 
| Jackson | JSON serialization | Non-null inclusion, case-insensitive enums | 
| SpringDoc | API documentation | Swagger UI, package scanning | 
| Management | Actuator endpoints | Health, info, metrics exposed | 
| Logging | Application logging | Configurable log levels by package | 
The system extensively uses environment variables for deployment flexibility:
Database configuration is handled through the repository profile with connection pooling and migration management.
The system uses HikariCP for database connection pooling with optimized settings:
- Connection Timeout: 30 seconds
 - Maximum Pool Size: 10 connections
 - Minimum Idle: 5 connections
 - 
Pool Name: 
EffectiveOfficeHikariCP 
Flyway handles database schema migrations with the following settings:
- 
Enabled: Controlled by 
MIGRATIONS_ENABLEenvironment variable (default: true) - Baseline on Migrate: true for existing databases
 - 
Locations: 
classpath:db/migration - 
Table: 
flyway_schema_history 
Google Calendar integration uses conditional configuration based on the calendar.provider property.
| Property | Purpose | Default/Example | 
|---|---|---|
calendar.provider | 
Provider type | 
google or dummy
 | 
calendar.default-calendar | 
Default calendar ID | From DEFAULT_CALENDAR env var | 
calendar.application-name | 
Google API app name | From CALENDAR_APPLICATION_NAME
 | 
calendar.delegated-user | 
Impersonation email | From CALENDAR_DELEGATED_USER
 | 
calendar.credentials.file | 
OAuth2 credentials | classpath:google-credentials.json | 
The GoogleCalendarConfig class provides conditional bean creation:
Calendar subscription and push notification configuration supports both production and test environments.
| Property | Purpose | 
|---|---|
calendar.subscription.default-app-email | 
Default application email | 
calendar.subscription.application-url | 
Production webhook URL | 
calendar.subscription.test-application-url | 
Test environment webhook URL | 
calendar.subscription.calendars | 
Production calendar list | 
calendar.subscription.test-calendars | 
Test calendar list | 
calendar.subscription.firebase-credentials | 
Firebase service account key | 
The CalendarSubscriptionScheduler uses these settings to maintain Google Calendar push notification channels with automatic renewal every 6 days.
Docker Compose orchestrates the complete application stack with environment-based configuration.
- Application Port: 8080 (exposed internally)
 - Database Port: 5432 (exposed externally for development)
 - Reverse Proxy: Caddy with automatic SSL
 - Health Checks: PostgreSQL readiness checks
 - 
Restart Policy: 
unless-stoppedfor all services - Networks: Isolated bridge network with external Caddy network
 
- Credential Management: Service account keys stored as external files, referenced via environment variables
 - Environment Separation: Separate configuration for production and test environments
 - Database Security: Connection credentials passed through environment variables, not hardcoded
 - API Keys: JWT-based authentication with API key management through database
 
- 
Environment Variables: All deployment-specific values externalized to 
.envfiles - Profile Usage: Spring profiles separate concerns (repository, calendar provider)
 - Conditional Configuration: Feature-specific beans loaded only when needed
 - Health Monitoring: Actuator endpoints exposed for monitoring and health checks
 - Logging Strategy: Configurable log levels with package-specific granularity
 
The system includes several validation mechanisms:
- Database Health Checks: PostgreSQL readiness validation in Docker Compose
 - Calendar Provider Validation: Conditional bean loading prevents misconfiguration
 - Migration Safety: Flyway baseline-on-migrate prevents data loss
 - Connection Pool Monitoring: HikariCP provides connection pool metrics