A comprehensive web application designed to simplify fault reporting and resolution for IoT devices and LED signages. The platform connects End Clients, Users/Converters, Distributors, Employees, Admins, and Electricians to manage service requests efficiently with transparency and traceability.
- Multi-role User Management: Support for End Clients, Users/Converters, Distributors, Employees, Admins, and Electricians
- Service Request Management: Complete workflow from fault reporting to resolution
- Task Management: Streamlined task approval, assignment, and resolution processes
- Real-time Tracking: Status tracking and updates for all stakeholders
- Notifications System: In-app notifications and real-time updates
- Comprehensive Reporting: Analytics and reporting features for all user roles
- File Upload: Image upload support for fault documentation using Cloudinary
- Quality Control: Admin quality checks and client rating system
- Geographic Support: Location-based service requests and electrician assignment
- Email & SMS Integration: Automated notifications via Nodemailer and Twilio
- Frontend: React 18, Vite, TypeScript, Shadcn UI, Tailwind CSS, React Query, Zustand
- Backend: Node.js, Express.js, MongoDB with Mongoose, JWT Authentication
- Real-time: Socket.io for live updates and notifications
- File Storage: Cloudinary for image uploads and management
- Validation: Joi and Express Validator for request validation
- Email/SMS: Nodemailer and Twilio for notifications
- Security: Helmet, CORS, Rate limiting, Password hashing with bcrypt
- Development: Nodemon, ESLint, TypeScript, Concurrently
- Node.js (v18 or higher)
- MongoDB (v6 or higher)
- npm or yarn
Windows:
setup.batUnix/Linux/macOS:
chmod +x setup.sh
./setup.sh-
Clone the repository
git clone <repository-url> cd qwatt-service
-
Install dependencies
npm run install-all
-
Set up environment variables
- Copy
backend/env.exampletobackend/.env - Copy
frontend/env.exampletofrontend/.env - Fill in the required values (MongoDB URI, JWT secrets, Cloudinary credentials, etc.)
- Copy
-
Start MongoDB service
- Ensure MongoDB is running on your system
- Default connection:
mongodb://localhost:27017/qwatt-service
-
Start the development servers
npm run dev
This will start both the backend server (port 5000) and frontend development server (port 5173).
npm run dev- Start both backend and frontend in development modenpm run server- Start only the backend servernpm run client- Start only the frontend servernpm run build- Build frontend for productionnpm start- Start production servernpm run install-all- Install all dependencies
qwatt-service/
├── backend/ # Express.js backend
│ ├── middleware/ # Custom middleware (auth, validation)
│ ├── models/ # MongoDB models (User, ServiceRequest, Task, Notification)
│ ├── routes/ # API routes (auth, users, serviceRequests, tasks, etc.)
│ ├── utils/ # Utility functions (notifications)
│ ├── uploads/ # File upload directory
│ └── server.js # Server entry point
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── layout/ # Layout components (AuthLayout, DashboardLayout)
│ │ │ └── ui/ # Shadcn UI components
│ │ ├── pages/ # Page components
│ │ │ ├── admin/ # Admin dashboard pages
│ │ │ ├── auth/ # Authentication pages
│ │ │ ├── dashboard/ # User dashboard pages
│ │ │ └── electrician/# Electrician-specific pages
│ │ ├── services/ # API services
│ │ ├── store/ # State management (Zustand)
│ │ └── lib/ # Utility functions
│ └── public/ # Static assets
├── docs/ # Documentation (API.md, DEPLOYMENT.md)
├── setup.bat # Windows setup script
├── setup.sh # Unix/Linux setup script
└── package.json # Root package.json with scripts
Comprehensive API documentation is available in the docs/ directory:
- API.md - Complete API reference with all endpoints, request/response formats, and examples
- DEPLOYMENT.md - Deployment and production setup guide
- Base URL:
http://localhost:5000/api - Authentication: Bearer token in Authorization header
- Response Format: JSON with
status,message, anddatafields - Rate Limiting: Applied to prevent abuse
- WebSocket: Real-time updates via Socket.io
- Authentication:
/auth/*- Login, register, password reset - Service Requests:
/service-requests/*- Create, manage, and track service requests - Tasks:
/tasks/*- Task management and assignment - Users:
/users/*- User management and profiles - Notifications:
/notifications/*- Real-time notifications - Reports:
/reports/*- Analytics and reporting - Upload:
/upload/*- File upload and management
- Create service requests for IoT devices and LED signages
- Track request status and progress
- Rate completed services
- View service history and reports
- Manage multiple client accounts
- Create service requests on behalf of clients
- Access comprehensive reporting
- Coordinate with electricians
- Oversee regional operations
- Manage electrician assignments
- Access regional analytics
- Quality control and approval workflows
- Process service requests
- Coordinate between clients and electricians
- Generate reports and analytics
- Manage user accounts
- Full system access and control
- User management and role assignment
- System configuration and settings
- Advanced analytics and reporting
- Quality control oversight
- View assigned tasks
- Update task progress and status
- Upload work documentation
- Manage availability and schedule
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000/api
- Health Check: http://localhost:5000/api/health
- API Documentation: See
docs/API.md
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.