How darexl/veronica-open-api works
Project Type & Purpose
• Veronica is a full-stack backend API (Spring-Boot 1.5.9) for electronic invoicing under Ecuador’s SRI rules.
• It persists documents in PostgreSQL, signs XML, generates PDF RIDEs, secures endpoints via OAuth2, and publishes Swagger docs.
Core Architectural Layers & Modules
A top-level view splits the system into these modules (Maven sub-projects):
• app
• Spring-Boot entrypoint (VeronicaApplication)
• REST Controllers (app/api/v1)
• Configuration (Security, Swagger, JAXB, Beans)
• OAuth2 Authorization & Resource Server
• service
• Business logic layer
• Service interfaces & implementations for CRUD and SRI operations
• XML signer, digital certificate handling (MITyC, xmlsec, jss libs)
• persistence
• Spring Data JPA repositories (CRUD on domain entities)
• domain
• JPA Entity definitions (Invoice, CreditMemo, DebitMemo, etc.)
• ride
• RIDEGenerator producing PDFs via JasperReports JRXML templates
• additional_libs
• Custom jars (MITyC Java signing, xmlsec, jss) installed manually into Maven local
External Dependencies & Services
• Database: PostgreSQL
• SRI Web Service: External REST/SOAP endpoints for document authorization
• OAuth2 Clients: Clients obtain Bearer tokens from Veronica’s /oauth/token
• Swagger UI: Built into app at /swagger-ui.html
• Postman Collection: Examples under src/postman
Relationships & Data Flow
• Client → (HTTPS/JSON+Bearer) → app:Controller
• Controller → service:BusinessLogic
• CRUD services call persistence:Repository → PostgreSQL
• SRI services call external SRI Web Service
• Digital signature routines use additional_libs
• service → ride:RIDEGenerator to produce PDF
• Controller returns status, signed XML, PDF links
Architectural Patterns & Design Principles
• Layered Architecture: Presentation (Controllers), Service, Persistence, Domain
• Dependency Injection via Spring
• API Versioning under /api/v1.0
• OAuth2 for security (Authorization Server + Resource Server)
• Externalization of Config: application.properties, filters (dev/prd), log4j2
Essential Elements
• External service: SRI
• Blue = API/Controllers
• Green = Business Services
• Yellow = Persistence/DB
• Gray = External libs & services