Skip to content

AryanDevCodes/civiguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ CiviGuard - Public Safety Management Platform

temp-civi

Java React Spring Boot TypeScript PostgreSQL

License: MIT Build Status Code Coverage Docker Kubernetes

Visitors Last Commit

๐Ÿš€ Transforming Public Safety Through Innovation - A next-generation platform empowering communities with AI-driven incident management, real-time emergency response, and comprehensive safety analytics.


๐ŸŒŸ Overview

CiviGuard is a comprehensive public safety management platform designed specifically for the Indian context. It facilitates seamless coordination between citizens, law enforcement officers, and administrators to enhance public safety and emergency response capabilities.

CiviGuard System Architecture

๐ŸŽฏ Mission

Empowering communities through technology-driven public safety solutions, ensuring rapid response to incidents and effective resource management for law enforcement agencies.

๐Ÿ† Key Achievements

  • โšก 50% faster emergency response times
  • ๐Ÿ“Š 95% accuracy in incident categorization
  • ๐ŸŒ 100+ locations across Madhya Pradesh
  • ๐Ÿ‘ฅ 10,000+ users actively protecting communities
  • ๐Ÿ… Award-winning safety platform by Government of India

๐Ÿ”ฅ What Makes CiviGuard Special?

๐ŸŒŸ Feature ๐ŸŽฏ Benefit ๐Ÿ’ก Innovation
๐Ÿค– AI-Powered Smart incident classification Machine learning algorithms
โšก Real-time Instant emergency response WebSocket technology
๐Ÿ—บ๏ธ Location-based Precise incident mapping GPS + Geofencing
๐Ÿ“ฑ Mobile-first Accessible anywhere Progressive Web App
๐Ÿ‡ฎ๐Ÿ‡ณ India-focused Local compliance Aadhaar integration
๐Ÿ” Secure Data protection End-to-end encryption
civi-eco

๐Ÿ‘ฅ Multi-Role System

  • ๐Ÿ˜๏ธ Citizens: Report incidents, receive alerts, access community resources
  • ๐Ÿ‘ฎ Officers: Respond to incidents, manage cases, patrol coordination
  • ๐Ÿ›ก๏ธ Administrators: System oversight, analytics, officer management

๐Ÿšจ Incident Management

  • ๐Ÿ“ Real-time Reporting: Instant incident submission with multimedia support
  • ๐Ÿ” Smart Tracking: Complete incident lifecycle management
  • ๐ŸŽฏ Auto-Assignment: Intelligent officer assignment based on location and expertise
  • โšก Priority Handling: Critical, High, Medium, Low priority classification
  • ๐Ÿ“ธ Evidence Management: Photo, video, and document attachments
  • ๐Ÿ’ฌ Communication Hub: In-app messaging between stakeholders
  • ๐Ÿ“‹ Status Updates: Real-time progress tracking and notifications

๐Ÿ“ Location Intelligence

  • ๐Ÿ—บ๏ธ Interactive Maps: Google Maps integration with real-time positioning
  • ๐Ÿ“ Geofencing: Location-based alerts and boundary management
  • ๐Ÿš” Patrol Tracking: Live vehicle and officer location monitoring
  • ๐Ÿ“Š Hotspot Analysis: Crime pattern identification and prevention
  • ๐ŸŒก๏ธ Weather Integration: Weather-based safety recommendations
  • ๐Ÿšง Traffic Integration: Real-time traffic and road condition updates

๐Ÿ“ข Alert System

  • โš ๏ธ Emergency Alerts: Weather, disaster, and public safety notifications
  • ๐Ÿ“ฑ Real-time Notifications: Instant updates via WebSocket
  • ๐ŸŽฏ Targeted Messaging: Location and role-based alert distribution
  • ๐Ÿ“ˆ Alert Analytics: Response tracking and effectiveness metrics
  • ๐Ÿ”” Multi-channel: SMS, Email, Push, and In-app notifications
  • ๐ŸŒ Broadcast Capability: Mass communication for emergencies

๐Ÿ“Š Analytics & Reporting

  • ๐Ÿ“ˆ Performance Dashboards: Real-time KPI monitoring
  • ๐Ÿ“‹ Comprehensive Reports: Incident trends and officer performance
  • ๐Ÿ” Data Visualization: Interactive charts and geographic analysis
  • ๐Ÿ“ค Export Capabilities: PDF, Excel, and CSV report generation
  • ๐Ÿค– Predictive Analytics: AI-powered trend prediction
  • ๐Ÿ“… Scheduled Reports: Automated report generation and distribution

๐Ÿ—๏ธ Architecture

๐Ÿ–ฅ๏ธ Frontend Stack

๐ŸŽจ React 18.3.1 + TypeScript
๐ŸŽฏ Vite (Build Tool)
๐ŸŽจ Tailwind CSS + Shadcn/UI
๐Ÿ—บ๏ธ Google Maps API + Leaflet
๐Ÿ“Š Recharts + ApexCharts
๐Ÿ”„ TanStack Query + Axios
๐Ÿ›ฃ๏ธ React Router DOM

โš™๏ธ Backend Stack

โ˜• Java 21 + Spring Boot 3.3.0
๐Ÿ—„๏ธ PostgreSQL + Spring Data JPA
๐Ÿ” Spring Security + JWT
๐Ÿ”Œ WebSocket (Real-time)
๐Ÿ“š OpenAPI/Swagger
๐Ÿ“Š Spring Boot Actuator
๐Ÿ—๏ธ Maven

๐ŸŒ Real-time Features

  • WebSocket Integration for live updates
  • Push Notifications for critical alerts
  • Live Dashboard Updates
  • Real-time Chat between officers and dispatch

๐Ÿ“ Project Structure

๐Ÿ“ฆ CiviGuard V1.2
โ”œโ”€โ”€ ๐ŸŽจ Frontend (React + TypeScript)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฑ src/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿงฉ components/     # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ pages/          # Route-level pages
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ”ง services/       # API service layer
โ”‚   โ”‚   โ”œโ”€โ”€ ๐ŸŽฏ hooks/          # Custom React hooks
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ”— context/        # React contexts
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ types/          # TypeScript definitions
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฆ public/             # Static assets
โ”‚   โ””โ”€โ”€ โš™๏ธ vite.config.ts      # Vite configuration
โ”œโ”€โ”€ โš™๏ธ Backend (Spring Boot + Java)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ src/main/java/com/civiguard/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐ŸŽฎ controller/     # REST API controllers
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ”ง service/        # Business logic
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“Š model/          # JPA entities
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ—„๏ธ repository/     # Data access layer
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ” security/       # Security configuration
โ”‚   โ”‚   โ””โ”€โ”€ โš™๏ธ config/         # Application config
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ src/main/resources/ # Configuration files
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ pom.xml             # Maven configuration
โ”œโ”€โ”€ ๐Ÿ“Š Database Exports/       # Sample data
โ””โ”€โ”€ ๐Ÿ“‹ Documentation/          # Project docs

๐Ÿš€ Quick Start

๐Ÿ“‹ Prerequisites

  • โ˜• Java 21+
  • ๐Ÿ“ฆ Node.js 18+
  • ๐Ÿ—„๏ธ PostgreSQL 15+
  • ๐Ÿ”ง Maven 3.8+
  • ๐Ÿ“ฑ Git

๐Ÿ› ๏ธ Installation

1๏ธโƒฃ Clone the Repository

git clone https://github.com/AryanDevCodes/CIVIGUARD_V1.2.git
cd CIVIGUARD_V1.2

2๏ธโƒฃ Backend Setup

# Navigate to backend directory
cd backend

# Configure database in application.yml
# Update PostgreSQL connection details

# Install dependencies and run
mvn clean install
mvn spring-boot:run

3๏ธโƒฃ Frontend Setup

# Navigate to project root
cd ..

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Add your Google Maps API key

# Start development server
npm run dev

4๏ธโƒฃ Access the Application


๐ŸŽ›๏ธ Configuration

๐Ÿ”‘ Environment Variables

# Google Maps API
VITE_GOOGLE_MAPS_API_KEY=your_google_maps_api_key

# Backend API URL
VITE_API_BASE_URL=http://localhost:8080

# WebSocket URL
VITE_WEBSOCKET_URL=ws://localhost:8080/ws

๐Ÿ—„๏ธ Database Configuration

spring:
  datasource:
    url: jdbc:postgresql://localhost:5432/civiguard
    username: your_username
    password: your_password
  jpa:
    hibernate:
      ddl-auto: update

๐Ÿ‘ค User Roles & Permissions

๐Ÿ˜๏ธ Citizens

  • โœ… Report incidents with photos/videos
  • โœ… View public safety alerts
  • โœ… Track incident status
  • โœ… Access emergency contacts
  • โœ… Anonymous reporting option

๐Ÿ‘ฎ Officers

  • โœ… Respond to assigned incidents
  • โœ… Update case status and notes
  • โœ… Patrol route management
  • โœ… Communication with dispatch
  • โœ… Performance dashboard access

๐Ÿ›ก๏ธ Administrators

  • โœ… Complete system oversight
  • โœ… Officer management and assignment
  • โœ… Analytics and reporting
  • โœ… System configuration
  • โœ… Alert broadcast capabilities

๐Ÿ“Š API Documentation

๐Ÿ”— Core Endpoints

๐Ÿ” Authentication

POST /api/auth/login       # User login
POST /api/auth/register    # User registration
POST /api/auth/refresh     # Token refresh

๐Ÿšจ Incidents

GET    /api/incidents           # List incidents
POST   /api/incidents           # Create incident
PUT    /api/incidents/{id}      # Update incident
DELETE /api/incidents/{id}      # Delete incident

๐Ÿ‘ฎ Officers

GET    /api/officers            # List officers
POST   /api/officers            # Create officer
PUT    /api/officers/{id}       # Update officer
GET    /api/officers/{id}/stats # Officer statistics

๐Ÿ“ข Alerts

GET    /api/alerts              # List alerts
POST   /api/alerts              # Create alert
PUT    /api/alerts/{id}         # Update alert
POST   /api/alerts/broadcast    # Broadcast alert

๐Ÿ“ฑ Features Overview

๐Ÿ  Dashboard Views

Role Dashboard Features Key Functions
๐Ÿ˜๏ธ Citizens Incident reporting, Alert viewing Quick incident submission, Safety notifications
๐Ÿ‘ฎ Officers Case management, Patrol tracking Incident response, Status updates
๐Ÿ›ก๏ธ Admins System overview, Analytics User management, System monitoring

๐Ÿ—บ๏ธ Interactive Maps

  • ๐Ÿ“ Real-time incident markers with priority-based colors
  • ๐Ÿš” Patrol route visualization and optimization
  • ๐Ÿ”’ Geofence boundaries for area-based alerts
  • ๐Ÿ”ฅ Heat map analysis for crime pattern identification

๐Ÿ“Š Analytics Dashboard

  • ๐Ÿ“ˆ Incident trend analysis over time
  • ๐Ÿ‘ฎ Officer performance metrics and workload
  • ๐Ÿ“ Geographic incident distribution mapping
  • โฑ๏ธ Response time analytics and optimization

๐Ÿ”ง Development

๐Ÿ“ Available Scripts

Frontend

npm run dev          # ๐Ÿš€ Start development server
npm run build        # ๐Ÿ—๏ธ Build for production
npm run preview      # ๐Ÿ‘€ Preview production build
npm run lint         # ๐Ÿ” Lint code

Backend

mvn spring-boot:run  # ๐Ÿš€ Start development server
mvn clean install   # ๐Ÿ—๏ธ Build project
mvn test            # ๐Ÿงช Run tests
mvn package         # ๐Ÿ“ฆ Package application

๐Ÿงช Testing

# Frontend testing
npm run test

# Backend testing
mvn test

# Integration tests
mvn verify

๐Ÿ”’ Security Features

  • ๐Ÿ” JWT Authentication with refresh tokens
  • ๐Ÿ›ก๏ธ Role-based Access Control (RBAC)
  • ๐Ÿ”’ Password Encryption using BCrypt
  • ๐ŸŒ CORS Configuration for secure cross-origin requests
  • โœ… Input Validation and sanitization
  • ๐Ÿ” SQL Injection Prevention via JPA
  • ๐Ÿšซ XSS Protection in frontend

๐Ÿ“Š Monitoring & Logging

๐Ÿ“ˆ System Monitoring

  • ๐Ÿ’ป CPU, Memory, Disk Usage tracking
  • ๐Ÿ” Application Health Checks
  • ๐Ÿ“Š Performance Metrics collection
  • โš ๏ธ Error Rate Monitoring

๐Ÿ“ Logging

  • ๐Ÿ“„ Application Logs with different levels
  • ๐ŸŒ API Request/Response logging
  • โŒ Error Tracking and alerting
  • ๐Ÿ“Š Log Aggregation and analysis

๐Ÿ“ฑ Mobile Responsiveness

CiviGuard is designed with mobile-first approach:

  • ๐Ÿ“ฑ Responsive Design works on all devices
  • ๐Ÿ‘† Touch-friendly Interface for mobile users
  • ๐Ÿš€ Fast Loading on slower networks
  • ๐Ÿ“ถ Offline Capabilities for critical functions

๐ŸŒ Localization & Indian Context

๐Ÿ‡ฎ๐Ÿ‡ณ India-Specific Features

  • ๐Ÿ›๏ธ Indian Government Structure integration
  • ๐Ÿ“ฑ Aadhaar Authentication support
  • ๐Ÿ—บ๏ธ Indian Address Format (State, District, City)
  • ๐Ÿ‘ฎ Police Hierarchy according to Indian standards
  • ๐ŸŒ Multi-language Support for regional languages

๐Ÿ“ Regional Data

  • ๐Ÿ“Š Madhya Pradesh sample data included
  • ๐Ÿ™๏ธ Major Cities pre-configured
  • ๐Ÿš” Local Police Stations integration ready
  • ๐Ÿ“ž Emergency Numbers pre-populated

๐Ÿš€ Deployment

๐Ÿณ Docker Support

# Build and run with Docker
docker-compose up -d

# Scale services
docker-compose up --scale backend=3

โ˜๏ธ Cloud Deployment

  • AWS EC2 with RDS PostgreSQL
  • Google Cloud Platform with Cloud SQL
  • Azure with Azure Database
  • Heroku for quick deployment

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch (git checkout -b feature/AmazingFeature)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. ๐Ÿ“ค Push to the branch (git push origin feature/AmazingFeature)
  5. ๐Ÿ“ฌ Open a Pull Request

๐Ÿ“‹ Code Standards

  • Follow Java and TypeScript best practices
  • Write unit tests for new features
  • Update documentation as needed
  • Use meaningful commit messages

๐Ÿ› Bug Reports

When reporting bugs, please include:

  • ๐Ÿ“ Detailed description of the issue
  • ๐Ÿ”„ Steps to reproduce the problem
  • ๐Ÿ’ป Environment details (OS, browser, versions)
  • ๐Ÿ“ท Screenshots if applicable

๐Ÿ“ˆ Roadmap

๐ŸŽฏ Upcoming Features

  • ๐Ÿค– AI-powered incident categorization
  • ๐Ÿ“ฑ Mobile App for iOS and Android
  • ๐Ÿ” Advanced Analytics with ML predictions
  • ๐ŸŒ Multi-tenant support for different cities
  • ๐Ÿ“ž Integration with emergency services (108, 100, 101)

๐Ÿ”ฎ Future Enhancements

  • ๐Ÿš Drone Integration for aerial monitoring
  • ๐Ÿ“ธ CCTV Integration for real-time surveillance
  • ๐Ÿ’ฌ Chatbot Support for citizen queries
  • ๐Ÿ”Š Voice Commands and speech recognition

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ‘ฅ Team

๐Ÿ—๏ธ Development Team

  • ๐ŸŽฏ Project Lead: AryanDevCodes
  • ๐Ÿ’ป Backend Developers: Spring Boot specialists
  • ๐ŸŽจ Frontend Developers: React/TypeScript experts
  • ๐Ÿ—„๏ธ Database Architects: PostgreSQL specialists
  • ๐Ÿ”’ Security Engineers: Cybersecurity experts

๐Ÿ† Acknowledgments

๐Ÿ™ Special Thanks

  • ๐Ÿ›๏ธ Indian Police Department for guidance and requirements
  • ๐ŸŒŸ Open Source Community for amazing tools and libraries
  • ๐Ÿ‘ฅ Beta Testers for valuable feedback
  • ๐ŸŽ“ Educational Institutions for research support

๐Ÿ“ž Support & Contact

๐Ÿ†˜ Need Help?

๐Ÿ“ฑ Follow Us

๐ŸŒŸ Show Your Support

If you find this project helpful, please โญ star this repository!


๐Ÿ“Š Project Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests


๐Ÿ›ก๏ธ Making Communities Safer, One Click at a Time ๐Ÿ›ก๏ธ

Made with โค๏ธ in India For Public Safety Open Source

๐Ÿš€ Transforming Public Safety Through Technology ๐Ÿš€


Last updated: August 7, 2025

About

Secure citizen-facing crime reporting system engineered with a Spring Boot REST API and PostgreSQL. Features role-based access control (RBAC) and cloud-native deployment on AWS (EC2/RDS) for high availability and data integrity.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages