How it-at-m/dave-backend works
Project Type and Purpose
• This repository is the “Backend (Datenportal)” component for DAVe – a core Spring Boot service providing business logic for several frontends (Datenportal, Adminportal, Selfserviceportal) and an EAI interface.
• It handles data access, search functionality (using Elasticsearch for “Stammdaten”), relational database storage (for Zähldaten), integrated PDF generation, data processing (including KI-based Hochrechnung), and external service integration (email, SSO, etc.).
• Technologies include Java 21, Spring Boot 3.3, and Elasticsearch 8.15, with deployment support via Docker and Maven.
File Structure to Identify Main Components
• Presentation/API Layer: Located in the “src/main/java/de/muenchen/dave/controller” folder. These controllers expose REST endpoints for frontends and other integrated systems.
• Business Logic / Service Layer: Numerous services in “src/main/java/de/muenchen/dave/services” (including specialized subdirectories for messstelle, email, pdfgeneration, etc.) implement the core application logic.
• Persistence/Repository Layer: Found in “src/main/java/de/muenchen/dave/repositories” (both relational and Elasticsearch repositories) for data access and storage. This separates data retrieval logic for both types of data.
• Domain Model: Under “src/main/java/de/muenchen/dave/domain”, showing how various business entities (e.g., Zaehlung, Zaehlstelle, Messstelle) are modeled.
• Configuration & Infrastructure: The “src/main/java/de/muenchen/dave/configuration” folder provides configuration classes (caching, security, Flyway migration, aspect logging, etc.), while additional files (application.yml, Dockerfile, and migration scripts) support environment settings and deployment.
• Additional Utilities: Supporting functionality like PDF generation templates (and helper classes), file templates with Mustache, email integration, and data processing utilities.
• Security & SSO: Classes in “src/main/java/de/muenchen/dave/security” and related “sso-config” files indicate integration with SSO/authorization mechanisms.
Architectural Patterns and Key Relationships
• Layered Architecture: The system follows a clear separation of concerns – Controllers (API) call Services (business logic), which in turn interact with Repositories (database and search engines) and Domain models.
• Integration with External Systems:
– Relational Database (e.g., Oracle) for transactional data storage.
– Elasticsearch for indexing and searching “Stammdaten”.
– External services for PDF generation (using Mustache templates) and email handling.
• Use of Aspect-oriented programming and caching configurations indicates performance optimizations and modular cross-cutting concerns.
• Security configurations demonstrating server-to-server security alongside possible SSO integration.
• The project also contains build and deployment automation via Maven, Docker, and CI/CD configurations (.github, .gitlab-ci.yml).