A comprehensive full-stack web application that enables citizens to report local civic issues and allows authorities to track and resolve them efficiently. Built with modern technologies and designed for scalability, transparency, and community engagement.
- Easy Issue Reporting: Upload photos, add descriptions, and automatically capture locations
- Smart Duplicate Prevention: AI-powered clustering prevents duplicate reports
- Community Validation: Upvote and validate issues reported by others
- Real-time Tracking: Monitor the status of reported issues
- Gamification: Earn points, badges, and climb leaderboards
- Mobile-Friendly: Responsive design works on all devices
- Comprehensive Dashboard: View all issues with advanced filtering
- Interactive Map: Visualize issues geographically with color-coded status
- Priority Management: Automatic priority calculation based on community input
- Status Updates: Move issues through workflow stages
- Analytics: Detailed insights and performance metrics
- Hotspot Detection: Identify areas with high issue density
- User Management: Manage citizen and authority accounts
- System Analytics: Comprehensive reporting and data export
- Badge Management: Award special recognition to active users
- Webhook Integration: Connect with third-party systems
- Performance Monitoring: Track system health and usage
- Modern UI: Clean, intuitive interface built with TailwindCSS
- Interactive Maps: Leaflet.js integration for geographic visualization
- Real-time Updates: Live status updates and notifications
- Progressive Web App: Offline capabilities and mobile optimization
- Accessibility: WCAG compliant design
- RESTful API: Well-documented endpoints with OpenAPI specification
- Smart Clustering: Geospatial and image-based duplicate detection
- Image Processing: Automatic compression and perceptual hashing
- Gamification Engine: Points, levels, badges, and leaderboards
- Background Jobs: Automated priority calculation and cleanup
- Security: Rate limiting, authentication, and input validation
- Geospatial Indexing: Efficient location-based queries
- Flexible Schema: Adaptable to changing requirements
- Aggregation Pipeline: Complex analytics and reporting
- Horizontal Scaling: Ready for high-volume deployments
- Node.js 18+ and npm
- MongoDB 7.0+
- Cloudinary account (for image storage)
- Git
-
Clone the repository
git clone <repository-url> cd civic-problem-solver
-
Set up the backend
cd server npm install cp .env.example .env # Edit .env with your configuration npm run dev
-
Set up the frontend
cd ../client npm install cp .env.example .env.local # Edit .env.local with your configuration npm run dev
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- API Documentation: http://localhost:5000/docs
For production deployment with Docker:
# Copy environment file
cp server/.env.example server/.env
cp client/.env.example client/.env.local
# Edit environment files with your configuration
# Then start all services
docker-compose up -dAccess the application at http://localhost:5173
- Navigate to the reporting form
- Fill in issue details:
- Title and description
- Category (waste, road, water, electricity, safety, other)
- Upload 1-5 photos
- Location is captured automatically (or manually adjust)
- Submit the report
The system will:
- Process and compress images
- Check for similar existing issues
- Calculate priority based on various factors
- Notify nearby users (if enabled)
- View the dashboard to see all issues
- Use filters to find specific issues:
- Status (reported, in-progress, resolved)
- Category
- Location radius
- Date range
- Click on map pins to see issue details
- Upvote or validate issues you've encountered
- Review reported issues on the dashboard
- Assign issues to team members
- Update status as work progresses:
- Mark as "In Progress" when work begins
- Add estimated resolution time
- Mark as "Resolved" when completed
- View analytics to track performance
- Report Issue: 10 points
- Validate Issue: 5 points
- Upvote Issue: 2 points
- Resolve Issue (authorities): 20 points
- First Report: 15 bonus points
- Area Report: 15 bonus points
- First Reporter: Report your first issue
- Community Helper: Validate 10 issues
- Civic Champion: Report 25 issues
- Problem Solver: Resolve 10 issues (authorities)
- Super Validator: Validate 50 issues
- Dedicated Reporter: Report 100 issues
- Community Leader: Reach 1000 points
- Global rankings by points
- Weekly and monthly competitions
- Category-specific leaderboards
- Authority performance rankings
# Server
PORT=5000
NODE_ENV=development
CLIENT_URL=http://localhost:5173
# Database
MONGODB_URI=mongodb://localhost:27017/civic-problem-solver
# Authentication
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRE=30d
# Image Storage
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
# Optional: Webhooks
WEBHOOK_URL=https://your-webhook-endpoint.com
WEBHOOK_SECRET=your-webhook-secretVITE_API_URL=http://localhost:5000/api
VITE_MAPBOX_TOKEN=your-mapbox-token
VITE_APP_NAME=Civic Problem SolverPOST /api/issues/report- Report new issueGET /api/issues- List issues with filteringGET /api/issues/:id- Get issue detailsPATCH /api/issues/:id/status- Update statusPOST /api/issues/:id/upvote- Upvote issuePOST /api/issues/:id/validate- Validate issue
POST /api/users/register- User registrationPOST /api/users/login- User loginGET /api/users/me- Current user profileGET /api/users/leaderboard- Gamification leaderboard
GET /api/analytics/dashboard- Dashboard metricsGET /api/analytics/hotspots- Issue hotspotsGET /api/analytics/export- Export data
const formData = new FormData();
formData.append('title', 'Pothole on Main Street');
formData.append('description', 'Large pothole causing issues');
formData.append('category', 'road');
formData.append('location[latitude]', '40.7128');
formData.append('location[longitude]', '-74.0060');
formData.append('images', imageFile);
fetch('/api/issues/report', {
method: 'POST',
body: formData,
headers: { 'Authorization': 'Bearer ' + token }
});const params = new URLSearchParams({
status: 'reported',
category: 'road',
lat: '40.7128',
lng: '-74.0060',
radius: '1000'
});
fetch(`/api/issues?${params}`);- Authentication: JWT-based with role-based access control
- Rate Limiting: Prevents spam and abuse
- Input Validation: Comprehensive request validation
- Image Security: File type and size validation
- CORS Protection: Configurable cross-origin policies
- Security Headers: Helmet.js integration
- Password Security: bcrypt hashing with salt
- Database Indexing: Optimized queries for geospatial data
- Image Compression: Automatic resizing and optimization
- Caching: Redis integration for session management
- CDN Integration: Cloudinary for image delivery
- Lazy Loading: Frontend component optimization
- Bundle Splitting: Optimized JavaScript delivery
cd server
npm test
npm run test:coveragecd client
npm test
npm run test:e2edocker-compose -f docker-compose.test.yml up --abort-on-container-exit-
Environment Configuration
- Set strong JWT secrets
- Configure production database
- Set up Cloudinary for image storage
- Configure email service (optional)
-
Security Setup
- Enable HTTPS with SSL certificates
- Configure firewall rules
- Set up monitoring and logging
- Enable backup procedures
-
Performance Optimization
- Configure CDN
- Set up database replication
- Enable caching layers
- Configure load balancing
# Production environment
docker-compose -f docker-compose.prod.yml up -d
# With SSL and custom domain
docker-compose -f docker-compose.prod.yml -f docker-compose.ssl.yml up -d- AWS: ECS, RDS, S3, CloudFront
- Google Cloud: Cloud Run, Cloud SQL, Cloud Storage
- Azure: Container Instances, Cosmos DB, Blob Storage
- DigitalOcean: App Platform, Managed Databases
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
- TypeScript: Strict mode enabled
- ESLint: Airbnb configuration
- Prettier: Code formatting
- Husky: Pre-commit hooks
- Conventional Commits: Commit message format
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the
/docsfolder - Issues: Create a GitHub issue
- Discussions: Use GitHub Discussions
- Email: support@civicproblem.com
- ✅ Core issue reporting and tracking
- ✅ Smart clustering and deduplication
- ✅ Gamification system
- ✅ Basic analytics dashboard
- 🔄 Real-time notifications
- 🔄 Mobile app (React Native)
- 🔄 Advanced analytics
- 🔄 Multi-language support
- 📋 AI-powered issue categorization
- 📋 Predictive maintenance
- 📋 Integration with city systems
- 📋 Citizen engagement tools
- OpenStreetMap: Map data
- Leaflet: Interactive maps
- Cloudinary: Image processing
- MongoDB: Database platform
- React: Frontend framework
- Node.js: Backend runtime
Built with ❤️ for better communities