Skip to content

mosip/commons

Repository files navigation

MOSIP Commons

Maven Package upon a push Quality Gate Status

Overview

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.


Services

The following core services are part of MOSIP Commons:


  1. Kernel Notification Service - Centralized notification service for sending messages such as SMS, emails.
  2. Kernel Config Server - Centralized configuration service used by all MOSIP microservices.
  3. Kernel RID Generator Service - Generates globally unique Registration IDs (RID).
  4. Kernel ID Generator Service - Generates unique IDs required across MOSIP service.
  5. Kernel PRID Generator Service - Generates Pre-Registration IDs (PRID).
  6. Kernel Salt Generator - Generates cryptographically strong salts for cryptographic operation.

Database

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.

Local Setup

Prerequisites

  • JDK: 21
  • Maven: 3.9+
  • Docker: Latest
  • PostgreSQL: 10+
  • Keycloak/IDP: Required for notification authentication
  • Config Server with correct property files

Runtime Dependencies

Add below runtime dependencies to the classpath, or include it as a Maven dependency:

  • Add kernel-auth-adapter.jar
  • Add kernel-smsserviceprovider-msg91.jar

Configuration

Common module uses the following configuration files that are accessible in this repository. Please refer to the required released tagged version for configuration.

Installation

Local Setup (for Development or Contribution)

  1. 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).

  1. Clone the repository:
git clone <repo-url>
cd commons 
  1. Build the project:
mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
  1. Start the application:

    • Click the Run button in your IDE, or
    • Run via command: java -jar target/specific-service:<$version>.jar
  2. Verify Swagger is accessible.

Local Setup with Docker (Easy Setup for Demos)

Option 1: Pull from Docker Hub

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

Option 2: Build Docker Images Locally

Recommended for contributors or developers who want to modify or build the services from source.

  1. Clone and build the project:
git clone <repo-url>
cd commons
mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
  1. Navigate to each service directory and build the Docker image:
cd kernel/<service-directory>
docker build -t <service-name> .

Running the Services

Start each service using Docker:

docker run -d -p <port>:<port> --name <service-name> <service-name>

Verify Installation

Check that all containers are running:

docker ps

Access the services at http://localhost:<port> using the port mappings listed abov


Deployment

Kubernetes

To deploy Admin services on a Kubernetes cluster, refer to the Sandbox Deployment Guide.

Documentation

API Documentation

API endpoints, base URL, and mock server details are available via Swagger documentation: MOSIP Common Service API Documentation.

Product Documentation

To learn more about MOSIP services from a functional perspective and use case scenarios, refer to our main documentation: Click here.


Contribution & Community

• 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


License

This project is licensed under the Mozilla Public License 2.0.

About

This repository contains common utilities and services used by other MOSIP modules

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 77