Caravan Stories
Grievance Tracker
The problem Caravan Stories solves
🏕️ Caravan Stories - HalfStack
A comprehensive ticket management system enabling citizens to report issues, employees to resolve them, and administrators to oversee operations.
📋 Table of Contents
- Overview
- Features
- Tech Stack
- Project Structure
- Getting Started
- Environment Variables
- Usage
- API Endpoints
- User Roles
- Contributing
- License
- Team
🌟 Overview
Caravan Stories is a full-stack web application designed to streamline the process of reporting, tracking, and resolving community issues.
The platform supports three distinct user roles with dedicated dashboards and functionalities.
✨ Features
👤 For Citizens
- 🎫 Create and track tickets/complaints
- 📊 View ticket status and timeline
- 🔍 Filter tickets by status (pending, in-progress, resolved)
- 📈 Dashboard with personal statistics
- 🔔 Real-time ticket updates
👷 For Employees
- 📋 View assigned tickets
- ✅ Update ticket status
- 📝 Add comments and updates
- 📊 Personal performance statistics
- 🎯 Quick action tools
🧑💼 For Administrators
- 👥 Employee management (create, view, edit)
- 🎫 Ticket oversight and assignment
- 📊 Comprehensive analytics and statistics
- 📈 Category-wise breakdown
- 🏢 Department-based filtering
- ✅ Role request approvals
⚙️ General Features
- 🔐 Secure authentication system
- ✉️ Email verification
- 🔑 Password recovery
- 👤 User profile management
- 📱 Responsive design
- 🖼️ File upload support for tickets
- 📧 Email notifications
🛠️ Tech Stack
Frontend
- Framework: React 19.1.1
- Build Tool: Vite 7.1.7
- Styling: Tailwind CSS 4.1.13
- Routing: React Router DOM 7.9.3
- HTTP Client: Axios 1.12.2
- Charts: React Chart.js 2
- UI Components: CoreUI React
- Notifications: React Toastify
Backend
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (via Mongoose)
- Authentication: JWT
- Email Service: Nodemailer
- File Upload: Multer
- Password Hashing: bcrypt
📁 Project Structure
├── client/ # Frontend React application
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ │ ├── admin/ # Admin-specific components
│ │ │ ├── citizen/ # Citizen-specific components
│ │ │ └── employee/ # Employee-specific components
│ │ ├── context/ # React Context for state management
│ │ ├── pages/ # Page components
│ │ │ ├── dashboards/ # Role-based dashboards
│ │ │ └── sections/ # Home page sections
│ │ └── assets/ # Images and static files
│ └── public/ # Public assets
│
└── server/ # Backend Node.js application
├── configs/ # Configuration files
├── controllers/ # Route controllers
├── middleware/ # Custom middleware
├── models/ # Database models
├── routes/ # API routes
└── uploads/ # Uploaded files storage
🚀 Getting Started
Prerequisites
- Node.js (v14 or higher)
- MongoDB (local or Atlas)
- npm or yarn package manager
Installation
-
Clone the repository
git clone https://github.com/NagarjunaVem/Caravan-Stories cd caravan-stories -
Install server dependencies
cd server npm install -
Install client dependencies
cd ../client npm install -
Set up environment variables
Create.envfiles in bothserverandclientdirectories (see Environment Variables). -
Start MongoDB
Ensure MongoDB is running locally or configure your Atlas connection string. -
Run the application
Server (from server directory):
npm start # or for development npm run devClient (from client directory):
npm run dev -
Access the application
- Frontend: http://localhost:5173
- Backend: http://localhost:5000
🔐 Environment Variables
Server (server/.env)
# Database
MONGODB_URI=mongodb://localhost:27017/caravan-stories
# or for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/caravan-stories
# Server
PORT=5000
NODE_ENV=development
# JWT
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRE=7d
# Email Configuration (Nodemailer)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
[email protected]
EMAIL_PASSWORD=your-app-password
[email protected]
# Frontend URL
CLIENT_URL=http://localhost:5173
# File Upload
MAX_FILE_SIZE=5242880
UPLOAD_PATH=./uploads
Challenges we ran into
Challenges We Faced
Deployment & Integration Issues
The biggest challenge was getting everything to work after deployment. On localhost, everything ran smoothly, but when we deployed the frontend to Vercel and backend to Render.com, things broke.
First, Users can't verify as GMail SMTP was being blocked by Render's servers, so password resets and account verifications failed. We fixed this by deploying our backend in Vercel.
Third, Dashboard statistics wouldn't fetch from DB in real-time. Searched a lot in ChatGPT and found a fix.
Fourth, 404 error on reloads fixed by addind vercel.json. Got this from ChatGPT.
Finally, we faced random authorization errors between Vercel and Render because environment variables weren't syncing properly and CORS wasn't configured correctly. After ensuring the JWT secret was identical on both platforms and fixing CORS settings, authentication worked smoothly.
Technologies used
