Skip to content

mosip/pre-registration

Repository files navigation

Maven Package upon a push Quality Gate Status

Overview

The Pre-Registration module enables a resident to:

  1. Resident can login into PreRegistration with email id / phone number
  2. Resident can create multiple PreRegistration application.
  3. For each PreRegistration application, resident can give demographic data in multiple languages.
  4. For each PreRegistration application, resident can upload various proof documents.
  5. For each PreRegistration application, resident can search for a Registration Center and search for suitable appointment slots.
  6. For each PreRegistration application, resident can book an appointment at suitable Registration Center
  7. For every appointment booking, resident can get the acknowledgement as well as a notification via email id / phone number.
  8. Resident can cancel the appointment or reschedule it as well.

It exposes a set of APIs that enables resident to do Pre-Registration activities efficiently. A reference front-end implementation is available in the Pre-registration UI.

For a complete functional overview and capabilities, refer to the official documentation.

Pre-registration Developers Guide here

Services

Pre-registration module consists of the following services:

  1. Application - This service helps to create a Pre Registration application for a resident and it also uses Pre Registration Booking service to book appointment.
  2. Batchjob - This cron job runs as per the schedule and helps is many background tasks like creating appointment slots for registration centres, archiving pre-registration applications once workflow is over etc.
  3. Captcha - (Deprecated) - This service is no longer in use. Captcha functionality is now provided by: - MOSIP Captcha Service
  4. Core - This service contains many reusable components across all Pre Registration services
  5. Datasync - This service syncs Pre Registration application data with Registration Centre. This service also marks Pre Registration application as consumed (reverse sync) from Registration Processor once the workflow is complete.

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

The project can be set up in two ways:

  1. Local Setup (for Development or Contribution)
  2. Local Setup with Docker (Easy Setup for Demos)

Prerequisites

Before you begin, ensure you have the following installed:

  • JDK: 21.0.3
  • Maven: 3.9.6
  • Docker: Latest stable version
  • PostgreSQL: 10.2
  • Keycloak: Check here

Runtime Dependencies

  • Add kernel-auth-adapter.jar to the classpath, or include it as a Maven dependency — Download
  • Add kernel-transliteration-icu4j.jar to the classpath, or include it as a Maven dependency — Download
  • Add kernel-ref-idobjectvalidator.jar to the classpath, or include it as a Maven dependency — Download
  • Add kernel-virusscanner-clamav.jar to the classpath, or include it as a Maven dependency — Download

Configuration

Required Configuration Properties

The following properties must be configured with your environment-specific values before deployment:

Database Configuration:

  • mosip.prereg.database.hostname - Database hostname (default: postgres-postgresql.postgres)
  • mosip.prereg.database.port - Database port (default: 5432)
  • db.dbuser.password - Database user password (passed as environment variable)

IAM/Keycloak Configuration:

  • keycloak.internal.url - Internal Keycloak URL (passed as environment variable)
  • keycloak.external.url - External Keycloak URL (passed as environment variable)
  • mosip.prereg.client.secret - PreReg client secret for Keycloak (passed as environment variable)

Service URLs:

  • mosip.kernel.authmanager.url - Auth manager service URL
  • mosip.kernel.prereg-application.url - PreReg Application service URL
  • mosip.kernel.prereg-datasync.url - PreReg DataSync service URL
  • mosip.api.internal.url - Internal API base URL

Security Configuration:

  • mosip.security.origins - Allowed CORS origins (default: localhost:8080)
  • mosip.security.secure-cookie - Enable secure cookies (default: false)
  • mosip.pre-registration-services.cookie.security - Cookie security flag (default: true)

Note:

  • If using config-server: Properties marked as environment variables (e.g., db.dbuser.password, keycloak.internal.url, keycloak.external.url, mosip.prereg.client.secret) must be passed through the config-server's 'overrides' environment variables and should NOT be defined in property files. Refer to the config-server helm chart for more details.
  • If using application properties directly: Update these properties directly in your application.properties or pre-registration-default.properties file with your environment-specific values.

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 pre-registration
  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 at: http://localhost:8080/preregistration/v1/application-service/swagger-ui/index.html

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/pre-registration-application-service:1.3.0-beta.2
docker pull mosipid/pre-registration-datasync-service:1.3.0-beta.2
docker pull mosipid/pre-registration-batchjob:1.3.0-beta.2
docker pull mosipid/pre-registration-booking-service:1.3.0-beta.2

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 pre-registration
mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
  1. Navigate to each service directory and build the Docker image:
cd pre-registration/<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 above.

Deployment

Kubernetes

To deploy Pre-Registration services on a Kubernetes cluster, refer to the Sandbox Deployment Guide.

Usage

Pre-Registration UI

For the complete Pre-Registration UI implementation and usage instructions, refer to the Pre-Registration UI GitHub repository.

Documentation

For more detailed documents for repositories, you can check here.

API Documentation

API endpoints, base URL, and mock server details are available via Stoplight and Swagger documentation: MOSIP Pre-Registration Service API Documentation.

Product Documentation

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

Testing

Automated functional tests are available in the Functional Tests repository.

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 services for pre-registering an Individual with MOSIP

Resources

License

Stars

Watchers

Forks

Packages