How mosip/pre-registration works
Based on our analysis of the file tree and README, this MOSIP Pre-registration project is a multi-module, full‐stack server component that exposes several API endpoints to support the pre-registration function. The repository is organized into multiple services (modules) such as Application, Booking, Batchjob, Captcha, and Datasync. In addition, there are dedicated sections for database scripts, core functionalities, and configuration assets.
Main Components
• Config Server (external): As noted in the README, all pre-registration services depend on a centralized configuration server.
• Core Services: The project is divided into separate service modules:
• Application Service (handles core pre-registration API endpoints and business logic)
• Booking Service (manages registration center bookings and slot availability)
• Batchjob Service (processes batch operations such as status updates, data purging, and slot generation)
• Captcha Service (provides CAPTCHA generation and verification functionality)
• Datasync Service (handles data synchronization between systems)
• Database: Multiple directories for database DDL scripts and upgrade scripts indicate a well-structured database layer.
• External/Supporting Systems:
• Front-end UI (reference provided to the Pre-registration UI repository)
• Deployment infrastructures (Docker, Kubernetes, and CI/CD pipelines shown by GitHub workflows and Travis)
Relationships and Interactions
• The external Config Server supplies runtime configuration values to all these services.
• Each service’s container will communicate with the database using standardized SQL scripts (accounting for DDL, grants, and upgrade procedures).
• The services expose REST API endpoints (as suggested by the presence of controllers in each service’s directory).
• The Batchjob service likely interacts with the same database to process pre-registration records—indicating a background process interacting with the core Application and Booking data.
• The Datasync service imports/exports data via defined DTOs and entity mappings.
• The Captcha service encapsulates operations for CAPTCHA validation and may integrate with third-party providers.
• The Application Service is central and interacts with various persistence layers through repositories, service utilities, and exception handlers.
• There is also a clearly separated error handling and logging layer for each module.
Architectural Patterns and Design Principles
• Microservice Architecture: Each module (application, booking, batchjob, captcha, and datasync) is encapsulated as an independent service, likely built with Spring Boot.
• Layered Architecture: Within each service, there are traditionally distinct layers – controllers (API endpoints), service layers (business logic), repository/data access layers, DTOs, and exception handling.
• Containerization and CI/CD: Dedicated Dockerfiles and CI workflow files (GitHub actions, Travis) indicate containerized builds and automated deployments.
• Database Versioning: Separate directories for DDL and upgrade scripts reflect a well-organized database versioning strategy.
Relevant Technologies, Frameworks, and Libraries
• Java and Maven for service development (evidenced by the extensive pom.xml files across services).
• Spring Boot framework for building RESTful APIs and managing dependency injection.
• Docker for containerization.
• Kubernetes for service deployment (as referenced in deployment guides).
• Database technology which is managed by SQL scripts.
• CI/CD tooling provided by GitHub workflows and Travis.
• A clear label for each service module (Application, Booking, Batchjob, Captcha, Datasync) and the interconnections between these modules.
• An external Config Server that provides configuration to all microservices.
• REST API layers in each service (controller, service, repository) to show the flow of data.
• Communication with external resources (e.g., the UI, third-party CAPTCHA providers if applicable, and container orchestration platforms).