This document outlines the architecture, database schema, API structure, and UI flow for the Service Management System.
For the formal SRS, API specification, database ER view, UML (Mermaid), test plan, security design, and deployment package, see the docs/ folder.
Important
Please review the proposed database schema, tech stack choices, and the folder structure before I proceed with generating the code.
- Tech Stack: Frontend (Vanilla HTML, CSS, JS with Bootstrap), Backend (Node.js, Express.js), Database (MongoDB via Mongoose).
- Authentication: We will use JWT (JSON Web Tokens) for role-based authentication and authorization. Does that work for you?
- Database Mocks: Do you already have a MongoDB connection string (e.g. MongoDB Atlas), or would you like me to set it up to use a local MongoDB instance
mongodb://localhost:27017/sermngby default?
User Model
name(String)email(String, Unique)password(String, Hashed)role(Enum:client,admin,developer,tester)createdAt(Date)
ServiceRequest Model
client(ObjectId -> User)serviceType(String: e.g., 'Website Development', 'Bug Fixing', 'Maintenance')description(String)priority(Enum:Low,Medium,High)status(Enum:Pending Approval,Assigned,In Development,In Testing,Ready for Delivery,Completed,Rejected)assignedDev(ObjectId -> User, nullable)assignedTester(ObjectId -> User, nullable)devStatus(Enum:Not Started,In Progress,Completed)testerStatus(Enum:Pending,Bugs Found,Verified)bugsReported(String, nullable)slaDeadline(Date, nullable)createdAt(Date)
Feedback Model
client(ObjectId -> User)serviceRequest(ObjectId -> ServiceRequest)rating(Number: 1-5)comments(String)createdAt(Date)
Auth Routes (/api/auth)
POST /register: Register a new userPOST /login: Authenticate and return JWT token
Client Routes (/api/client)
POST /requests: Create a new service requestGET /requests: Get requests for the logged-in clientPOST /feedback: Submit feedback for a completed request
Admin Routes (/api/admin)
GET /requests: View all service requestsPUT /requests/:id/approve: Approve/reject request, assign Dev & Tester, set SLAGET /users: List all developers, testers, etc. for assignment
Developer Routes (/api/developer)
GET /tasks: View assigned tasks (Service Requests)PUT /tasks/:id/status: UpdatedevStatus(Not Started, In Progress, Completed)
Tester Routes (/api/tester)
GET /tasks: View completed dev tasks assigned to themPUT /tasks/:id/report-bug: Report a bug and send back to developmentPUT /tasks/:id/verify: Mark as verified andReady for Delivery
The frontend will use pure HTML, CSS, JavaScript, and Bootstrap 5 to ensure a clean, responsive, and student-friendly architecture. It will communicate with the backend via standard fetch API calls.
Directory Mapping:
public/index.html: Landing page (Company info, Services, login/register buttons).public/auth.html: Handles both Login and Registration.public/css/style.css: Custom UI styles, modern and responsive.public/js/: API services and scripts for each page.public/dashboards/client.html: Form to submit request, table to view past requests.admin.html: Table of all requests, modal to assign staff.developer.html: View tasks, update statuses.tester.html: Approve tasks or log bugs.feedback.html: Client form for providing service feedback.
- Initialize standard express app structure in
d:\Downloads\Projects\sermng. - Add security middleware (cors, express.json) and mongoose.
- Implementation of models, controllers, and routes as detailed above.
- Establish
publicfolder served statically by Express (app.use(express.static('public'))). - Create modern UI with Bootstrap container classes and custom CSS ensuring a premium feel.
- Create role-based navigation and authentication guards (checking JWT in
localStorage).
-
[!IMPORTANT] Is generating everything locally within the
d:\Downloads\Projects\sermngworkspace fine? -
[!IMPORTANT] Would you like a script to populate standard users out-of-the-box (e.g. pre-creating an Admin, Developer, and Tester account) for easier testing?
- Start the server via
npm start. - Open
http://localhost:3000to preview the Landing Page. - Test User Registration (Register as Client).
- As Client, create a Service Request.
- Create an Admin account via DB seeding or register script.
- Login as Admin, assign the ticket to a Dev and Tester.
- Login as Dev, change status to 'Completed'.
- Login as Tester, Verify the fix.
- Login as Client, see status as Completed and submit feedback.