System Architecture
HERCULES SGI is built on a modern, scalable microservices architecture designed to handle complex research management workflows across multiple Spanish universities.Architecture Overview
The system follows a three-tier architecture with clear separation of concerns:Presentation Layer
Angular 11+ single-page application providing a responsive, Material Design user interface
All services communicate via REST APIs over HTTP/HTTPS with OAuth2 JWT token authentication.
High-Level Architecture Diagram
Microservices Overview
HERCULES SGI consists of 11 independent backend microservices, each responsible for a specific domain:CSP Service
Convocatorias, Solicitudes y ProyectosPort:
4281Manages the complete lifecycle of funding calls, grant applications, and research projects including contracts and agreements.ETI Service
Ética en la InvestigaciónPort:
4280Ethics committee management allowing researchers to submit projects for evaluation and committee members to manage the review process.PII Service
Propiedad Industrial e IntelectualPort:
4282Manages inventions and their industrial/intellectual property protections including patents, trademarks, and copyrights.PRC Service
Producción CientíficaPort:
4283Tracks and manages scientific production including publications, conferences, and other research outputs.CNF Service
ConfiguraciónPort:
4288Central configuration management service storing system-wide parameters and settings.COM Service
ComunicadosPort:
4286Centralized communication service for managing notifications, emails, and alerts across the system.USR Service
UsuariosPort:
4289User and role management service handling permissions and access control.REP Service
ReportingPort:
4287Centralized report generation service for creating PDF and Excel reports across all modules.TP Service
Tareas ProgramadasPort:
4285Scheduled tasks and batch job execution service for automated processes.REL Service
RelacionesPort:
4284Service managing relationships and cross-references between different modules.EER Service
Entities and External RelationsPort:
4290Manages external entities and relationships with external systems.Frontend Architecture
The Angular frontend is organized into feature modules corresponding to each backend service:Key Frontend Technologies
The frontend uses @ngx-formly for dynamic form generation and @ngx-translate for internationalization (i18n).
Authentication & Authorization Flow
HERCULES SGI uses Keycloak for OAuth2/OpenID Connect authentication:Token Issuance
Keycloak validates credentials and issues JWT tokens:
- Access Token: Short-lived token for API access
- Refresh Token: Long-lived token for obtaining new access tokens
- ID Token: Contains user identity information
OAuth2 Configuration
Each service is configured as both an OAuth2 client and resource server:Database Architecture
Each microservice has its own dedicated PostgreSQL database following the database-per-service pattern:Schema Management with Liquibase
All database schemas are managed using Liquibase for version control:Database Support
The system supports multiple database engines:- PostgreSQL
- Oracle
- SQL Server
- H2 (Dev)
Recommended for production
Service Communication Patterns
Synchronous REST Communication
Services communicate via synchronous REST API calls:Service-to-Service Authentication
Services use client_credentials OAuth2 flow for inter-service communication:External System Integration
HERCULES SGI integrates with external systems through a dedicated ESB (Enterprise Service Bus):The ESB layer provides abstraction and transformation for external system APIs, allowing HERCULES SGI to remain independent of specific vendor implementations.
Deployment Architecture
Container-Based Deployment
Each service is containerized using Docker:Production Deployment Topology
Monitoring & Observability
Each service exposes Spring Boot Actuator endpoints:/actuator/health- Service health status/actuator/info- Service build information/actuator/metrics- Performance metrics/actuator/prometheus- Prometheus-compatible metrics
Technology Stack Summary
Backend Framework
- Spring Boot 2.4+
- Spring Data JPA
- Spring Security OAuth2
- Hibernate ORM
- Liquibase
Frontend Framework
- Angular 11+
- Angular Material
- RxJS 6.5+
- Keycloak JS Adapter
- Luxon (DateTime)
Data & Persistence
- PostgreSQL 12+
- Oracle 12c+ (optional)
- SQL Server 2016+ (optional)
- H2 (development)
Security & Auth
- Keycloak 11.0.0
- OAuth2 / OpenID Connect
- JWT Tokens
- Spring Security
Best Practices
Microservice Independence: Each service can be developed, deployed, and scaled independently.Database Isolation: No direct database access between services; all communication via APIs.Configuration Management: Centralized configuration with profiles for different environments.Security First: All APIs protected with OAuth2; no anonymous access.Schema Versioning: All database changes tracked in Liquibase changesets.
Next Steps
Configuration
Configure services for your environment
API Reference
Explore the REST API endpoints
Deployment
Deploy HERCULES SGI