Backend Setup

Backend Setup

Getting Code for Backend

Visit the following github url and clone the code. Navigate to demo-donor-registry folder

git clone

Setting up a Registry Instance

Navigate into demo-donor-registry folder and run the following command

docker-compose up -d

This will start all the required services.

Setting up Keycloak

Once all the services are started, Go to the browser and open localhost:8080. This will open up the keycloak admin portal. Use username as admin and password as admin.

Once logged in, navigate to clients. Select admin-api. Go to the credentials tab and click on regenerate secret. Copy this secret. Create a .env file in the project repo and add KEYCLOAK_SECRET as a environment variable with the value of the secret in the following format


Again navigate to the keycloak homepage. Navigate to the Clients tab in the left subsection. Click on the Create button available on the right side of the screen. Enter client ID as donor-service. Client Protocol as openid-connect and click on save button.

This will create a new client named donor-service in keycloak. This will be used to communicate with the registry from the donor-service microservice.

Once the client is created, you will see the donor-service clients configurations. Change the access type to confidential and enable the toggle button for Service Accounts Enabled. Add appropriate redirect URL where you have hosted your UI

After the client configurations are saved, in the top tabs section you will see a credentials tab. Open that and copy the client secret present in that input box and add a environment variable in .env file as follows


Recreate registry so that it reflects the keycloak secrets. This can be done using

docker-compose up -d –force-recreate –no-deps registry donor-service

Keycloak Configurations :-

If you want to enable sending sms with OTP, you will need to add following configurations

Environment VariableDescription


Boolean which indicates whether actual message needs to be sent or dummy OTP of 1234 needs to be used


OTP Message template


Notification Service url


Donor registry UI Hosted URL


Message to be sent to user if he is using incorrect Username or username is Not registered


Message for user to enter valid otp


Message to be displayed to user for Abha number or mobile number not registered


Number of attempts user can enter his OTP


Message to be displayed to user after user fails to login in maximum number of login attempts


Number of attempts for user to get OTP


Url which redirects user to recover his Abha number

Restart keycloak after changing any of the above ENV

docker-compose up -d –force-recreate –no-deps keycloak

If any service has not started you can recreate that service with the same command

docker-compose up -d –force-recreate –no-deps <service_name>

Other Services

  1. Donor Service

You need to have access to sandbox environment of and you should have access to abdm APIs from this.

Sandbox environment will have the URL of

Following are the configurations needed for donor-service

Code -> Configs ->

Environment VariableDescription


API url to retrieve token to be used for abdm apis to create or access abha kyc information


Client ID for abha kyc apis


Client secret for abha kyc apis


Url to access redis


ABHA Kyc Api base url


Client secret for donor-service client id in keycloak


Url to access keycloak


Url to access Registry


To Store the transactionId of esign in redis with Expiry. EXPIRE_PROFILE is a integer with this expiry time


Esign Url


Url to fetch the signed document


Url which opens up for esign’ing the document


Number of digits which you want to use to create unique NOTTO-ID.


Boolean value if true, indicates you want to have one pledge per abha number


Notification url to be used to send out sms/emails


Login link to donor registry


Template ID for Sms to be sent out to donor when the donor has successfully pledged


Template ID for Sms to be sent out to the contact mentioned in the notification Details so that he knows the donor and who has successfully pledged


Template ID for Sms to be sent out to donor when the donor has successfully edited the pledged


Template ID for Sms to be sent out to donor when the donor has successfully unpledged


Log level like info which will only print that logs

  1. Certificate signer -> certificate-signer

    Code ->

    Configs ->

    Signing Keys

    You can place your signing keys in the document in the path

    demo-donor-registry/imports/config.json. Based on the issuer’s name, the key will be picked in order to create signed credentials. Sample for the keys is as follows for scholarship as a issuer

  2. Certificate PDF Service

    This service will take a template as a pdf and return a pdf with the actual certificate.

    Technical ->

    Code ->

  3. Notification Service ->

    Used to send notifications

    Technical ->

    Code -> Configs ->


Entity ID used to send out SMS


SMS API password


Source with which SMS will be sent


SMS API Username


SMS URL of provider

  1. Claims -> Claim Service

  2. Elastic Search -> Elastic Search

  3. MinIO -> File storage

  4. Verification Service

Verification of credential refers to verifying the authenticity of the credential that the actor possesses. When a credential is issued, it is signed via issuers private key. This can then be verified by an issuer's public key which is made available to whoever is trying to verify the credentials. This is taken care by certificate-signer service. Certificate signer service provides an API which takes signed Credentials as input. From the issuer name, it fetches the public key of the issuer. Using this public key, the verifier verifies the authenticity of the credential.

Refer to this API

Last updated