# mosip/registration-client architecture

> Architecture diagram of the GitHub repository mosip/registration-client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mosip/registration-client
- Repository: https://github.com/mosip/registration-client

## Overview

##### Major Components
a. Registration Client (Desktop Application):
- Located in the “registration-client” folder.
- Implements the UI elements (using JavaFX and FXML – see abundant FXML and CSS files) and handles user interaction.
- Connects to other modules (e.g., authentication, document scanning interfaces, and packet upload processes).
b. Registration API:
- Found in “registration-api” – this module defines RESTful APIs (and/or other service interfaces) for downstream communication.
- Acts as a façade to the client and abstracts out business calls.
c. Registration Services:
- This is the heavy lifting in “registration-services”. It houses business logic, DAO (data access objects), service implementations, batch jobs, integration with MDM modules, and even scheduled jobs (look at “jobs” packages).
- It connects with data repositories (SQL scripts under “db_scripts” and “db_release_scripts” for schema/deployment) to persist and retrieve registration data.
d. Database:
- The deployment and release scripts indicate the existence of a relational database that is managed by the provided SQL scripts.
e. Integration/Reference Implementations:
- “ref-impl” modules such as “ref-document-scanner” and “ref-geoposition-rxtx” indicate specialized integrations to handle biometric scanning and geo-positioning.
f. Design and Testing Artifacts:

##### Relationships and Data Flow
- From the API, there should be a clear “service layer” connection (Registration Services) where the majority of the business logic executes.
- The Services layer communicates with the Database (persistent store) and may also interact with external modules (e.g., Pre-Registration module data input, Document Scanner, and GeoPosition modules).

##### Architectural Patterns & Design Principles
- Layered Architecture: Emphasize separation among the UI (client), API/Controller layer, service/business logic, and the repository/data access layer.
- Modularity: Break down the system into multiple Maven modules (client, API, services, test), and show integration with external services (ref-impl modules).
- Integration Points: Mark distinct components for device integration (e.g., document scanning and biometric capture) and external pre-registration data.
- Testing: Optionally, indicate that there is a comprehensive test suite (registration-test) ensuring quality across components.

- Registration Client:
– Contains UI controllers, FXML layouts, and a preloader.
– Handles authentication, document scanning, biometric capture, and user navigation.
- Registration API:
– Serves as a façade that exposes endpoints consumed by the client.
– Routes requests to the business logic.
- Registration Services:
– Contains business logic organized into packages (authentication, audit, packet handling, remapping, synchronization, configuration).
– Leverages DAO modules which interact with the database.
– Includes scheduled jobs (sync jobs, deletion, key policy jobs) and external integration (MDM, Remap Services).
- Database and Deployment:
– Represented by DB scripts and database release scripts.
- External Integration Modules:
– Document scanner (ref-document-scanner).
– Geo-positioning (ref-geoposition-rxtx).
– Pre-registration module integration providing input data.
- Testing and Design Documentation:

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        RC["Registration Client (Desktop UI - JavaFX)"]:::client
    end

    %% API Layer
    subgraph "API Layer"
        RA["Registration API Layer"]:::api
    end

    %% Service Layer
    subgraph "Service Layer"
        RS["Registration Service Layer"]:::service
        subgraph "Internal Service Components"
            Auth["Authentication/Audit"]:::service
            Packet["Packet Handling"]:::service
            Scheduler["Scheduled Jobs"]:::service
        end
    end

    %% Integration Modules
    subgraph "Integration Modules"
        DS["Document Scanner Integration"]:::integration
        GP["Geo-positioning Integration"]:::integration
    end

    %% Database Layer
    subgraph "Database"
        DBS["DB Schema Scripts"]:::database
        DBD["DB Deployment Scripts"]:::database
    end

    %% Artifacts
    subgraph "Artifacts"
        Design["Design Documentation"]:::artifact
        Test["Testing Artifacts"]:::artifact
    end

    %% Connections between layers
    RC -->|"sendsRequests"| RA
    RA -->|"routesCalls"| RS
    RS -->|"executes"| Auth
    RS -->|"executes"| Packet
    RS -->|"executes"| Scheduler
    RS -->|"persistsData"| DBS
    RS -->|"persistsData"| DBD
    DBS -->|"dataRead"| RS
    DBD -->|"dataRead"| RS
    RS -->|"integrates"| DS
    RS -->|"integrates"| GP
    RA -->|"respondsTo"| RC

    %% Click Events
    click RC "https://github.com/mosip/registration-client/tree/master/registration/registration-client"
    click RA "https://github.com/mosip/registration-client/tree/master/registration/registration-api"
    click RS "https://github.com/mosip/registration-client/tree/master/registration/registration-services"
    click DS "https://github.com/mosip/registration-client/tree/master/registration/ref-impl/ref-document-scanner"
    click GP "https://github.com/mosip/registration-client/tree/master/registration/ref-impl/ref-geoposition-rxtx"
    click DBS "https://github.com/mosip/registration-client/tree/master/db_scripts"
    click DBD "https://github.com/mosip/registration-client/tree/master/db_release_scripts"
    click Design "https://github.com/mosip/registration-client/tree/master/design"
    click Test "https://github.com/mosip/registration-client/tree/master/registration/registration-test"

    %% Styles
    classDef client fill:#FFEEAD,stroke:#333,stroke-width:1px;
    classDef api fill:#AEDFF7,stroke:#333,stroke-width:1px;
    classDef service fill:#C8E6C9,stroke:#333,stroke-width:1px;
    classDef database fill:#FFE0B2,stroke:#333,stroke-width:1px;
    classDef integration fill:#FFCDD2,stroke:#333,stroke-width:1px;
    classDef artifact fill:#E1BEE7,stroke:#333,stroke-width:1px;
```
