Skip to content

ug8yogesh/LabDesk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–₯️ LabDesk

Smart Lab Fault Management System

Node.js Express MySQL Render

A full-stack web application for managing computer lab faults β€” from report submission to technician assignment, resolution tracking, and feedback collection.

Live Demo Β· Report Bug Β· Request Feature


πŸ“– Overview

LabDesk is a web-based platform designed to simplify computer laboratory maintenance and fault management. Students can report hardware and software issues, technicians can manage assigned tasks, and administrators can monitor, assign, and analyze fault reports through a centralized dashboard.

The system improves communication between students, technicians, and administrators while reducing downtime in computer laboratories.


πŸ“Έ Screenshots

Login Page

Login

Student Dashboard

Student Dashboard

Admin Dashboard

Admin Dashboard

Technician Dashboard

Technician Dashboard


✨ Features

πŸ‘¨β€πŸŽ“ Student

  • Submit fault reports (hardware or software)
  • Track real-time status of submitted faults
  • Search the self-help solutions library before raising a ticket
  • Mark a fault as self-resolved
  • Receive in-app notifications on fault updates
  • Rate resolved faults with star feedback

πŸ”§ Technician

  • View assigned tasks dashboard
  • Accept, decline, or complete assigned tasks
  • Add problem and solution notes per ticket

πŸ›‘οΈ Admin

  • Full fault management with search & filter (status, type, keyword)
  • Assign faults to technicians with workload visibility
  • Analytics dashboard β€” 7-day fault trend chart + top faulty labs
  • Technician performance cards with completion rate %
  • Feedback analytics β€” star rating distribution
  • CSV export of all fault reports
  • Notify students directly from the panel
  • Manage the software solutions library (add/edit/delete)

βš™οΈ System

  • Secure session-based authentication (role-based: Admin / Technician / Student)
  • Login brute-force protection (15-min block after failed attempts)
  • Password reset via email (token-based)
  • Mobile responsive UI with hamburger menu
  • Toast notifications (no alert() dialogs)

πŸ› οΈ Tech Stack

Layer Technology
Backend Node.js, Express.js
Frontend HTML5, CSS3, Vanilla JavaScript
Database MySQL 8.0
Auth express-session, bcryptjs
Email Nodemailer (Gmail)
Deployment Render (backend), Railway (MySQL)

πŸ—„οΈ Database Schema

users                β†’ id, name, email, password, role, student_id,
                        reset_token, reset_token_expiry
fault_reports        β†’ id, student_id, lab_name, computer_number, fault_type,
                        description, status, assigned_technician_id,
                        resolution_notes, resolved_by_student,
                        created_at, updated_at
technician_tasks     β†’ id, fault_id, technician_id, assigned_by, status,
                        problem_description, solution_description,
                        assigned_at, updated_at
software_solutions   β†’ id, category, problem, solution, steps
notifications        β†’ id, user_id, message, type, is_read, created_at
feedback             β†’ id, fault_id, student_id, rating, comment, created_at

πŸš€ Local Setup

Prerequisites

  • Node.js 18+
  • MySQL 8.0
  • Gmail account (for email notifications)

1. Clone the repo

git clone https://github.com/ug8yogesh/LabDesk.git
cd LabDesk

2. Install dependencies

npm install

3. Set up the database

Open MySQL and run:

mysql -u root -p < databasesetup.sql

4. Configure environment

cp .env.example .env

Edit .env:

DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=lab_fault_system

PORT=3000
NODE_ENV=development
SESSION_SECRET=your_long_random_secret_here

EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_gmail_app_password

Gmail App Password: Google Account β†’ Security β†’ 2-Step Verification β†’ App Passwords β†’ Generate

5. Start the server

npm start

Open http://localhost:3000


🌐 Deployment (Render + Railway)

Step 1 β€” MySQL on Railway

  1. railway.app β†’ New Project β†’ MySQL
  2. Go to Query tab β†’ paste and run databasesetup.sql
  3. Copy connection credentials from Variables tab

Step 2 β€” Backend on Render

  1. render.com β†’ New β†’ Web Service
  2. Connect GitHub repo
  3. Set:
    • Build Command: npm install
    • Start Command: node server.js
  4. Add environment variables (DB credentials from Railway + session secret + Gmail)
  5. Deploy βœ…

πŸ”‘ Demo Accounts

Role Email Password
Admin admin@lab.com admin123
Student student@lab.com student123
Technician tech@lab.com tech123

⚠️ These are default seed accounts created automatically for testing and demonstration purposes.


πŸ“‘ API Reference

Method Endpoint Role Description
POST /api/auth/login All Login
POST /api/auth/register All Register
POST /api/auth/logout All Logout
GET /api/auth/me All Get current session user
POST /api/auth/forgot-password All Send reset email
POST /api/auth/reset-password All Reset password via token
GET /api/solutions All Self-help library
POST /api/faults Student Submit fault report
GET /api/faults/my Student View my reports
PATCH /api/faults/:id/self-resolved Student Mark fault as self-resolved
POST /api/feedback Student Submit feedback
GET /api/technician/tasks Technician View assigned tasks
PATCH /api/technician/tasks/:id Technician Update task status/notes
GET /api/admin/faults Admin All fault reports
GET /api/admin/technicians Admin Technician workload list
POST /api/admin/assign Admin Assign fault to technician
POST /api/admin/notify-student Admin Notify student of resolution
GET /api/admin/feedback Admin All feedback entries
GET /api/admin/stats Admin Dashboard analytics
GET /api/admin/export/faults Admin Download CSV
GET /api/admin/db/:table Admin Raw table viewer
GET/POST/PUT/DELETE /api/admin/solutions Admin Manage solutions library
GET /api/notifications All View notifications
PATCH /api/notifications/read All Mark notifications as read

πŸ“ Project Structure

LabDesk/
β”œβ”€β”€ server.js              # Express app + all API routes
β”œβ”€β”€ databasesetup.sql      # Full DB schema + seed data
β”œβ”€β”€ package.json
β”œβ”€β”€ .env.example
└── public/
    β”œβ”€β”€ index.html         # Redirect to frontend
    └── frontend/
        β”œβ”€β”€ index.html     # Main SPA
        β”œβ”€β”€ reset-password.html
        β”œβ”€β”€ css/
        β”‚   └── style.css
        └── js/
            └── main.js    # All frontend logic

πŸ”’ Security

  • Passwords hashed with bcryptjs
  • Brute-force login protection (15-min block)
  • Session cookie: httpOnly, sameSite: strict, HTTPS-only in production
  • Request body size limited (50KB)
  • Role-based route protection on all API endpoints
  • Environment variables for all secrets β€” no hardcoded credentials

🌍 Live Application

πŸ”— https://labdesk-93hf.onrender.com


πŸ“„ License

MIT License β€” free to use and modify.


πŸ‘¨β€πŸ’» Author

Yogesh U G


🌟 If you found this project useful, consider giving it a star on GitHub!

About

LabDesk - Smart Lab Fault Management System for reporting, tracking, and resolving computer lab faults.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors