How more-platform/more-studymanager-backend works
Main Components to Identify
• API / Controller Layer: Represent all the controllers (e.g., LoginController, various V1 API controllers) in the “studymanager” module. These endpoints are what front-end clients or other services will interact with.
• Service Layer: Include the diverse services (ActionService, ParticipantService, StudyService, SchedulingService, etc.) that contain business logic.
• Repository / Persistence Layer: Note the repositories handling data access, with support from database migration scripts located in the resources folder.
• Domain / Core Module: Highlight the “studymanager-core” module. This module encapsulates the core domain entities (such as Study, Participant, Action, Observation, Notification, etc.) and factories/SDK components.
• Intervention & Observation Modules: Separate out the “studymanager-intervention” and “studymanager-observation” modules, which extend the core with domain-specific functionalities for interventions (for example, push notifications and scheduled triggers) and observations (supporting various observation types, including those relating to LimeSurvey or mobile data).
• External Integrations: Identify external systems that this backend interfaces with:
– OAuth2 Authorization Server / Keycloak (as indicated in both the README and configuration classes)
– Elastic Search (configured via ElasticConfiguration and related service classes)
– Firebase Messaging (as seen in FirebaseConfiguration and corresponding service)
– Possibly other external data sources/APIs exposed through the SDK.
• Development & Deployment Services: Include Docker Compose as a container orchestration unit (with services such as the database, auth server, etc.) signified by the docker-compose.yaml file.
Relationships and Interactions
• Scheduled tasks (using cron or interval schedules) should be shown triggering jobs (e.g., trigger observations or interventions) within the system.
Architectural Patterns and Technologies
• The application follows a layered architecture (Controller → Service → Repository/Domain Model) with a clear separation of concerns.
• It is built using Spring (or a similar dependency injection framework) evidenced by configuration classes for security and web components.
• The Maven multi-module structure reinforces separation of concerns; each module (core, intervention, observation) encapsulates specific areas of responsibility.
• Integration with external systems via dedicated configuration and SDK classes is a key design principle.