Anēk (अनेक) is India's community-driven, reward-based platform for civic action. The philosophy is simple: one person ('Ek') taking initiative can inspire a wider community ('Anēk').
This platform empowers citizens to take charge of their neighborhoods, report local issues, collaborate with neighbors, and earn rewards (Good Citizen Points - GCP) for driving real change.
The project is structured as a decoupled Client-Server architecture:
├── frontend/ # Client-side SPA built with Vite
└── backend/ # REST API & Socket.IO server built with Node/Express
- Frontend: HTML5, Vanilla JavaScript (ES modules), Tailwind CSS, Leaflet.js (dynamic mapping), Vite.
- Backend: Node.js, Express, MongoDB (Mongoose schemas & geospatial query layer), Socket.IO (real-time notification broadcasts), Cloudinary (secure media cloud uploads), JWT (cookie-based session rotation).
- Dynamic Local Impact Map:
- Uses HTML5 Geolocation to automatically request and focus on user coordinates.
- Renders dynamic pins on a Leaflet map from the backend database, styled dynamically based on category and resolution status.
- Interactive Location Picker:
- Let users report problems by dropping a draggable map marker or clicking coordinates on a map to report issue sites.
- Supports media evidence uploads (compressed images and videos) sent to Cloudinary.
- Public Landing Feed:
- Landing page showcases the latest reports fetched dynamically from the database.
- Features a "Show More" / "See All" gated authentication redirect flow.
- Civic Rewards Ledger:
- Standard user registration starting at
0 GCP. - Real-time ledger records GCP gains/spends (reporting: +10 GCP, claiming/resolving: +50 GCP, redeeming: -GCP).
- Renders dynamic ranks (Vanguard Rank I/II/Elder) based on points thresholds.
- Standard user registration starting at
- Reusable Web Components (Micro-Frontend Architecture):
- Uses Custom HTML Elements (
<anek-header>,<anek-footer>) implemented in vanilla JS to globally manage Layouts, User Sessions, and Navigation across raw HTML files. No heavy JS framework required!
- Uses Custom HTML Elements (
- Optimistic UI Updates:
- Blazing fast user experience. Actions like Upvoting, Commenting, Mission Joining, and Reward Redemptions instantly update the DOM before the server responds.
- Background silent-syncing with automatic rollback ensures data integrity if a network error occurs.
- Persistent Theming & State Hydration:
- Dark mode preferences and user sessions are stored in
localStorageand hydrated instantly via an IIFE (Immediately Invoked Function Expression) to prevent FOUC (Flash of Unstyled Content) across page navigations.
- Dark mode preferences and user sessions are stored in
- Navigate to the backend directory:
cd backend - Install dependencies:
pnpm install
- Create a
.envfile in thebackend/folder based on.env.example:PORT=5000 NODE_ENV=development CLIENT_URL=http://localhost:5173 MONGO_URI=your_mongodb_connection_string JWT_ACCESS_SECRET=your_jwt_access_secret JWT_REFRESH_SECRET=your_jwt_refresh_secret CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
- Start the API server in development mode:
pnpm run dev
- Navigate to the frontend directory:
cd ../frontend - Install dependencies:
pnpm install
- Start the Vite client dev server:
pnpm run dev
- Open the local address in your browser (usually
http://localhost:5173).
Vercel is by far the easiest way since we've already set up the config for it.
Just follow the setup steps above! Make sure your .env files are pointing to local MongoDB and everything will run smoothly on localhost:5000 (backend) and localhost:5173 (frontend).
- Fork this repo first.
- Go to your Vercel dashboard and click Add New Project.
- Import your forked
Anekrepo. - Important: Before clicking the deploy button, copy everything from your
backend/.env.exampleinto Vercel's Environment Variables settings (put in your real MongoDB and Cloudinary keys!). - Click the Deploy button. Vercel will auto-detect our
vercel.jsonand deploy both the Vite frontend and the Node.js backend together effortlessly.
- XSS Protection: Secure HTML escaping on validation middleware schemas (
express-validator). - Session Guard: JWT tokens are signed securely. Refresh tokens rotate and expire on a 7-day TTL basis in MongoDB.
- Rate Limiting: Protects API endpoints against brute force attempts using custom rate limit windows.
- Error payload isolation: System error details are automatically hidden from client payloads in production mode.
Hope you liked it hehe