a
Scope
Customer Enquiry Management
Log, assign, and track enquiries from first contact through quote, confirmation, and conversion to order. Full follow-up log history per enquiry with channel and status tracking.
Engineer Visit Scheduling
Schedule, reschedule, complete, or cancel site visits per enquiry. Assign engineers, set time slots and durations, and track visit status end-to-end with automated email notifications.
Order & Payment Management
Convert confirmed enquiries to orders. Track total amount, deposit, and balance payments. Record instalments with payment type, date, and method. Full payment history and pending payment views.
Employee & Department Management
Manage employees with auto-generated codes (EMP-0001), assign to multiple departments (Sales, Design, Installation, Manufacturing, Management), and control role-based access across the platform.
Dashboard & Reporting
Admin dashboard with KPI cards for enquiry counts, order pipeline value, today's visits, and upcoming installations. Reports covering revenue, employee performance, enquiry sources, and trends over time.
Automated Email Notifications
Gmail SMTP-powered transactional emails triggered on key events — visit scheduled/rescheduled/completed, order confirmations, and status updates — keeping customers and staff informed automatically.
Enquiry Status Pipeline
New
Logged
In Progress
Assigned
Visit Scheduled
Engineer booked
Visit Done
Surveyed
Quote Sent
Awaiting decision
Confirmed
Ready for order
Converted
Order created
Order Status Pipeline
Confirmed
Deposit Paid
In Production
Ready to Install
Install Scheduled
Installed
Completed
b
Features & Functionality
| Module / Area | Key Functionality | Highlights | Status |
|---|---|---|---|
| Authentication | JWT-based login with role middleware (Admin / Staff) | Protected routes; admin-only write operations enforced server-side | Live |
| Customer Management | CRUD with auto-codes (CUST-0001), search, multi-channel source tracking | Phone, WhatsApp, email, full address; linked enquiry history per customer | Live |
| Enquiry Management | Log enquiries with product interest, channel, priority, budget estimate | Auto-codes (ENQ-0001); assign to staff; full follow-up log with status transitions | Live |
| Employee Management | CRUD with auto-codes (EMP-0001); multi-department assignment | Departments: Sales, Design, Installation, Manufacturing, Management | Live |
| Visit Scheduling | Schedule, reschedule, complete, cancel visits per enquiry | Engineer assignment; duration tracking; email notifications on every status change | Live |
| Daily Schedule View | Engineer diary view filtered by date | All visits for the day with customer address, time slot, and status at a glance | Live |
| Calendar View | Visual calendar of all scheduled visits and installations | Admin-only; cross-engineer visibility for scheduling decisions | Live |
| Order Management | Convert confirmed enquiry to order; full order lifecycle tracking | Auto-codes (ORD-00001); total amount, deposit, balance; log history per order | Live |
| Payment Tracking | Record deposit and balance payments with method, date, and notes | Auto balance calculation; pending payments dashboard; payment history per order | Live |
| Admin Dashboard | KPI cards: enquiry counts, order pipeline value, visits today, upcoming installs | Recent enquiries, overdue items, today's visit schedule — all in one view | Live |
| Reports | Revenue reports, enquiry trends, source breakdown, employee performance | Date-range filtering; chart-ready data for frontend visualisation | Live |
| Organisation Settings | Configurable company name, contact info, branding settings | Admin-only write; staff can read; used globally across the platform | Live |
| Email Notifications | Automated transactional emails via Gmail SMTP | Async dispatch; visit confirmations, reschedule alerts, order updates | Module 4 |
Module Roadmap
Module 1 ?
Customer Enquiries
Enquiry logging, follow-up logs, customer records, employee assignment
Module 2
Engineer Visit Scheduling
Visit creation, rescheduling, completion, cancellation, daily diary
Module 3
Daily Schedule View
Per-engineer day view for visit planning and conflict avoidance
Module 4
Email Notifications
Gmail SMTP transactional emails on key status changes
Module 5
Employee & Department Mgmt
Full CRUD for employees and departments with role assignments
Module 6
Order Management
Convert enquiries to orders, track production, payments, and installation
c
Pictorial Process Flow
?
Enquiry
Customer logs interest
?
Assign & Follow Up
Staff assigned; logs added
?
Site Visit
Engineer surveys & quotes
?
Confirm & Convert
Quote accepted ? Order
?
Payments
Deposit & balance tracked
Install & Complete
Production ? Install ? Done
1
Customer Contacts — Enquiry Logged
Staff logs the enquiry at /enquiries/new. Auto-code ENQ-0001 assigned. Customer record created (CUST-0001) or matched from existing. Product interest, channel (Phone/Email/Walk-in/Website), priority, and budget estimate recorded.
2
Assign & Status ? In Progress
Admin assigns enquiry to a staff member. Status updated to In Progress. Follow-up logs added per interaction — each log captures channel, notes, and optional status change.
3
Visit Scheduled ? Engineer Surveys Site
Admin creates a visit from the enquiry. Engineer assigned, date and time slot set. Status ? Visit Scheduled. Email notification dispatched to customer. Visit appears on the engineer's Daily Schedule and admin Calendar view.
4
Visit Completed ? Quote Sent
Engineer completes visit; admin marks it Complete. Enquiry status moves to Visit Done, then Quote Sent once the quotation is delivered to the customer (via email or in person).
5
Quote Accepted ? Enquiry Confirmed ? Order Created
Customer confirms. Enquiry status ? Confirmed. Admin clicks "Convert to Order" — an order record (ORD-00001) is created linked to the enquiry and customer. Enquiry status ? Converted to Order.
6
Deposit Collected ? Production Begins
Deposit payment recorded against the order. Order status ? Deposit Paid ? In Production. Balance payment amount and expected installation date tracked throughout.
7
Ready to Install ? Installation Scheduled ? Installed ? Completed
Order progresses through production. Installation scheduled via the visit module. Final balance recorded upon completion. Order status ? Completed. Full audit trail preserved in order logs and payment records.
d
Data Flow Diagram
Inputs
Staff / Admin Login (JWT)
Customer Details (phone, address, source)
Enquiry Data (product, channel, priority)
Follow-up Log Entries
Visit Schedule (engineer, date, time)
Visit Completion / Reschedule
Order Conversion (amount, deposit date)
Payment Records (deposit / balance)
Employee & Department Data
Organisation Settings
USP API Engine
Node.js · Express · PostgreSQL
? JWT Auth Middleware
? Role Guards (Admin/Staff)
? Business Logic Controllers
? Auto-Code Triggers (DB)
? Updated_at Triggers
? Email Dispatch (async)
? RESTful JSON API
? Role Guards (Admin/Staff)
? Business Logic Controllers
? Auto-Code Triggers (DB)
? Updated_at Triggers
? Email Dispatch (async)
? RESTful JSON API
Outputs
Dashboard KPIs & Stats
Enquiry List (filtered / searched)
Customer Detail + Enquiry History
Visit Schedule (daily + calendar)
Order Detail + Log History
Pending Payments List
Payment History per Order
Reports (revenue, performance, source)
Email Notifications (visit / order)
Employee Performance Data
Entity Relationship Summary
Departments ? Employees (M:N via employee_departments)
Customers ? Enquiries (1:N) ? EnquiryLogs (1:N)
? Visits (1:N) ? assigned to Employee
? Orders (1:1) ? OrderLogs (1:N)
? OrderPayments (1:N)
All tables: created_at, updated_at auto-maintained via DB triggers
Customers ? Enquiries (1:N) ? EnquiryLogs (1:N)
? Visits (1:N) ? assigned to Employee
? Orders (1:1) ? OrderLogs (1:N)
? OrderPayments (1:N)
All tables: created_at, updated_at auto-maintained via DB triggers
e
Technology Stack
Frontend
React
SPA with React Router; functional components and hooks throughout
v18 · CRA
Backend
Node.js + Express
RESTful API with controller/route separation; async/await throughout
Node v18+
Database
PostgreSQL
Relational DB with triggers for auto-codes and updated_at timestamps
v14+
Auth
JWT
Token-based authentication; role middleware (Admin / Staff) enforced on all routes
jsonwebtoken
HTTP Client
Axios
Centralised API layer in frontend; proxied to backend on dev, configured for prod
axios
Email
Nodemailer
Async Gmail SMTP transactional emails; templated HTML notifications
nodemailer
DB Driver
node-postgres (pg)
Connection pool for all database queries; parameterised queries throughout
pg pool
Dev Tooling
Nodemon
Auto-reload on backend changes during development
npm run dev
Environment
dotenv
Environment variable management; .env.example provided for setup
.env
Package Mgmt
npm
Separate package.json for frontend and backend; proxy configured in frontend
npm
Version Control
Git / GitHub
Source code hosted on GitHub; structured commits per module
GitHub
Planned
Railway / Cloud
Cloud deployment target; PostgreSQL and Node.js service containers
Planned