The Pre-Registration module enables a resident to:
- Resident can login into PreRegistration with email id / phone number
- Resident can create multiple PreRegistration application.
- For each PreRegistration application, resident can give demographic data in multiple languages.
- For each PreRegistration application, resident can upload various proof documents.
- For each PreRegistration application, resident can search for a Registration Center and search for suitable appointment slots.
- For each PreRegistration application, resident can book an appointment at suitable Registration Center
- For every appointment booking, resident can get the acknowledgement as well as a notification via email id / phone number.
- 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
Pre-registration module consists of the following services:
- Application - This service helps to create a Pre Registration application for a resident and it also uses Pre Registration Booking service to book appointment.
- 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.
- Captcha - (Deprecated) - This service is no longer in use. Captcha functionality is now provided by: - MOSIP Captcha Service
- Core - This service contains many reusable components across all Pre Registration services
- 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.
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.
The project can be set up in two ways:
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
- Add
kernel-auth-adapter.jarto the classpath, or include it as a Maven dependency — Download - Add
kernel-transliteration-icu4j.jarto the classpath, or include it as a Maven dependency — Download - Add
kernel-ref-idobjectvalidator.jarto the classpath, or include it as a Maven dependency — Download - Add
kernel-virusscanner-clamav.jarto the classpath, or include it as a Maven dependency — Download
- Pre-Registration module uses the following configuration files that are accessible in this repository. Please refer to the required released tagged version for configuration. Configuration-PreReg and Configuration-Application are defined here. You need to run the config-server along with the files mentioned above.
- For generating clients, refer to MOSIP’s documentation here: Client Generation Guide
- To authenticate a client, use the Auth Manager API as described here: Auth API Documentation
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 URLmosip.kernel.prereg-application.url- PreReg Application service URLmosip.kernel.prereg-datasync.url- PreReg DataSync service URLmosip.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.propertiesorpre-registration-default.propertiesfile with your environment-specific values.
- 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 pre-registration
- 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 at:
http://localhost:8080/preregistration/v1/application-service/swagger-ui/index.html
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
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 pre-registration
mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
- Navigate to each service directory and build the Docker image:
cd pre-registration/<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 above.
To deploy Pre-Registration services on a Kubernetes cluster, refer to the Sandbox Deployment Guide.
For the complete Pre-Registration UI implementation and usage instructions, refer to the Pre-Registration UI GitHub repository.
For more detailed documents for repositories, you can check here.
API endpoints, base URL, and mock server details are available via Stoplight and Swagger documentation: MOSIP Pre-Registration Service API Documentation.
To learn more about Pre-Registration services from a functional perspective and use case scenarios, refer to our main documentation: Click here.
Automated functional tests are available in the Functional Tests repository.
• 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.