Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,45 @@ Civix now includes a standalone interactive simulator that allows users to step
- πŸ… **XP & Badges** – Earn experience points and unlock achievement badges locally
- πŸ’‘ **Frontend-Only Logic** – Built entirely in React with `localStorage` persistence for decision history and XP tracking

##πŸ“‚ Project Structure

```
Civix/
β”œβ”€β”€ .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
```

## πŸ› οΈ Tech Stack
### Frontend
- React.js
Expand Down Expand Up @@ -169,7 +208,7 @@ curl -X POST http://localhost:5000/api/auth/login \
```bash
# Get all issues
curl -X GET http://localhost:5000/api/issues

```
# Create new issue with image
curl -X POST http://localhost:5000/api/issues \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
Expand All @@ -184,7 +223,7 @@ 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"}'
```


### API Documentation
- **Swagger UI**: `http://localhost:5000/api-docs`
Expand Down Expand Up @@ -232,12 +271,13 @@ E2E tests simulate real user workflows in a browser from start to finish. This h
To open the Cypress Test Runner, navigate to the `/frontend` directory and run:
```sh
npm run cypress:open

```
### πŸ“₯ Installation
πŸ“¦ 1.**Clone the repository**:
```bash
git clone https://github.com/Harshs16/civix.git
cd Civix
```

πŸ“¦ 2. **Install Dependencies**

Expand Down