Dockerized event-driven civic grievance platform: Spring Boot + Kafka + WebSockets + React 19.
5.1K
CivicPlus is a containerized, microservices-based Civic Grievance Management Platform designed to manage citizen complaints, department workflows, authentication, notifications, analytics, media, and real-time communication.
The platform uses Docker and Docker Compose to package and orchestrate independently deployable microservices along with the required infrastructure components.
┌──────────────────────┐
│ React Frontend │
│ :frontend │
└──────────┬───────────┘
│
│ HTTP / REST
▼
┌──────────────────────┐
│ API Gateway │
│ :api-gateway │
└──────────┬───────────┘
│
Service Discovery
│
┌───────────────────────────┼───────────────────────────┐
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌────────────────┐
│ Auth Service │ │ User Service │ │ Complaint │
│ │ │ │ │ Service │
└──────────────┘ └──────────────┘ └───────┬────────┘
│
│ Events
▼
┌─────────────┐
│ Kafka │
│ Broker │
└──────┬──────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ │
┌──────────────────┐ ┌──────────────────┐ │
│ Notification │ │ Analytics │ │
│ Service │ │ Service │ │
└──────────────────┘ └──────────────────┘ │
│
┌───────────────────────────────────────────────────────────┘
│
▼
┌──────────────┐
│ Zookeeper │
└──────────────┘
Supporting Microservices
┌─────────────────────────────────────────────────────────┐
│ Department Service │ Media Service │ Config Server │
│ Discovery Server / Eureka │
└─────────────────────────────────────────────────────────┘
Infrastructure
┌─────────────────────────────────────────────────────────┐
│ MySQL │ MinIO │
│ Persistent DB │ Object/File Storage │
└─────────────────────────────────────────────────────────┘
Docker Hub Repository
hemantmishra1978/civicplus-repo
All CivicPlus application components are published as individual Docker image tags within this repository.
| Component | Image Tag | Pull Command |
|---|---|---|
| Frontend | frontend | docker pull hemantmishra1978/civicplus-repo:frontend |
| API Gateway | api-gateway | docker pull hemantmishra1978/civicplus-repo:api-gateway |
| Auth Service | auth-service | docker pull hemantmishra1978/civicplus-repo:auth-service |
| User Service | user-service | docker pull hemantmishra1978/civicplus-repo:user-service |
| Complaint Service | complaint-service | docker pull hemantmishra1978/civicplus-repo:complaint-service |
| Notification Service | notification-service | docker pull hemantmishra1978/civicplus-repo:notification-service |
| Analytics Service | analytics-service | docker pull hemantmishra1978/civicplus-repo:analytics-service |
| Department Service | department-service | docker pull hemantmishra1978/civicplus-repo:department-service |
| Media Service | media-service | docker pull hemantmishra1978/civicplus-repo:media-service |
| Config Server | config-server | docker pull hemantmishra1978/civicplus-repo:config-server |
| Discovery Server | discovery-server | docker pull hemantmishra1978/civicplus-repo:discovery-server |
Pull an individual service:
docker pull hemantmishra1978/civicplus-repo:complaint-service
Pull the frontend:
docker pull hemantmishra1978/civicplus-repo:frontend
Pull the API Gateway:
docker pull hemantmishra1978/civicplus-repo:api-gateway
Pull the complete application image set:
docker pull hemantmishra1978/civicplus-repo:frontend
docker pull hemantmishra1978/civicplus-repo:api-gateway
docker pull hemantmishra1978/civicplus-repo:auth-service
docker pull hemantmishra1978/civicplus-repo:user-service
docker pull hemantmishra1978/civicplus-repo:complaint-service
docker pull hemantmishra1978/civicplus-repo:notification-service
docker pull hemantmishra1978/civicplus-repo:analytics-service
docker pull hemantmishra1978/civicplus-repo:department-service
docker pull hemantmishra1978/civicplus-repo:media-service
docker pull hemantmishra1978/civicplus-repo:config-server
docker pull hemantmishra1978/civicplus-repo:discovery-server
Install:
Verify your installation:
docker --version
docker compose version
git --version
git clone https://github.com/HemantMishra-lab/civicplus-microservices.git
cd civicplus-microservices
Create a .env file in the project root.
Example:
# ==========================================
# MySQL
# ==========================================
MYSQL_DATABASE=civicplus
MYSQL_USER=civicplus
MYSQL_PASSWORD=change-me
MYSQL_ROOT_PASSWORD=change-me
# ==========================================
# Kafka
# ==========================================
KAFKA_BOOTSTRAP_SERVERS=kafka:9092
# ==========================================
# Zookeeper
# ==========================================
ZOOKEEPER_CLIENT_PORT=2181
# ==========================================
# MinIO
# ==========================================
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=change-me
MINIO_ENDPOINT=http://minio:9000
Important: Replace example credentials before using CivicPlus in any production environment.
Start all containers in detached mode:
docker compose up -d
If your system uses the older Compose command:
docker-compose up -d
Build images before starting:
docker compose up -d --build
docker compose ps
View all logs:
docker compose logs -f
View logs for a specific service:
docker compose logs -f complaint-service
Stop containers:
docker compose stop
Stop and remove containers:
docker compose down
Stop and remove containers + volumes:
docker compose down -v
Warning:
docker compose down -vmay remove persistent application/database data stored in Docker volumes.
CivicPlus depends on the following infrastructure services:
| Infrastructure | Purpose |
|---|---|
| MySQL | Relational database and persistent application data |
| Apache Kafka | Asynchronous event streaming and inter-service messaging |
| Zookeeper | Kafka coordination and cluster management |
| MinIO | S3-compatible object and media storage |
CivicPlus uses MySQL, not PostgreSQL.
Example configuration:
MYSQL_DATABASE=civicplus
MYSQL_USER=civicplus
MYSQL_PASSWORD=change-me
MYSQL_ROOT_PASSWORD=change-me
| Variable | Description |
|---|---|
MYSQL_DATABASE | Application database name |
MYSQL_USER | MySQL application username |
MYSQL_PASSWORD | MySQL application password |
MYSQL_ROOT_PASSWORD | MySQL root password |
For containers communicating through Docker Compose, the database host should normally be the MySQL service name:
mysql
Kafka provides asynchronous communication between CivicPlus microservices.
KAFKA_BOOTSTRAP_SERVERS=kafka:9092
| Variable | Description |
|---|---|
KAFKA_BOOTSTRAP_SERVERS | Kafka broker address |
Inside the Docker Compose network:
kafka:9092
The primary application event flow can be represented as:
Complaint Service
│
│ Publish Event
▼
Apache Kafka
│
│ complaint-events
├──────────────────► Notification Service
│
└──────────────────► Analytics Service
This enables asynchronous processing and keeps downstream services loosely coupled from complaint processing.
Zookeeper provides coordination for the Kafka deployment.
ZOOKEEPER_CLIENT_PORT=2181
| Variable | Description |
|---|---|
ZOOKEEPER_CLIENT_PORT | Zookeeper client communication port |
MinIO provides S3-compatible object storage for CivicPlus media/file workloads.
Example:
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=change-me
MINIO_ENDPOINT=http://minio:9000
| Variable | Description |
|---|---|
MINIO_ROOT_USER | MinIO administrator username |
MINIO_ROOT_PASSWORD | MinIO administrator password |
MINIO_ENDPOINT | MinIO API endpoint |
Inside Docker Compose:
http://minio:9000
| Category | Variable | Example |
|---|---|---|
| MySQL | MYSQL_DATABASE | civicplus |
| MySQL | MYSQL_USER | civicplus |
| MySQL | MYSQL_PASSWORD | change-me |
| MySQL | MYSQL_ROOT_PASSWORD | change-me |
| Kafka | KAFKA_BOOTSTRAP_SERVERS | kafka:9092 |
| Zookeeper | ZOOKEEPER_CLIENT_PORT | 2181 |
| MinIO | MINIO_ROOT_USER | minioadmin |
| MinIO | MINIO_ROOT_PASSWORD | change-me |
| MinIO | MINIO_ENDPOINT | http://minio:9000 |
Environment variables may vary depending on the deployment configuration. Always verify the project's
docker-compose.ymland service configuration before deploying.
The recommended logical startup sequence is:
docker compose up -d
│
▼
Infrastructure Layer
│
┌────────────────┼────────────────┐
▼ ▼ ▼
MySQL Kafka MinIO
│
▼
Zookeeper
│
▼
Discovery Server
(Eureka)
│
▼
Config Server
│
▼
Backend Microservices
│
▼
API Gateway
│
▼
React Frontend
| Image | Responsibility |
|---|---|
frontend | React-based CivicPlus web interface |
api-gateway | Centralized API routing and gateway layer |
auth-service | Authentication and user authorization |
user-service | Citizen and officer user management |
complaint-service | Civic grievance creation and lifecycle management |
notification-service | Notifications and real-time communication |
analytics-service | Complaint statistics and analytics |
department-service | Department and officer management |
media-service | Media/file upload and storage integration |
config-server | Centralized configuration management |
discovery-server | Eureka service discovery and registration |
CivicPlus uses Apache Kafka to support asynchronous communication.
┌──────────────────┐
│ Complaint Service │
└────────┬─────────┘
│
│ Event
▼
┌──────────────────┐
│ Kafka Broker │
└────────┬─────────┘
│
complaint-events
│
┌─────────────┴─────────────┐
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ Notification │ │ Analytics │
│ Service │ │ Service │
└──────────────────┘ └──────────────────┘
The Notification Service supports real-time communication using:
WebSocket
+
STOMP
+
Kafka Events
Simplified flow:
Complaint Update
│
▼
Complaint Service
│
▼
Kafka Event
│
▼
Notification Service
│
▼
WebSocket / STOMP
│
▼
React Frontend
CivicPlus supports a security architecture based on:
Never store credentials directly in Dockerfiles, GitHub repositories, or Docker Hub descriptions.
Use:
Environment Variables
+
Docker Secrets
+
GitHub Actions Secrets
for production deployments.
docker ps
docker compose ps
docker compose logs -f <service-name>
Example:
docker compose logs -f api-gateway
docker compose restart complaint-service
docker compose build complaint-service
docker compose up -d complaint-service
docker compose up -d --build
The complete CivicPlus source code is available on GitHub:
https://github.com/HemantMishra-lab/civicplus-microservices
https://github.com/HemantMishra-lab/civicplus-microservices
hemantmishra1978/civicplus-repo
frontend
api-gateway
auth-service
user-service
complaint-service
notification-service
analytics-service
department-service
media-service
config-server
discovery-server
Java 21
Spring Boot
Spring Cloud
Microservices
Spring Security
JWT
Apache Kafka
Zookeeper
MySQL
MinIO
Redis
React
Vite
Docker
Docker Compose
Maven
GitHub Actions
Containerized • Microservices • Event-Driven • Scalable
A production-oriented foundation for building and deploying a modern civic grievance management platform.
Content type
Image
Digest
sha256:a29600390…
Size
26.8 MB
Last updated
about 17 hours ago
docker pull hemantmishra1978/civicplus-repo:frontend