A modern web platform that bridges the gap between citizens and government, enabling real-time reporting, tracking, and resolution of civic issues.
- Multi-role Authentication (Citizen, Policymaker, Admin)
- Proposal Management with AI-powered analysis
- Real-time Engagement (Voting, Comments, Feedback)
- Interactive Maps for geographic visualization
- Government Dashboard with analytics
- AI Integration for content summarization and sentiment analysis
- Real-time Notifications
- File Uploads & Attachments
- Responsive Design (Mobile & Desktop)
- React 18 with Vite
- Tailwind CSS for styling
- React Router for navigation
- Zustand for state management
- Axios for API calls
- React Hook Form for form handling
- Framer Motion for animations
- Leaflet for interactive maps
- Socket.io Client for real-time features
- Node.js with Express.js
- MongoDB with Mongoose ODM
- JWT for authentication
- bcryptjs for password hashing
- Socket.io for real-time communication
- OpenAI API for AI features
- AWS S3 for file storage
- Multer for file uploads
- Nodemailer for email notifications
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- Git
- AWS S3 bucket (for file uploads)
- OpenAI API key (for AI features)
git clone <repository-url>
cd Nextvoid-hackathoncd backend
npm installCreate a .env file in the backend directory:
# Database
MONGODB_URI=mongodb://localhost:27017/civicconnect
# Or use MongoDB Atlas: mongodb+srv://username:password@cluster.mongodb.net/civicconnect
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-here
JWT_EXPIRE=7d
# Server Configuration
PORT=5000
NODE_ENV=development
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:3000
# AWS S3 Configuration (for file uploads)
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=us-east-1
AWS_BUCKET_NAME=your-s3-bucket-name
# OpenAI Configuration (for AI features)
OPENAI_API_KEY=your-openai-api-key
# Email Configuration (for notifications)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100# Development mode
npm run dev
# Production mode
npm startcd frontend
npm installCreate a .env file in the frontend directory:
# API Configuration
VITE_API_URL=http://localhost:5000/api
VITE_SOCKET_URL=http://localhost:5000
# Map Configuration (optional)
VITE_MAPBOX_TOKEN=your-mapbox-token-if-using-mapbox
# App Configuration
VITE_APP_NAME=CivicConnect
VITE_APP_VERSION=1.0.0npm run dev# Start MongoDB service
sudo systemctl start mongod
# Or use Docker
docker run -d -p 27017:27017 --name mongodb mongo:latest- Create a free account at MongoDB Atlas
- Create a new cluster
- Get your connection string
- Update
MONGODB_URIin backend.envfile
cd backend
npm run create-admin admin@government.gov password123 "Admin" "User"cd backend
npm run seed-dummy- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Health Check: http://localhost:5000/api/health
- Register and login
- Create proposals
- Vote and comment
- View dashboard
- Provide feedback
- All citizen features
- Government dashboard
- Proposal status management
- Analytics access
- Government responses
- All features
- User management
- System administration
- Content moderation
- Full analytics
Nextvoid-hackathon/
βββ backend/
β βββ src/
β β βββ config/ # Database and app configuration
β β βββ controllers/ # Route controllers
β β βββ middleware/ # Custom middleware
β β βββ models/ # MongoDB models
β β βββ routes/ # API routes
β β βββ scripts/ # Utility scripts
β β βββ services/ # Business logic services
β β βββ utils/ # Helper utilities
β βββ .env # Backend environment variables
β βββ package.json
βββ frontend/
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ store/ # State management
β β βββ utils/ # Helper utilities
β βββ .env # Frontend environment variables
β βββ package.json
βββ README.md
npm start # Start production server
npm run dev # Start development server with nodemon
npm run create-admin # Create admin user
npm run seed-dummy # Seed dummy data
npm run migrate # Run database migrationsnpm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production buildAfter setup, you can use these credentials to explore:
- Email: admin@government.gov
- Password: password123
- Email: amangupta5132@gmail.com
- Password: (created during registration)
# Install Heroku CLI
heroku create your-app-name
# Set environment variables
heroku config:set MONGODB_URI=your-mongodb-uri
heroku config:set JWT_SECRET=your-jwt-secret
heroku config:set NODE_ENV=production
# Deploy
git push heroku main# Install Vercel CLI
npm i -g vercel
# Deploy
vercel --prod-
MongoDB Connection Error
- Ensure MongoDB is running
- Check connection string in
.env - Verify network access for cloud databases
-
CORS Errors
- Verify
FRONTEND_URLin backend.env - Check frontend
VITE_API_URLconfiguration
- Verify
-
Authentication Issues
- Verify
JWT_SECRETis set - Check token expiration settings
- Verify
-
File Upload Issues
- Verify AWS S3 credentials
- Check bucket permissions
- Ensure bucket name is unique
-
AI Features Not Working
- Verify OpenAI API key
- Check API quota and billing
- Use
npm run devfor hot reloading during development - Check browser console for frontend errors
- Check terminal for backend errors
- Use MongoDB Compass for database visualization
- Test API endpoints with Postman or similar tools
For support or questions:
- Email: amangupta5132@gmail.com
- Phone: +91 7525051783
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Built with β€οΈ for better civic engagement