How cristianandresherrmann/sigelic works
Project type and purpose
• SIGELIC is a full-stack, monolithic web application for automating the end-to-end issuance and renewal of driver’s licenses for a municipality.
• The README confirms: Java 21 + Spring Boot backend, Vaadin 24 UI, MySQL database, Flyway for migrations, and H2 for testing.
File structure
• Top-level build and config: pom.xml, Maven wrapper, .env example, Flyway scripts under src/main/resources/db/migration.
• Frontend: Vaadin UI is written in Java under src/main/java/.../views and served by the Spring Boot application. The generated client artifacts appear in src/main/frontend/generated.
• Backend layers under src/main/java/com/example/sigelic:
• config: security and bootstrap
• controller: REST endpoints / Vaadin view controllers
• service: business logic
• repository: Spring Data JPA interfaces
• model: JPA entities
• dto: request/response objects
• mapper: conversion between entities and DTOs
• util: helper classes
• exception: error handling
• Resources: application.properties, static assets (CSS), Flyway SQL migration files.
• Tests: integration and unit tests under src/test and HTTP API tests under tests/.
Key insights from README
• How Vaadin interacts with the Spring Boot backend rather than a separate SPA.
a. Main components
• Client Browser
• Vaadin UI layer (server-side rendering)
• Spring MVC / REST Controllers
• Service layer (business rules, transaction management)
• Data layer (Spring Data JPA repositories)
• Database (MySQL in production, H2 in test profile)
• Flyway migrations (runs at startup)
• Spring Security (authN/authZ)
b. Relationships and interactions
1. Browser sends HTTP(S) requests → Vaadin UI endpoints
2. Vaadin invokes Controller methods → Service layer
3. Service layer calls Repository interfaces → Database
4. Flyway executes migration scripts on application startup
5. Spring Security intercepts incoming requests for authentication and authorization
6. Maven builds the entire artifact (packaging frontend resources into the Spring Boot JAR)
c. Architectural patterns and design principles
• Layered (Presentation → Controller → Service → Repository → Database)
• MVC-ish with Vaadin doing the view and controller in Java
• DTOs and Mappers to decouple persistence models from external API
• Exception handling via a GlobalExceptionHandler
• Database versioning with Flyway ensures schema evolution
d. Technologies & frameworks
• Java 21, Spring Boot 3.3.2, Spring Data JPA, Spring Security, Flyway, Lombok
• Vaadin 24 for UI
• MySQL 8.x (H2 for tests)
• Maven for build and dependency management
Elements
Browser → Vaadin UI → Controller → Service → Repository → Database
• Business logic (services) in another
• Data access in a third
• External systems (DB, Flyway, Maven build) in a fourth
• Related classes/modules by package layers to show package boundaries.
• Important cross-cutting concerns:
• Authentication & Authorization via Spring Security
• Data validation in DTOs and error handling in GlobalExceptionHandler