cd server/
make db-migrate # Run Flyway database migrations
make dev # Start development server (port 5001)make dev- Start development server with Spring Boot DevToolsmake build- Build the application JAR
make format- Format code with Spotless (Google Java Style)make lint- Check code style with Spotless
make test- Run all tests with JUnit
make db-migrate- Apply Flyway migrationsmake db-clean- Clean database (WARNING: deletes all data)
The test suite uses JUnit 5 and Mockito.
Running Tests:
make test- Spotless: Java code formatter using Google Java Style
- Constructor injection: All Spring beans use constructor injection (no
@Autowiredfield injection)
Pre-commit Workflow:
make format && make lint && make testFlyway manages version-controlled schema migrations located in src/main/resources/db/migration/:
make db-migrate # Apply all pending migrations
make db-clean # Revert all migrations (development only)Migration naming: V{version}__{description}.sql (e.g., V1__Initial_schema.sql)
Multi-stage Docker build:
- Build Stage: Maven builds a fat JAR (
./mvnw clean package -DskipTests) - Production Stage: Eclipse Temurin JRE 21 slim image
- Non-root User: Application runs as non-root for security
Health check endpoint: /api/hello (used by Docker health checks)
Docker Compose manages the application:
# Development
docker compose -f docker/compose.yml up --build -d
# Production (pre-built images from GitHub Container Registry)
docker compose -f docker/compose.prod.yml up -d
# View logs
docker compose -f docker/compose.yml logs -f serverSpring Boot maps environment variables to configuration properties:
Required Variables:
LLM_BASE_URL,LLM_API_KEY,LLM_MODEL_NAME- Ollama LLM serviceJWT_SECRET_KEY- Security key for JWT token signingPOSTGRES_DB_URI- PostgreSQL JDBC connection stringEMAIL_*- Email service configurationINITIAL_ADMIN_EMAIL,INITIAL_ADMIN_PASSWORD- Bootstrap admin (optional)
The DB_SEED_ENABLED variable controls automatic database seeding on startup.
- Server Architecture - Architectural decisions and design patterns
- API Documentation - REST API endpoints and patterns
- Client Deployment - Client deployment procedures