Skip to content

Latest commit

Β 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CivicPulse πŸ“

CivicPulse is a citizen-driven, civic engagement platform that empowers communities to report and resolve local infrastructure issues. Built with modern technologies (MERN stack), it enables seamless communication between citizens and local government authorities.


🌟 Features

  • πŸ“Έ Photo Reports - Upload photos of issues to provide evidence and help authorities understand problems
  • πŸ—ΊοΈ Interactive Map - Visualize all reported issues on an interactive Leaflet map with filters
  • πŸ”” Status Tracking - Track issues from open β†’ in-progress β†’ resolved/rejected
  • πŸ‘ Upvote System - Community voting to prioritize issues by importance
  • ⚑ AI-Powered Descriptions - AI assistant to improve issue descriptions
  • πŸ’¬ Smart Chat Widget - Built-in AI support chatbot for user assistance
  • πŸ“Š Admin Dashboard - Comprehensive dashboard for administrators to manage and prioritize issues
  • πŸ” Role-Based Access - Separate experiences for citizens and administrators
  • πŸ“ Geolocation - Mark exact locations of issues and find nearby problems

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CivicPulse                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  β”‚   React Frontend β”‚        β”‚  Express Backend β”‚          β”‚
β”‚  β”‚   (Port 3000)    β”‚        β”‚  (Port 5000)     β”‚          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚         β”‚                            β”‚                      β”‚
β”‚         β”œβ”€ Redux Toolkit State ──┐   β”œβ”€ MongoDB (Issues)   β”‚
β”‚         β”œβ”€ React Router          β”‚   β”œβ”€ MongoDB (Users)    β”‚
β”‚         β”œβ”€ Framer Motion Anim    β”‚   β”œβ”€ JWT Auth          β”‚
β”‚         β”œβ”€ Leaflet Maps          β”‚   β”œβ”€ Cloudinary (Images)
β”‚         β”œβ”€ Tailwind CSS          β”‚   └─ Google Gemini API β”‚
β”‚         └─ Axios HTTP Client     └─ CORS Enabled β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

CivicPulse/
β”œβ”€β”€ client/                              # React Frontend (Port 3000)
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   └── axiosInstance.js        # Axios config with JWT interceptors
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx              # Navigation with user auth menu
β”‚   β”‚   β”‚   β”œβ”€β”€ IssueCard.jsx           # Reusable issue display component
β”‚   β”‚   β”‚   β”œβ”€β”€ IssuePopupCard.jsx      # Popup card for map markers
β”‚   β”‚   β”‚   β”œβ”€β”€ ProtectedRoute.jsx      # Auth guard for protected pages
β”‚   β”‚   β”‚   β”œβ”€β”€ StatusBadge.jsx         # Status indicator badge
β”‚   β”‚   β”‚   β”œβ”€β”€ AiChatWidget.jsx        # AI support chatbot
β”‚   β”‚   β”‚   └── AiDescriptionImprover.jsx # AI description enhancement
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx                # Landing/home page
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx               # User login
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx            # User registration
β”‚   β”‚   β”‚   β”œβ”€β”€ ReportIssue.jsx         # Issue reporting form
β”‚   β”‚   β”‚   β”œβ”€β”€ MapPage.jsx             # Interactive map view
β”‚   β”‚   β”‚   β”œβ”€β”€ IssueDetail.jsx         # Detailed issue view
β”‚   β”‚   β”‚   β”œβ”€β”€ MyIssues.jsx            # User's reported issues
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminDashboard.jsx      # Admin control panel
β”‚   β”‚   β”‚   └── AdminIssueDetail.jsx    # Admin issue details
β”‚   β”‚   β”œβ”€β”€ store/                      # Redux Toolkit State Management
β”‚   β”‚   β”‚   β”œβ”€β”€ store.js                # Redux store config
β”‚   β”‚   β”‚   β”œβ”€β”€ hooks.js                # useAppDispatch & useAppSelector
β”‚   β”‚   β”‚   β”œβ”€β”€ slices/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ authSlice.js        # Authentication state
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ issuesSlice.js      # Issues state & thunks
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ adminSlice.js       # Admin stats state
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ filterSlice.js      # Map filter state
β”‚   β”‚   β”‚   β”‚   └── uiSlice.js          # UI state
β”‚   β”‚   β”‚   └── useLogout.js            # Logout hook
β”‚   β”‚   β”œβ”€β”€ App.jsx                     # Main app component
β”‚   β”‚   β”œβ”€β”€ index.js                    # React DOM render
β”‚   β”‚   β”œβ”€β”€ index.css                   # Global styles
β”‚   β”‚   └── tailwind.config.js          # Tailwind CSS config
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env.local (configure REACT_APP_API_URL)
β”‚
└── server/                              # Express Backend (Port 5000)
    β”œβ”€β”€ controllers/
    β”‚   β”œβ”€β”€ authController.js           # Login/Register endpoints
    β”‚   β”œβ”€β”€ issueController.js          # Issue CRUD operations
    β”‚   └── adminController.js          # Admin operations + AI priority scoring
    β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ User.js                     # MongoDB User schema
    β”‚   └── Issue.js                    # MongoDB Issue schema
    β”œβ”€β”€ routes/
    β”‚   β”œβ”€β”€ auth.js                     # /api/auth routes
    β”‚   β”œβ”€β”€ issues.js                   # /api/issues routes
    β”‚   β”œβ”€β”€ admin.js                    # /api/admin routes
    β”‚   └── ai.js                       # /api/ai routes (Gemini chat + improve)
    β”œβ”€β”€ middleware/
    β”‚   β”œβ”€β”€ authMiddleware.js           # JWT verification
    β”‚   └── uploadMiddleware.js         # Multer image upload config
    β”œβ”€β”€ utils/
    β”‚   β”œβ”€β”€ cloudinary.js               # Cloudinary image upload
    β”‚   └── sendEmail.js                # Email notifications
    β”œβ”€β”€ server.js                       # Express server entry point
    β”œβ”€β”€ package.json
    └── .env (configure DB, API keys)

πŸ”„ Data Flow Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    User Action                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   React Component             β”‚
        β”‚   (e.g., ReportIssue.jsx)     β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Redux Slice Thunk           β”‚
        β”‚   (e.g., createIssue)         β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Axios Request with JWT      β”‚
        β”‚   (axiosInstance)             β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Express API Endpoint        β”‚
        β”‚   /api/issues (POST)          β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Auth Middleware             β”‚
        β”‚   (Verify JWT Token)          β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Controller                  β”‚
        β”‚   (issueController.js)        β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
                β”‚               β”‚
                β–Ό               β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  Cloudinary  β”‚  β”‚  MongoDB     β”‚
        β”‚  (Images)    β”‚  β”‚  (Data)      β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ” Authentication Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  User Registration/Login                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
                     β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   Frontend: /register or /login    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   POST /api/auth/register          β”‚
    β”‚   or /api/auth/login               β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   Backend: authController          β”‚
    β”‚   - Validate credentials           β”‚
    β”‚   - Hash password (bcryptjs)       β”‚
    β”‚   - Create JWT token               β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   Return: { token, user }          β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   Store in localStorage & Redux    β”‚
    β”‚   setAxiosStore() configures auth  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   All Future Requests Include JWT  β”‚
    β”‚   Header: Authorization: Bearer... β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Tech Stack

Frontend

  • React 18 - UI library with hooks
  • Redux Toolkit - State management
  • React Router v6 - Client-side routing
  • Tailwind CSS - Utility-first styling
  • Framer Motion - Smooth animations
  • Leaflet & React-Leaflet - Interactive maps
  • Axios - HTTP client with interceptors
  • React Dropzone - File upload handling

Backend

  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - ODM for MongoDB
  • JWT (jsonwebtoken) - Authentication
  • bcryptjs - Password hashing
  • Multer - File upload middleware
  • Cloudinary - Cloud image storage
  • CORS - Cross-origin requests
  • Google Generative AI (Gemini) - AI integration

Utilities

  • dotenv - Environment variables
  • React Dropzone - File drop zones
  • React Leaflet - Map integration

πŸ“Š Database Schema

User Collection

{
  _id: ObjectId,
  name: String,
  email: String (unique, lowercase),
  passwordHash: String,
  role: String ("citizen" | "admin"),
  createdAt: Date
}

Issue Collection

{
  _id: ObjectId,
  title: String,
  description: String,
  category: String ("Potholes" | "Streetlights" | "Garbage" | ...),
  status: String ("open" | "in-progress" | "resolved" | "rejected"),
  location: {
    type: "Point",
    coordinates: [longitude, latitude]
  },
  imageUrls: [String],
  reportedBy: ObjectId (ref: User),
  upvotes: [ObjectId] (ref: User),
  priorityScore: Number (0-10),
  priorityLevel: String ("Critical" | "High" | "Medium" | "Low"),
  priorityReason: String,
  priorityCalculatedAt: Date,
  createdAt: Date
}

πŸ”Œ API Endpoints

Authentication

POST   /api/auth/register      - Register new user
POST   /api/auth/login         - User login
GET    /api/auth/profile       - Get logged-in user profile

Issues (Public/User)

GET    /api/issues             - Get all issues (with filters)
GET    /api/issues/nearby      - Get issues near coordinates
GET    /api/issues/my          - Get user's reported issues
GET    /api/issues/:id         - Get issue details
POST   /api/issues             - Create new issue
DELETE /api/issues/:id         - Delete issue (by reporter)
PATCH  /api/issues/:id/upvote  - Upvote/downvote issue

Admin

GET    /api/admin/issues       - Get all issues (admin view)
GET    /api/admin/stats        - Get dashboard statistics
PATCH  /api/admin/issues/:id/status        - Update issue status
POST   /api/admin/calculate-priorities     - Calculate priority scores

AI Integration

POST   /api/ai/improve         - Improve issue description with AI
POST   /api/ai/chat            - Chat with AI support bot

πŸ› οΈ Installation & Setup

Prerequisites

  • Node.js (v14+)
  • MongoDB (local or Atlas)
  • Cloudinary account (for image uploads)
  • Google Gemini API key (for AI features)

Backend Setup

cd server
npm install

# Create .env file
cat > .env << EOF
MONGODB_URI=mongodb://localhost:27017/civicpulse
PORT=5000
JWT_SECRET=your_jwt_secret_key
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
GEMINI_API_KEY=your_gemini_api_key
FRONTEND_URL=http://localhost:3000
NODE_ENV=development
EOF

npm start

Frontend Setup

cd client
npm install

# Create .env.local file
echo "REACT_APP_API_URL=http://localhost:5000/api" > .env.local

npm start

Visit: http://localhost:3000


πŸ‘₯ User Roles

Citizen

  • Report issues with photos and location
  • View all issues on interactive map
  • Upvote issues to prioritize them
  • Track their reported issues
  • Filter issues by category and status
  • Use AI chatbot for support

Administrator

  • View all reported issues
  • Update issue status (open β†’ in-progress β†’ resolved/rejected)
  • Calculate priority scores based on upvotes and reports
  • View dashboard statistics
  • Manage and prioritize issues efficiently

πŸ”’ Security Features

  • JWT-based authentication with tokens stored in localStorage
  • Password hashing with bcryptjs (10-salt rounds)
  • Protected routes with ProtectedRoute component
  • Axios interceptors for automatic token injection
  • CORS configuration for cross-origin requests
  • CORS configured to allow only the trusted frontend origin
  • Environment variables for sensitive data
  • Role-based access control (citizen vs admin)

πŸ“± Responsive Design

  • Mobile-first approach with Tailwind CSS
  • Responsive breakpoints: sm (640px), md (768px), lg (1024px)
  • Mobile-optimized navigation with hamburger menu
  • Touch-friendly buttons and interactions
  • Optimized image loading and caching

🎨 UI/UX Features

  • Smooth animations with Framer Motion
  • Interactive Leaflet map with dynamic markers
  • Progress indicators and loading states
  • Form validation with error messages
  • Toast notifications for user feedback
  • Dark mode ready (color system in place)
  • Accessible components (aria-labels, keyboard navigation)

πŸ§ͺ Environment Variables

Frontend (.env.local)

REACT_APP_API_URL=http://localhost:5000/api

Backend (.env)

MONGODB_URI=mongodb://...
PORT=5000
JWT_SECRET=your_secret_key
CLOUDINARY_NAME=...
CLOUDINARY_API_KEY=...
CLOUDINARY_API_SECRET=...
GEMINI_API_KEY=...
FRONTEND_URL=http://localhost:3000
NODE_ENV=development

πŸ“¦ Dependencies Summary

Frontend (client/package.json)

  • react, react-dom
  • react-redux, @reduxjs/toolkit
  • react-router-dom
  • leaflet, react-leaflet
  • framer-motion
  • tailwindcss, postcss
  • axios
  • react-dropzone

Backend (server/package.json)

  • express
  • mongodb, mongoose
  • jsonwebtoken, bcryptjs
  • multer, cloudinary
  • cors
  • dotenv
  • @google/generative-ai (Gemini)
  • nodemailer (status-update emails)
  • express-validator

πŸš€ Deployment

Frontend (Vercel/Netlify)

npm run build
# Deploy the 'build' folder

Backend (Heroku/Railway)

git push heroku main

Update FRONTEND_URL in backend environment variables to your deployed frontend URL.


πŸ“ API Response Format

Success Response

{
  "success": true,
  "data": { ... },
  "message": "Operation successful"
}

Error Response

{
  "success": false,
  "error": "Error message",
  "status": 400
}

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

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


πŸ‘¨β€πŸ’» Project Info

CivicPulse connects citizens and local governments through technology, enabling communities to report and resolve infrastructure issues collaboratively.

Tech Stack: MERN (MongoDB, Express, React, Node.js) with Redux Toolkit, Leaflet Maps, Tailwind CSS, and Google Gemini AI Integration

Status: Production Ready βœ…


🎯 Future Enhancements

  • Real-time notifications via WebSockets
  • Advanced analytics dashboard
  • Multi-language support
  • Mobile app (React Native)
  • Payment integration for donations
  • Community badges and gamification
  • Social media sharing
  • Advanced search and filters

Built with ❀️ by Priyanshu for better cities and communities

About

An Ai-Powered community issue reporting platform. Built with modern technologies (MERN stack), it enables seamless communication between citizens and local government authorities.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages