E-Garage is a full-stack Garage Management System.
It provides:
-
Client Portal:
- Post repair jobs
- View job status & payment state
- Chat with staff in real time
-
Staff/Admin Dashboard:
- Manage jobs (status, payments, proforma invoices, photos)
- Send notification emails
- Team global chat
- Manage garage account info (logo, contact, etc.)
Backend (Node.js/Express/MongoDB):
- Express.js REST API
- MongoDB + Mongoose
- JWT authentication
- Multer for uploads (images, PDFs)
- Cloudinary for cloud file storage
- Nodemailer (Gmail App Password) for outbound emails
- Socket.IO for real-time chat
- PDFKit for job summary exports
Frontend (Next.js 14 + Tailwind):
- App Router (app directory)
- Role-based layouts:
- Public (landing)
- Client portal
- Staff/Admin dashboard
- TailwindCSS + custom components
- Axios for API calls
- Socket.IO client for chat
- react-hot-toast for notifications
- Lucide icons for UI
-
Client:
- Sign up / login
- Submit jobs with photos + proforma
- View their own jobs only
- Chat with staff on job pages
-
Staff:
- Login only (created by admin or seeded)
- Manage all jobs (update status, payment, etc.)
- Chat with clients & team (global chat)
- Send notification emails
-
Admin:
- All staff privileges
- Manage garage profile (logo, contact info, email)
- Create staff accounts
- Hero + About + Services + Contact
- Navbar with Login / Signup
- Signup β Role defaults to
client - Redirect to
/client - Can see:
Fix My Carβ create jobMy Jobsβ list own jobs- Job detail page with chat + PDF export
- Chat room per job:
client:{jobId}
- Login with staff/admin credentials
- Redirect to
/dashboard - Sidebar navigation:
- Dashboard β recent jobs
- Jobs β all jobs with filters
- Job detail β update status/payment + chat with client
- Emails β send / list sent emails
- Global chat (room =
global) - Account β update garage profile (logo, email, phone, address)
Base URL: http://localhost:5000
Auth: Bearer JWT in Authorization header
POST /auth/register
{
"email": "user@example.com",
"password": "secret123",
"role": "client" // optional, defaults to client. Can be "admin", "staff", "client"
}POST /auth/login
{
"email": "user@example.com",
"password": "secret123"
}Response:
{
"token": "jwt.token.here",
"role": "client",
"verified": true
}POST /clients (auth: client)
- Body:
multipart/form-datanamescarTypecarMakeplateNumberissuesphotos[](images)proforma(pdf/image)
- Client:
GET /clients?mine=true - Staff/Admin:
GET /clients
GET /clients/:id
PUT /clients/:id
PATCH /clients/:id/status
{ "status": "repairing", "payment": "paid" }DELETE /clients/:id
GET /clients/:id/pdf
- Connect:
io("http://localhost:5000") - Events:
chat:messageβ broadcast{ room, text, user, at }
GET /chat/:room/messages?limit=50
Rooms:
globalclient:{jobId}
GET /emails (auth: staff/admin)
POST /emails/send
{
"to": "client@example.com",
"subject": "Your car is ready",
"body": "Hello, your vehicle has been repaired."
}GET /account
PUT /account (auth: admin)
- Body:
multipart/form-datanameemailphoneaddresslogo(image)
GET /health
Response:
{ "ok": true }backend/
βββ config/
βββ controllers/
βββ middleware/
βββ models/
βββ routes/
βββ services/
βββ utils/
βββ server.js
βββ .env
frontend/
βββ app/
βββ components/
βββ lib/
βββ .env.local
cd backend
npm install
cp .env.example .env # fill in Mongo, Gmail, Cloudinary
npm run devcd frontend
npm install
cp .env.local.example .env.local # set NEXT_PUBLIC_API_URL=http://localhost:5000
npm run devPORT=5000
MONGO_URI=mongodb+srv://...
JWT_SECRET=dev_secret
GMAIL_USER=youremail@gmail.com
GMAIL_APP_PASS=xxxx xxxx xxxx xxxx
FROM_EMAIL=youremail@gmail.com
CORS_ORIGIN=http://localhost:3001
STORAGE_DRIVER=cloudinary
CLOUDINARY_CLOUD_NAME=xxx
CLOUDINARY_API_KEY=xxx
CLOUDINARY_API_SECRET=xxxNEXT_PUBLIC_API_URL=http://localhost:5000- Client job submission with uploads
- Job management for staff/admin
- Real-time chat (Socket.IO)
- Outbound email via Gmail
- PDF export of jobs
- Account/branding update
- Role management UI (admin creating staff)
- Email templates (HTML, logo)
- Reports (job stats, revenue)