Developers Guide
Overview
The documentation here will guide you through the pre-requisites required for Pre-registration developer setup.
Software setup
Below are the list of tools required in Pre-registration
JDK 11
Any IDE (Eclipse, IntelliJ IDEA)
Apache Maven (zip folder)
pgAdmin
Postman
Git
lombok.jar (file)
MOSIP Pre-registration specific JARs: The version will depend on which Pre Registration branch you have cloned. If it is "release-1.2.0.1" then you can download 1.2.0.1.B1 or 1.2.0.1.B2 version of below jars whichever is available.
Notepad++ (optional)
Follow the steps below to setup Pre-registration on your local system
Fork the MOSIP Pre-registration repository from Github MOSIP repository to your GitHub account.
Clone the forked repository into your local machine.
git clone https://github.com/${urgithubaccname}/pre-registration.gitgit remote add upstream https://github.com/mosip/pre-registration.gitgit remote set-url --push upstream no_pushgit remote -vgit checkout -b my-release-1.2.0.1git fetch upstreamgit rebase upstream/release-1.2.0.1
Inside
settings.xmlchange local repository directory to your directory name where.m2 folderis located. E.g.:<localRepository>C:/Users/username/.m2/repository</localRepository>Add
settings.xmlinside.m2 folder(Maven Folder). E.g.:C:\Users\username\.m2Import the project in Eclipse IDE and it starts updating Maven projects configuration, refreshing workspaces, project starts building (downloading sources, javadoc).
Add downloaded
lombok.jarto project, click on downloaded JAR and install specifying Eclipse IDE(eclipse.exe) location.

Configure the JDK (Standard VM) with your Eclipse by traversing through
Preferences → Java → Installed JREs.

Add MOSIP Pre-registration specific JARs from Maven central:
Adding JARs to Build Path: Right click on service -> Build Path -> Configure Build Path -> click on Classpath -> Add External JARs -> Add required JARs -> Apply and close.

Add
auth-adapter,transliteration,ref-idobjectvalidator,virusscanner,lombokJARs topre-registration-application-service,pre-registration-datasync-serviceclasspath.Add
auth-adapter,lombokJARs topre-registration-core,pre-registration-batchjob,pre-registration-captcha-service,pre-registration-booking-serviceclasspath.Run
mvn clean install -Dgpg.skip=truecommand to build locally and to execute test cases.Update Maven dependencies: Maven syncs the Eclipse project settings with that of the pom. It downloads dependencies required for the project.
Build and run the Project.
To run the pre-registration-application-service locally without config server, update values in application.properties and bootstrap.properties:
spring.cloud.config.uri=https://localhost:8080spring.cloud.config.label=developspring.cloud.config.name=pre-registrationspring.application.name=pre-registration-application-servicespring.profiles.active=defaultPoint below urls to a valid env which has MOSIP setup:mosip.base.url=https://yourenvurlauth-token-generator.rest.issuerUrl:https://iam.yourenvurl/auth/realms/mosipjavax.persistence.jdbc.password: XXXXXXjavax.persistence.jdbc.url=jdbc:postgresql://yourenvurl:5432/mosip_preregmosip.batch.token.authmanager.password: XXXXXXmosip.iam.adapter.appid=preregmosip.iam.adapter.clientsecret=XXXXXXauth.server.admin.issuer.uri=https://iam.yourenvurl/auth/realms/
Developer setup for MOSIP Pre-registration UI
Fork the Pre-registration UI repo to your GitHub account.
Clone the forked repository into your local machine.
git clone https://github.com/${urgithubaccname}/pre-registration-ui.gitgit remote add upstream https://github.com/mosip/pre-registration-ui.gitgit remote set-url --push upstream no_pushgit remote -vgit checkout -b my-release-1.2.0.1git fetch upstreamgit rebase upstream/release-1.2.0.1
Install all dependencies with
npm install.Install Angular JS
npm install -g @angular/cli.Start the Angular JS server
ng serve.Open
http://localhost:4200to access the application.You will face CORS issue since API Services are hosted on
https://{env}.
Using the Angular CLI proxy solution to get around CORS issue
Update the API services
BASE_URLinconfig.json:config.jsonis found inside assets directory.E.g.:
C:\MOSIP\pre-registration-ui\pre-registration-ui\src\assets\config.json
{ "BASE_URL": "https://localhost:4200/proxyapi/", "PRE_REG_URL": "preregistration/v1/" }Create a new file named
proxy.conf.json:Location should be in
C:\MOSIP\pre-registration-ui\pre-registration-ui\proxy.conf.jsonproject folder.{ "/proxyapi": { "target": "https://{env}/", "secure": true, "changeOrigin": true, "pathRewrite": { "^/proxyapi": "" } } }Start the server by executing
ng serve --proxy-config proxy.conf.json --ssl true.Open the browser, load the app with
https://localhost:4200.
Pre-registration API
For API documentation, refer here.
The APIs can be tested with the help of Swagger-UI and Postman.
Swagger is an interface description language for describing restful APIs expressed using JSON. You can access Swagger-UI of pre-registration here:
Pre-registration Application service :
https://{env}/preregistration/v1/application-service/swagger-ui.htmlPre-registration Datasync Service :
https://{env}/preregistration/v1/sync/datasync-service/swagger-ui.htmlPre-registration Captcha service :
https://{env}/preregistration/v1/captcha/swagger-ui.htmlPre-registration Booking service :
https://{env}/preregistration/v1/appointment/booking-service/swagger-ui.html
Last updated
Was this helpful?