Local Setup CCRS Service

Overview

This guide provides step-by-step instructions to set up the pgr-services module on your local system. It follows the official LOCALSETUP.md from the egovernments/URBAN repository.


Steps

1

Clone the Core Service Repository

Clone the municipal-services repository (which contains pgr-services):

git clone [email protected]:egovernments/URBAN.git

Go to the root directory of ccrs-services using the command below:

cd public-grievance-redressal/pgr-services
2

Install Required Dependencies

Ensure the following services/tools are available on your local system:

  • PostgreSQL (Database)

  • Kafka (Producer & Consumer)

3

Start or Access Dependent Services

The pgr-services module depends on several other DIGIT services.

If the dependent services are deployed in a Kubernetes cluster, you can use kubectl port-forward to access them locally:

kubectl port-forward -n egov {egov-idgen} 8087:8080
kubectl port-forward -n egov {egov-mdms} 8088:8080
kubectl port-forward -n egov {egov-user} 8089:8080
kubectl port-forward -n egov {egov-workflow-v2} 8090:8080
kubectl port-forward -n egov {egov-localisation} 8091:8080
kubectl port-forward -n egov {egov-url-shortner} 8092:8080
kubectl port-forward -n egov {egov-hrms} 8093:8080

Note: Replace {egov-<service>} with the actual pod name in your cluster for each service.

This is the most preferred way to run services locally without deploying all DIGIT services yourself.

Option 2: Run All Dependent Services Locally

If you don’t have access to a DIGIT environment, you can clone and run each dependent service locally. You will need to:

  • Pull the repositories

  • Configure local PostgreSQL and Kafka

  • Set the correct ports and DB connections in each service’s application.properties

  • Start each service

4

Configure application.properties

Edit your local application.properties or application-local.properties file with the appropriate values:

spring.datasource.url=jdbc:postgresql://localhost:5432/{your_local_db_name}
spring.flyway.url=jdbc:postgresql://localhost:5432/{your_local_db_name}
egov.mdms.host=http://localhost:8088
egov.user.host=http://localhost:8089
egov.idgen.host=http://localhost:8087
egov.localization.host=http://localhost:8091
egov.hrms.host=http://localhost:8093
egov.url.shortner.host=http://localhost:8092
egov.workflow.host=http://localhost:8090

👉 Replace {your_local_db_name} with your actual PostgreSQL database name and ensure the credentials are correctly set.

5

Prepare the PostgreSQL Database

  • Create the PostgreSQL database and user (if not already done).

  • On service startup, Flyway will apply migrations.

  • Ensure the database is accessible and the credentials are correct.

6

Build and run ccrs-services

Build and start the service using Maven:

mvn clean install
java -jar target/*.jar --spring.profiles.active=local
7

Verify the Setup

  • The service should connect to your local PostgreSQL instance.

  • It should also be able to reach all dependent services via port-forwarded URLs.

  • Check application logs to confirm successful startup.

Notes

  • All key configurations are controlled through the application.properties file.

  • If you're using local PostgreSQL and running services locally, ensure your Kafka, Postgres, and all ports are correctly mapped.

  • You may need to run egov-persister locally or ensure it’s port-forwarded to persist data.

Last updated

Was this helpful?