Skip to content

sanjaykumarkhadka/qwatt-services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qwatt Service - IoT Device and LED Signage Service Management Platform

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.

Features

  • 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

Tech Stack

  • 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

Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB (v6 or higher)
  • npm or yarn

Installation

Quick Setup (Recommended)

Windows:

setup.bat

Unix/Linux/macOS:

chmod +x setup.sh
./setup.sh

Manual Setup

  1. Clone the repository

    git clone <repository-url>
    cd qwatt-service
  2. Install dependencies

    npm run install-all
  3. Set up environment variables

    • Copy backend/env.example to backend/.env
    • Copy frontend/env.example to frontend/.env
    • Fill in the required values (MongoDB URI, JWT secrets, Cloudinary credentials, etc.)
  4. Start MongoDB service

    • Ensure MongoDB is running on your system
    • Default connection: mongodb://localhost:27017/qwatt-service
  5. Start the development servers

    npm run dev

This will start both the backend server (port 5000) and frontend development server (port 5173).

Available Scripts

  • npm run dev - Start both backend and frontend in development mode
  • npm run server - Start only the backend server
  • npm run client - Start only the frontend server
  • npm run build - Build frontend for production
  • npm start - Start production server
  • npm run install-all - Install all dependencies

Project Structure

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

API Documentation

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

Quick API Reference

  • Base URL: http://localhost:5000/api
  • Authentication: Bearer token in Authorization header
  • Response Format: JSON with status, message, and data fields
  • Rate Limiting: Applied to prevent abuse
  • WebSocket: Real-time updates via Socket.io

Key Endpoints

  • 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

User Roles & Capabilities

End Clients

  • Create service requests for IoT devices and LED signages
  • Track request status and progress
  • Rate completed services
  • View service history and reports

Users/Converters

  • Manage multiple client accounts
  • Create service requests on behalf of clients
  • Access comprehensive reporting
  • Coordinate with electricians

Distributors

  • Oversee regional operations
  • Manage electrician assignments
  • Access regional analytics
  • Quality control and approval workflows

Employees

  • Process service requests
  • Coordinate between clients and electricians
  • Generate reports and analytics
  • Manage user accounts

Admins

  • Full system access and control
  • User management and role assignment
  • System configuration and settings
  • Advanced analytics and reporting
  • Quality control oversight

Electricians

  • View assigned tasks
  • Update task progress and status
  • Upload work documentation
  • Manage availability and schedule

Development URLs

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors