Sign inSign up

hemantmishra1978/civicplus-repo

By hemantmishra1978

Updated about 17 hours ago

Dockerized event-driven civic grievance platform: Spring Boot + Kafka + WebSockets + React 19.

Image
Developer tools
1

5.1K

hemantmishra1978/civicplus-repo repository overview

🚀 CivicPlus Microservices

Scalable Containerized Civic Grievance Management Platform

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.


🏗️ Platform Architecture

                           ┌──────────────────────┐
                           │     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 Repository

Docker Hub Repository

hemantmishra1978/civicplus-repo

All CivicPlus application components are published as individual Docker image tags within this repository.


🐳 Available Docker Images

ComponentImage TagPull Command
Frontendfrontenddocker pull hemantmishra1978/civicplus-repo:frontend
API Gatewayapi-gatewaydocker pull hemantmishra1978/civicplus-repo:api-gateway
Auth Serviceauth-servicedocker pull hemantmishra1978/civicplus-repo:auth-service
User Serviceuser-servicedocker pull hemantmishra1978/civicplus-repo:user-service
Complaint Servicecomplaint-servicedocker pull hemantmishra1978/civicplus-repo:complaint-service
Notification Servicenotification-servicedocker pull hemantmishra1978/civicplus-repo:notification-service
Analytics Serviceanalytics-servicedocker pull hemantmishra1978/civicplus-repo:analytics-service
Department Servicedepartment-servicedocker pull hemantmishra1978/civicplus-repo:department-service
Media Servicemedia-servicedocker pull hemantmishra1978/civicplus-repo:media-service
Config Serverconfig-serverdocker pull hemantmishra1978/civicplus-repo:config-server
Discovery Serverdiscovery-serverdocker pull hemantmishra1978/civicplus-repo:discovery-server

📥 Pull Images

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

⚡ Quick Start

Prerequisites

Install:

  • Docker
  • Docker Compose
  • Git

Verify your installation:

docker --version
docker compose version
git --version

1. Clone the Repository

git clone https://github.com/HemantMishra-lab/civicplus-microservices.git
cd civicplus-microservices

2. Configure Environment Variables

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.


🚀 3. Start CivicPlus

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

🔍 4. Verify Running Containers

docker compose ps

View all logs:

docker compose logs -f

View logs for a specific service:

docker compose logs -f complaint-service

🛑 Stop CivicPlus

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 -v may remove persistent application/database data stored in Docker volumes.


🧱 Infrastructure Components

CivicPlus depends on the following infrastructure services:

InfrastructurePurpose
MySQLRelational database and persistent application data
Apache KafkaAsynchronous event streaming and inter-service messaging
ZookeeperKafka coordination and cluster management
MinIOS3-compatible object and media storage

🗄️ MySQL Configuration

CivicPlus uses MySQL, not PostgreSQL.

Example configuration:

MYSQL_DATABASE=civicplus
MYSQL_USER=civicplus
MYSQL_PASSWORD=change-me
MYSQL_ROOT_PASSWORD=change-me
Variables
VariableDescription
MYSQL_DATABASEApplication database name
MYSQL_USERMySQL application username
MYSQL_PASSWORDMySQL application password
MYSQL_ROOT_PASSWORDMySQL root password

For containers communicating through Docker Compose, the database host should normally be the MySQL service name:

mysql

📨 Apache Kafka Configuration

Kafka provides asynchronous communication between CivicPlus microservices.

KAFKA_BOOTSTRAP_SERVERS=kafka:9092
VariableDescription
KAFKA_BOOTSTRAP_SERVERSKafka 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

Zookeeper provides coordination for the Kafka deployment.

ZOOKEEPER_CLIENT_PORT=2181
VariableDescription
ZOOKEEPER_CLIENT_PORTZookeeper client communication port

🗂️ MinIO

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
VariableDescription
MINIO_ROOT_USERMinIO administrator username
MINIO_ROOT_PASSWORDMinIO administrator password
MINIO_ENDPOINTMinIO API endpoint

Inside Docker Compose:

http://minio:9000

🔐 Environment Variables Summary

CategoryVariableExample
MySQLMYSQL_DATABASEcivicplus
MySQLMYSQL_USERcivicplus
MySQLMYSQL_PASSWORDchange-me
MySQLMYSQL_ROOT_PASSWORDchange-me
KafkaKAFKA_BOOTSTRAP_SERVERSkafka:9092
ZookeeperZOOKEEPER_CLIENT_PORT2181
MinIOMINIO_ROOT_USERminioadmin
MinIOMINIO_ROOT_PASSWORDchange-me
MinIOMINIO_ENDPOINThttp://minio:9000

Environment variables may vary depending on the deployment configuration. Always verify the project's docker-compose.yml and service configuration before deploying.


🔄 Startup Architecture

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

🔧 Microservices

ImageResponsibility
frontendReact-based CivicPlus web interface
api-gatewayCentralized API routing and gateway layer
auth-serviceAuthentication and user authorization
user-serviceCitizen and officer user management
complaint-serviceCivic grievance creation and lifecycle management
notification-serviceNotifications and real-time communication
analytics-serviceComplaint statistics and analytics
department-serviceDepartment and officer management
media-serviceMedia/file upload and storage integration
config-serverCentralized configuration management
discovery-serverEureka service discovery and registration

🔄 Event-Driven Architecture

CivicPlus uses Apache Kafka to support asynchronous communication.

                         ┌──────────────────┐
                         │ Complaint Service │
                         └────────┬─────────┘
                                  │
                                  │ Event
                                  ▼
                         ┌──────────────────┐
                         │  Kafka Broker     │
                         └────────┬─────────┘
                                  │
                         complaint-events
                                  │
                    ┌─────────────┴─────────────┐
                    ▼                           ▼
          ┌──────────────────┐       ┌──────────────────┐
          │ Notification     │       │ Analytics        │
          │ Service          │       │ Service          │
          └──────────────────┘       └──────────────────┘
Benefits
  • Loose coupling between services
  • Asynchronous processing
  • Independent consumers
  • Better scalability
  • Event-driven workflows
  • Reduced direct service dependencies

🌐 Real-Time Communication

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

🛡️ Security

CivicPlus supports a security architecture based on:

  • JWT authentication
  • Stateless authentication
  • Spring Security
  • Role-Based Access Control
  • Method-level authorization
  • API Gateway perimeter
  • Protected microservice endpoints

Never store credentials directly in Dockerfiles, GitHub repositories, or Docker Hub descriptions.

Use:

Environment Variables
       +
Docker Secrets
       +
GitHub Actions Secrets

for production deployments.


📊 Container Management Commands

List all containers
docker ps
List all CivicPlus containers
docker compose ps
View service logs
docker compose logs -f <service-name>

Example:

docker compose logs -f api-gateway
Restart a service
docker compose restart complaint-service
Rebuild one service
docker compose build complaint-service
Start one service
docker compose up -d complaint-service
Rebuild everything
docker compose up -d --build

🔗 Source Code

The complete CivicPlus source code is available on GitHub:

https://github.com/HemantMishra-lab/civicplus-microservices

https://github.com/HemantMishra-lab/civicplus-microservices

📦 Docker Hub Repository

hemantmishra1978/civicplus-repo
Published Components
frontend
api-gateway
auth-service
user-service
complaint-service
notification-service
analytics-service
department-service
media-service
config-server
discovery-server

🏆 Technology Stack

Java 21
Spring Boot
Spring Cloud
Microservices
Spring Security
JWT
Apache Kafka
Zookeeper
MySQL
MinIO
Redis
React
Vite
Docker
Docker Compose
Maven
GitHub Actions

🚀 CivicPlus

Containerized • Microservices • Event-Driven • Scalable

A production-oriented foundation for building and deploying a modern civic grievance management platform.

Tag summary

Content type

Image

Digest

sha256:a29600390

Size

26.8 MB

Last updated

about 17 hours ago

docker pull hemantmishra1978/civicplus-repo:frontend