Domain: Governance / Public Welfare
Tagline: Empowering citizens, enabling better governance.
Civix is a full-stack web application designed to streamline the process of reporting, tracking, and resolving local civic issues such as potholes, broken streetlights, and uncollected garbage. It provides a bridge between citizens and municipal authorities, bringing accountability and transparency to local issue resolution.
Caption: Citizen view showing issue reporting interface
Local civic issues often go unnoticed or unresolved due to:
- Lack of structured, user-friendly reporting systems
- No transparent status tracking
- Difficulty in community prioritization
Caption: Step-by-step issue reporting process
Civix now includes a fully frontend civic learning module to educate users—especially students and first-time voters—about their rights and responsibilities.
Route: /civic-education
File: src/Pages/CivicEducation.jsx
Civix now includes a standalone interactive simulator that allows users to step into civic leadership roles. Through animated dilemmas and slider-based decisions, users make trade-offs and explore the consequences of their choices—all within a frontend-only experience.
Route: /civic-simulator
File: src/Pages/CivicSimulator.jsx
localStorage persistence for decision history and XP trackingCivix/
├── .github/ # GitHub Actions workflows and issue/PR templates
├── backend/ # The entire Node.js/Express.js backend API
│ ├── config/ # Database (MongoDB), Swagger, and other configs
│ ├── controllers/ # Business logic for API routes (e.g., auth, issues)
│ ├── middlewares/ # Custom middleware (e.g., auth, error handling, file uploads)
│ ├── models/ # Mongoose schemas for the database (e.g., User, Issue)
│ ├── routes/ # API endpoint definitions (e.g., auth.js, profileRoutes.js)
│ ├── __tests__/ # Backend tests (Jest)
│ ├── utils/ # Utility functions (e.g., email, token, file upload)
│ ├── .env.example # Environment variable template for the backend
│ └── server.js # Main backend server entry point
│
├── cypress/ # End-to-end (E2E) tests
│
├── public/ # Static assets for the frontend
│ ├── gtfs/ # Static data files (CSV, JSON) for app features
│ ├── index.html # The main HTML template for the React app
│ └── *.png, *.svg # Public images, logos, and favicons
│
├── src/ # The main React frontend application source code
│ ├── Pages/ # All top-level page components (e.g., Home, About, ReportIssue)
│ ├── components/ # Reusable UI components (e.g., Navbar, Footer, Chatbot)
│ ├── assets/ # Images and logos imported into React components
│ ├── hooks/ # Custom React hooks (e.g., useProfileStatus)
│ ├── utils/ # Frontend utility functions
│ ├── App.jsx # Main React app component (routing)
│ └── index.jsx # React app entry point
│
├── .gitignore # Files and folders to be ignored by Git
├── LICENSE # Project's open-source license
├── README.md # This file
├── package.json # Frontend dependencies and scripts (React)
└── tailwind.config.js # Tailwind CSS configuration
/api-docsImplementation:
- darkMode: 'class' in tailwind.config.js
- User preference saved via localStorage
- Toggle switch: src/ThemeToggle.jsx (used in Home.jsx)
How to Use:
1. Locate the toggle button (🌙/☀️) in the header
2. Click to switch between:
- Light Mode: White/light gray backgrounds (bg-slate-50) with dark text (text-gray-900)
- Dark Mode: Dark gray backgrounds (dark:bg-gray-800) with light text (dark:text-gray-100)
Caption: Admin dashboard with issue management tools
# Register new user
curl -X POST http://localhost:5000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{"username":"john_doe","email":"john@example.com","password":"password123"}'
# Login user
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"john@example.com","password":"password123"}'
# Get all issues
curl -X GET http://localhost:5000/api/issues
curl -X POST http://localhost:5000/api/issues \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -F "title=Pothole on Main Street" \ -F "description=Large pothole causing traffic issues" \ -F "location=Main Street & 5th Ave" \ -F "category=road" \ -F "file=@/path/to/image.jpg"
curl -X PATCH http://localhost:5000/api/issues/1/status \ -H "Authorization: Bearer ADMIN_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"status":"in-progress"}'
http://localhost:5000/api-docsWe have a comprehensive testing suite to ensure code quality and stability.
These tests cover the API endpoints. They run against an in-memory MongoDB database to ensure a clean, isolated environment for each test run, preventing any impact on your development database.
To run all backend tests, navigate to the /backend directory and run:
npm test
These tests verify that individual React components render and behave correctly in isolation. We use Vitest and React Testing Library for this.
To run all frontend unit tests, navigate to the /frontend directory and run:
npm test
E2E tests simulate real user workflows in a browser from start to finish. This helps catch bugs in critical user journeys like logging in, creating a post, or navigating the application.
To open the Cypress Test Runner, navigate to the /frontend directory and run:
npm run cypress:open
📦 1.Clone the repository:
```bash
git clone https://github.com/Harshs16/civix.git
cd Civix
📦 2. **Install Dependencies**
Make sure you have **Node.js** and **npm** installed.
Then, install the project dependencies:
```bash
npm install
Use a meaningful branch name:
git checkout -b your-feature-name
Example:
git checkout -b improve-readme
🛠️ 4. Make Your Changes - Improve the code, fix bugs, or update docs. - If you're running the project: ```bash
npm start
```
✅ 5. Stage and Commit
git add .
git commit -m "feat: your clear and concise commit message"
🚀 6. Push Your Branch
git push origin your-feature-name
🔁 7. Create a Pull Request - Go to your forked repo on GitHub - Click “Compare & pull request” - Add a helpful description of what you changed and why
Pull requests are welcome! For major changes, please open an issue first to discuss your ideas.
MIT License. See LICENSE file for more details.
$ claude mcp add Civix \
-- python -m otcore.mcp_server <graph>