Crime Reporting Portal
A full-stack MERN web application for secure crime reporting, case tracking, and role-based case management. CivilEye supports citizens filing complaints, investigators managing assignments, admins overseeing the workflow, and super admins managing admin credentials.
This repository contains two apps:
frontend/: React (Create React App) clientbackend/: Node.js + Express API with MongoDB (Mongoose)
- Register with OTP verification
- Set password and login
- File complaints with optional evidence uploads
- Track complaint status and timeline
- View complaint history
- Manage profile
- Unified login using email (first-time setup includes OTP verification + password creation)
- View assigned cases
- Open and resolve cases
- Add investigation notes and evidence
- Manage investigator profile
- View system dashboard and KPIs
- Manage complaints and assignment workflow
- Manage investigators (add, enable/disable)
- View case files and timelines
- Log in using environment-based super admin credentials
- Create and manage admin accounts
- Reset admin passwords
- Erase system data for a clean demo reset while keeping admin access intact
Frontend
- React 19
- React Router
- Axios
- Bootstrap / React-Bootstrap
Backend
- Node.js + Express
- MongoDB + Mongoose
- JWT authentication
- Multer for file uploads
- bcryptjs for password hashing
Crime-Report/
backend/
frontend/
Detailed backend module map:
backend/ARCHITECTURE.md
Frontend component grouping:
frontend/src/Components/publicfrontend/src/Components/authfrontend/src/Components/commonfrontend/src/Components/userfrontend/src/Components/adminfrontend/src/Components/investigatorfrontend/src/Components/superAdmin
Backend route/controller grouping:
backend/controllers/auth,backend/routes/authbackend/controllers/admin,backend/routes/adminbackend/controllers/investigator,backend/routes/investigatorbackend/controllers/user,backend/routes/userbackend/controllers/core,backend/routes/core
git clone <your-repo-url>
cd Crime-Report
cd backend
npm install
Create a .env file in backend/:
Copy backend/.env.example to backend/.env and fill in the values:
MONGO_URI=your_mongodb_connection_string
PORT=5000
JWT_SECRET=your_jwt_secret
ALLOWED_ORIGIN=http://localhost:3000
SUPER_ADMIN_EMAIL=superadmin@example.com
SUPER_ADMIN_PASSWORD=your_super_admin_password
SUPER_ADMIN_JWT_SECRET=your_super_admin_jwt_secret
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=your_smtp_user
SMTP_PASS=your_smtp_password
SMTP_FROM=no-reply@crimereport.com
SMTP_SECURE=false
Run the backend:
npm run dev
Create a .env file in frontend/:
Copy frontend/.env.example to frontend/.env and fill in the values:
REACT_APP_API_URL=http://localhost:5000
Then run:
cd ../frontend
npm install
npm start
The frontend runs at http://localhost:3000.
API requests use REACT_APP_API_URL from frontend/src/utils/api.js.
Backend (backend/.env):
MONGO_URI- MongoDB connection stringPORT- API portJWT_SECRET- JWT signing secretALLOWED_ORIGIN- allowed frontend origin for CORSSUPER_ADMIN_EMAIL- super admin login email (source of truth)SUPER_ADMIN_PASSWORD- super admin login password (source of truth)SUPER_ADMIN_JWT_SECRET- JWT signing secret for super admin tokensSMTP_HOST- SMTP host for OTP emailSMTP_PORT- SMTP port (587 or 465)SMTP_USER- SMTP usernameSMTP_PASS- SMTP passwordSMTP_FROM- From address for OTP emailsSMTP_SECURE- true/false for SMTPS
Frontend (frontend/.env):
REACT_APP_API_URL- backend base URL for API requests
Evidence files are stored locally in backend/uploads/. Accepted formats:
- JPEG
- PNG
- Base API path:
/api - Auth is handled via JWT tokens stored in
localStorage
npm run dev– start with nodemonnpm start– start with node
npm start– run dev servernpm run build– build for production
This project is licensed under the MIT License.