A comprehensive digital platform designed to revolutionize civic engagement and municipal administration through three interconnected applications: Civic Worker Dashboard, Department Management System, and Social Media Platform.
- Overview
- System Architecture
- Applications
- Technology Stack
- Prerequisites
- Installation & Setup
- Configuration
- Usage
- Features
- API Documentation
- Contributing
- License
The Civic Management System is a modern, scalable solution that bridges the gap between citizens, civic workers, and municipal departments. It provides real-time task management, citizen engagement, performance tracking, and comprehensive reporting capabilities.
- Streamline Municipal Operations: Efficient task assignment and tracking
- Enhance Citizen Engagement: Direct communication and issue reporting
- Improve Transparency: Real-time updates and progress tracking
- Gamify Civic Work: Performance-based rewards and leaderboards
- Data-Driven Decisions: Comprehensive analytics and reporting
┌─────────────────────────────────────────────────────────────┐
│ Firebase Backend │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Firestore │ │ Auth │ │ Cloud Storage │ │
│ │ Database │ │ Service │ │ (Images/Files) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
│
┌─────────────────────┼─────────────────────┐
│ │ │
┌───────▼────────┐ ┌────────▼────────┐ ┌───────▼────────┐
│ Civic Worker │ │ Department │ │ Social Media │
│ Dashboard │ │ Management │ │ Platform │
│ (Next.js) │ │ (Next.js) │ │ (React+Vite) │
└────────────────┘ └─────────────────┘ └────────────────┘
Location: /civic-task-app
A mobile-first Progressive Web App designed for field workers to manage tasks, report progress, and engage with citizens.
- Task Management: View, accept, and complete assigned tasks
- Real-time Updates: Live task status and priority changes
- Citizen Interaction: Direct communication with issue reporters
- Performance Tracking: Personal metrics and achievement system
- Offline Capability: Work without internet connectivity
- Geolocation: GPS-based task verification and routing
- Field Workers: Complete tasks, update status, communicate
- Supervisors: Monitor team performance, assign tasks
- Citizens: Report issues, track progress, provide feedback
app/
├── dashboard/ # Main dashboard with metrics
├── task/[id]/ # Individual task management
├── profile/ # User profile and settings
├── achievements/ # Gamification and rewards
├── chat/ # Communication system
├── reports/ # Issue reporting
└── leaderboard/ # Performance rankings
Location: /civicdepartment
A comprehensive administrative dashboard for municipal departments to oversee operations, manage resources, and analyze performance.
- Multi-Department Support: Water, Sanitation, Roads, Electricity
- Task Assignment: Intelligent task distribution and prioritization
- Real-time Monitoring: Live dashboards with KPIs and metrics
- Resource Management: Equipment, personnel, and budget tracking
- Analytics & Reporting: Comprehensive data visualization
- Escalation Management: Automated issue escalation workflows
- User Management: Role-based access control
- Department Heads: Strategic oversight and decision making
- Supervisors: Operational management and team coordination
- Administrators: System configuration and user management
- Analysts: Data analysis and reporting
app/
├── monitoring/ # Real-time dashboard and KPIs
├── task-management/ # Task creation and assignment
├── analytics/ # Data visualization and insights
├── reports/ # Comprehensive reporting system
├── escalation/ # Issue escalation workflows
├── user-management/ # Personnel and role management
├── gamification/ # Performance incentives
└── admin/ # System administration
Location: /user
A citizen-centric social platform that enables community engagement, issue reporting, and civic participation through social features.
- Social Feed: Community posts and civic discussions
- Issue Reporting: Photo-based problem reporting with geolocation
- Progress Tracking: Real-time updates on reported issues
- Community Engagement: Comments, likes, and social interactions
- Gamification: Citizen participation rewards and badges
- Map Integration: Interactive city map with issue visualization
- Real-time Chat: Direct communication with authorities
- Citizens: Report issues, engage with community, track progress
- Community Leaders: Moderate discussions, highlight issues
- Civic Enthusiasts: Participate in civic activities and campaigns
src/
├── components/
│ ├── Home.jsx # Social feed and main interface
│ ├── Dashboard.jsx # Personal dashboard and metrics
│ ├── CreatePost.jsx # Issue reporting and content creation
│ ├── Profile.jsx # User profile and achievements
│ └── Championship.jsx # Gamification and leaderboards
├── Map/
│ └── Map.jsx # Interactive city map
├── Explore/
│ └── SearchPage.jsx # Content discovery and search
└── follow/
├── follow.jsx # Social connections
└── following.jsx # Following management
- Next.js 14: React framework with App Router (Worker & Department apps)
- React 19: Modern React with hooks and context (Social Media app)
- Vite: Fast build tool and development server
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first CSS framework
- Radix UI: Accessible component primitives
- Lucide React: Modern icon library
- Firebase: Complete backend-as-a-service
- Firestore: NoSQL document database
- Authentication: User management and security
- Cloud Storage: File and image storage
- Cloud Functions: Serverless backend logic
- Hosting: Web application deployment
- Leaflet: Interactive maps and geolocation
- React Leaflet: React integration for maps
- Google Maps API: Advanced mapping features
- OpenCage API: Geocoding and reverse geocoding
- Recharts: Data visualization and charts
- Lottie React: Smooth animations
- React Router: Client-side routing
- React Hook Form: Form management
- Sonner: Toast notifications
- ESLint: Code linting and quality
- PostCSS: CSS processing
- Autoprefixer: CSS vendor prefixes
- Vercel Analytics: Performance monitoring
Before setting up the project, ensure you have:
- Node.js (v18.0.0 or higher)
- npm or pnpm package manager
- Firebase Account with project setup
- Git for version control
- Modern Web Browser (Chrome, Firefox, Safari, Edge)
git clone <repository-url>
cd Demo_SIH_project-main
-
Create a Firebase project at Firebase Console
-
Enable the following services:
- Authentication (Email/Password, Google)
- Firestore Database
- Cloud Storage
- Hosting (optional)
-
Create a
.env.local
file in each app directory with your Firebase config:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
cd civic-task-app
npm install
# or
pnpm install
cd civicdepartment
npm install
# or
pnpm install
cd user
npm install
# or
pnpm install
Run the setup scripts to initialize Firestore with sample data:
# In civicdepartment directory
node lib/setup-users.js
node lib/store-departments.js
# In civic-task-app directory
node create-water-user.js
node add-water-dept.js
cd civic-task-app
npm run dev
# Runs on http://localhost:3000
cd civicdepartment
npm run dev
# Runs on http://localhost:3001
cd user
npm run dev
# Runs on http://localhost:5173
Update your Firestore security rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users can read/write their own data
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Tasks are readable by assigned workers and department members
match /tasks/{taskId} {
allow read: if request.auth != null;
allow write: if request.auth != null &&
(resource.data.assignedTo == request.auth.uid ||
request.auth.token.role in ['supervisor', 'admin']);
}
// Posts are publicly readable, writable by authenticated users
match /posts/{postId} {
allow read: if true;
allow write: if request.auth != null;
}
}
}
Configure Cloud Storage security:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read: if true;
allow write: if request.auth != null;
}
}
}
- Register/Login: Create account or sign in
- Report Issues: Use camera to capture and report problems
- Track Progress: Monitor status of reported issues
- Engage: Participate in community discussions
- Earn Rewards: Gain points and badges for civic participation
- Login: Access with worker credentials
- View Tasks: Check assigned tasks and priorities
- Update Status: Mark progress and completion
- Communicate: Chat with supervisors and citizens
- Track Performance: Monitor personal metrics and achievements
- Login: Access with department credentials
- Monitor Operations: View real-time dashboards
- Assign Tasks: Create and distribute work orders
- Analyze Data: Generate reports and insights
- Manage Resources: Oversee personnel and equipment
- Points & Badges: Reward system for all user types
- Leaderboards: Competitive rankings and achievements
- Challenges: Special civic engagement activities
- Progress Tracking: Visual progress indicators
- Real-time Dashboards: Live KPIs and metrics
- Performance Analytics: Individual and team statistics
- Trend Analysis: Historical data and patterns
- Custom Reports: Configurable reporting system
- Interactive Maps: City-wide issue visualization
- GPS Tracking: Location-based task verification
- Route Optimization: Efficient task scheduling
- Geofencing: Location-based notifications
- Real-time Chat: Instant messaging between users
- Push Notifications: Important updates and alerts
- Status Updates: Automated progress notifications
- Feedback System: Citizen satisfaction surveys
// Login
POST /auth/login
{
"email": "user@example.com",
"password": "password"
}
// Register
POST /auth/register
{
"email": "user@example.com",
"password": "password",
"role": "citizen|worker|supervisor|admin"
}
// Get tasks
GET /tasks?status=pending&assignedTo=userId
// Update task
PUT /tasks/:taskId
{
"status": "in_progress|completed",
"notes": "Progress update"
}
// Create task
POST /tasks
{
"title": "Fix streetlight",
"description": "Streetlight not working",
"priority": "high|medium|low",
"assignedTo": "workerId"
}
// Create post
POST /posts
{
"content": "Issue description",
"images": ["image1.jpg"],
"location": { "lat": 22.7196, "lng": 75.8577 }
}
// Get feed
GET /posts?limit=20&offset=0
We welcome contributions! Please follow these steps:
- Fork the Repository
- Create Feature Branch:
git checkout -b feature/amazing-feature
- Commit Changes:
git commit -m 'Add amazing feature'
- Push to Branch:
git push origin feature/amazing-feature
- Open Pull Request
- Follow existing code style and conventions
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Ensure all apps work together seamlessly
- Use TypeScript for type safety
- Follow React best practices
- Implement responsive design
- Optimize for performance
- Maintain accessibility standards
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Documentation: Check this README and inline code comments
- Issues: Create GitHub issues for bugs and feature requests
- Discussions: Use GitHub Discussions for general questions
- Email: Contact the development team
# Build all applications
cd civic-task-app && npm run build
cd ../civicdepartment && npm run build
cd ../user && npm run build
- Vercel (Recommended for Next.js apps)
- Firebase Hosting
- Netlify
- AWS Amplify
- Docker Containers
Ensure all production environment variables are properly configured:
- Firebase configuration
- API keys
- Database URLs
- Storage buckets
- Authentication domains
Built with ❤️ for Smart India Hackathon 2025
Empowering citizens, streamlining governance, building smarter cities.