MOSIP Commons is a collection of foundational libraries used across all MOSIP microservices.
It contains services to support configuration management, ID generation, notifications, and cryptographic salt generation.
The following core services are part of MOSIP Commons:
- Kernel Notification Service - Centralized notification service for sending messages such as SMS, emails.
- Kernel Config Server - Centralized configuration service used by all MOSIP microservices.
- Kernel RID Generator Service - Generates globally unique Registration IDs (RID).
- Kernel ID Generator Service - Generates unique IDs required across MOSIP service.
- Kernel PRID Generator Service - Generates Pre-Registration IDs (PRID).
- Kernel Salt Generator - Generates cryptographically strong salts for cryptographic operation.
Before starting the local setup, execute the required SQL scripts to initialize the database. All database SQL scripts are available in the db scripts directory.
- JDK: 21
- Maven: 3.9+
- Docker: Latest
- PostgreSQL: 10+
- Keycloak/IDP: Required for notification authentication
- Config Server with correct property files
Add below runtime dependencies to the classpath, or include it as a Maven dependency:
- Add
kernel-auth-adapter.jar - Add
kernel-smsserviceprovider-msg91.jar
Common module uses the following configuration files that are accessible in this repository. Please refer to the required released tagged version for configuration.
- application-default.properties : Contains common configurations which are required across MOSIP modules.
- kernel-default.properties : Contains configurations required or to be overridden for Commons module.
- Make sure the config server is running. For detailed instructions on setting up and running the config server, refer to the MOSIP Config Server Setup Guide.
Note: Refer to the MOSIP Config Server Setup Guide for setup, and ensure the properties mentioned above in the configuration section are taken care of. Replace the properties with your own configurations (e.g., DB credentials, IAM credentials, URL).
- Clone the repository:
git clone <repo-url>
cd commons
- Build the project:
mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
-
Start the application:
- Click the Run button in your IDE, or
- Run via command:
java -jar target/specific-service:<$version>.jar
-
Verify Swagger is accessible.
Recommended for users who want a quick, ready-to-use setup — testers, students, and external users.
Pull the latest pre-built images from Docker Hub using the following commands:
docker pull mosipid/kernel-notification-service:1.3.0
Recommended for contributors or developers who want to modify or build the services from source.
- Clone and build the project:
git clone <repo-url>
cd commons
mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
- Navigate to each service directory and build the Docker image:
cd kernel/<service-directory>
docker build -t <service-name> .
Start each service using Docker:
docker run -d -p <port>:<port> --name <service-name> <service-name>
Check that all containers are running:
docker ps
Access the services at http://localhost:<port> using the port mappings listed abov
To deploy Admin services on a Kubernetes cluster, refer to the Sandbox Deployment Guide.
API endpoints, base URL, and mock server details are available via Swagger documentation: MOSIP Common Service API Documentation.
To learn more about MOSIP services from a functional perspective and use case scenarios, refer to our main documentation: Click here.
• To learn how you can contribute code to this application, click here.
• If you have questions or encounter issues, visit the MOSIP Community for support.
• For any GitHub issues: Report here
This project is licensed under the Mozilla Public License 2.0.