# mosip/admin-services architecture

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

- Interactive diagram: https://gitdiagram.com/mosip/admin-services
- Repository: https://github.com/mosip/admin-services

## Overview

##### Main components
– The Masterdata Service (located in “admin/kernel-masterdata-service”) which handles master data operations.
– The Sync Data Service (located in “admin/kernel-syncdata-service”) for data synchronization between systems.
– The Hotlist Service (located in “admin/hotlist-service”) for handling hotlist related functionality.
- Essential support components:
– External Database(s): your SQL scripts are located under “db_scripts” and “db_upgrade_scripts.” Represent the database tier (or tiers) that store admin data, master data, and hotlist data.
– Deployment/Infrastructure: since the project uses Docker, Helm charts and Kubernetes manifests (see the “deploy” and “helm” directories), represent container orchestration and a Kubernetes cluster.
– CI/CD Pipeline: optionally show GitHub Actions and Travis integration as part of the build/test cycle.

##### Component relationships and interactions
– The Admin Service may interact with the Masterdata Service (to retrieve/update reference data), the Sync Data Service (to push or pull synchronization messages), and the Hotlist Service (for sending hotlist events).

##### Architectural patterns and design principles
- Microservices Architecture: Each service is built, containerized, and deployed independently. Emphasize the separation of concerns across Admin, Masterdata, Sync Data, and Hotlist.
- API-first design: As the README and code indicate, the services expose REST endpoints with Swagger/OpenAPI documentation, so note this by indicating an “API Gateway” or simply detailing “REST API endpoints.”
- DevOps pipeline: The repository contains CI/CD workflows (.github/workflows, Travis configuration) which are used to build, test, and deploy these services.

##### Relevant technologies and frameworks
- Java/Spring Boot for each of the microservices.
- Maven for build management.
- Docker for containerization.
- Kubernetes (with Helm charts) for deployment.
- Databases accessed through SQL scripts (e.g., PostgreSQL, MySQL, or any relational DB as per the provided SQL scripts).
- API documentation via Swagger/OpenAPI (as seen in the configuration files).
- CI/CD integration using GitHub Actions, Travis, and SonarCloud quality metrics as depicted in the README and associated workflow configuration files.

##### Final checklist
- Optionally, note out-of-band details such as batch processing, error handling (API exception handlers) and security filters.

## Diagram (Mermaid)

```mermaid
graph TD
    %% External UI
    UI["Admin UI"]:::ui

    %% CI/CD Pipeline Subgraph
    subgraph "CI/CD Pipeline"
        GH["GitHub Actions"]:::pipeline
        TC["Travis CI"]:::pipeline
    end

    %% Deployment/Orchestration Subgraph
    subgraph "Deployment/Orchestration"
        DC["Deploy Config"]:::deploy
        HC["Helm Charts"]:::deploy
    end

    %% Kubernetes Cluster Subgraph
    subgraph "Kubernetes Cluster"
        subgraph "Microservices"
            AS["Admin Service"]:::service
            MS["Masterdata Service"]:::service
            SS["Sync Data Service"]:::service
            HS["Hotlist Service"]:::service
        end
    end

    %% Database Layer Subgraph
    subgraph "Database Layer"
        DBS["DB Scripts"]:::db
        DBU["DB Upgrade Scripts"]:::db
    end

    %% Relationships
    UI -->|"REST_API"| AS
    GH --- TC
    GH --> DC
    TC --> DC
    DC --> HC
    HC --> AS
    HC --> MS
    HC --> SS
    HC --> HS

    AS -->|"ReferenceData"| MS
    AS -->|"SyncCall"| SS
    AS -->|"HotlistEvent"| HS

    AS --- DBS
    AS --- DBU
    MS --- DBS
    MS --- DBU
    SS --- DBS
    SS --- DBU
    HS --- DBS
    HS --- DBU

    %% Click Events
    click AS "https://github.com/mosip/admin-services/tree/master/admin/admin-service"
    click MS "https://github.com/mosip/admin-services/tree/master/admin/kernel-masterdata-service"
    click SS "https://github.com/mosip/admin-services/tree/master/admin/kernel-syncdata-service"
    click HS "https://github.com/mosip/admin-services/tree/master/admin/hotlist-service"
    click DBS "https://github.com/mosip/admin-services/tree/master/db_scripts"
    click DBU "https://github.com/mosip/admin-services/tree/master/db_upgrade_scripts"
    click DC "https://github.com/mosip/admin-services/tree/master/deploy"
    click HC "https://github.com/mosip/admin-services/tree/master/helm"
    click GH "https://github.com/mosip/admin-services/blob/master/.github"
    click TC "https://github.com/mosip/admin-services/blob/master/.travis.yml"

    %% Styles
    classDef ui fill:#ffebcd,stroke:#8b4513,stroke-width:2px;
    classDef pipeline fill:#add8e6,stroke:#00008b,stroke-width:2px;
    classDef deploy fill:#f0e68c,stroke:#b8860b,stroke-width:2px;
    classDef service fill:#d1e7dd,stroke:#0f5132,stroke-width:2px;
    classDef db fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
```
