WorkDesks is a robust, enterprise-grade support ticket management system designed to bridge the gap between customers and support teams. It features advanced data visibility controls for Company Managers, rich ticket interactions, and a seamless collaborative environment.
- π Key Features
- ποΈ System Architecture
- πΎ Database Schema
- π οΈ Technology Stack
- π Getting Started
- β¨οΈ Keyboard Shortcuts
- π API Reference
- π Project Structure
- π₯ Contributing
- Secure Auth: JWT-based stateless authentication.
- Role-Based Access Control (RBAC):
- π Super Admin: Full system control.
- π’ Manager: manages their own Companies and Contacts. Can view tickets only from their managed entities.
- π§ Agent: Handles ticket triage, replies, and status updates.
- π€ Customer: Creates tickets and tracks progress.
- Hierarchical Data: Customers (Contacts) belong to Companies.
- Manager Visibility: Managers are assigned to Companies and see all associated tickets and contacts.
- CRM Lite: Track company details, active plans, and associated users.
- Smart Queues: Sort by Priority, Status, and SLA.
- Quick Actions: One-click Forwarding, Closing, Deleting, and Merging (coming soon).
- Rich Interaction:
- Tiptap Editor: Rich text replies with formatting.
- Internal Notes: Private comments visible only to agents.
- Drafts: Auto-saved reply drafts in local storage.
- Signatures: Custom agent signatures appended to replies.
- Canned Responses: Quick access to pre-written replies.
- Sidebar Tools: Quick access to Print, Timers, and Due Date editing.
- Dynamic Dashboard: Activity charts using
recharts. - Metrics: Ticket volume trends, agent performance, and channel distribution.
- Global Search: Instantaneous search across tickets and users.
- Keyboard First:
Alt+Kshortcuts for navigation. - Persistent Filters: Smart filtering that remembers preferences.
- Automated Alerts: Instant email notifications for ticket creation and updates.
- Custom Patterns: Professional, polished HTML email templates (SaaS style).
- Secure Configuration: SMTP credentials encrypted using AES-256 for maximum security.
- Testing: Built-in tools for admins to test SMTP channels.
WorkDesks follows a MERN (MongoDB, Express, React, Node.js) architecture.
- Frontend: Vite + React SPA. Uses
react-queryfor server state andcontextfor auth/theme. - Backend: Node.js + Express REST API.
- Database: MongoDB (with Mongoose ODM).
graph TD
User((User))
subgraph Frontend [React + Vite]
UI[Shadcn UI]
Query[React Query]
end
subgraph Backend [Node.js + Express]
API[REST API]
Auth[JWT Guard]
end
subgraph Data [MongoDB]
DB[(Cluster)]
end
User --> UI
UI -->|Hooks| Query
Query -->|JSON| API
API -->|Validation| Auth
Auth -->|Mongoose| DB
The data model includes Users, Tickets, Companies, and Comments.
erDiagram
Company ||--o{ User : "employs"
Company ||--o{ Ticket : "originates"
User ||--o{ Ticket : "creates"
User ||--o{ Ticket : "assigned_to"
Ticket ||--o{ Comment : "contains"
Company {
ObjectId _id
String name
String domain
}
User {
ObjectId _id
String name
String role
ObjectId companyId
}
Ticket {
ObjectId _id
String subject
String status
String priority
ObjectId companyId
ObjectId createdBy
ObjectId assignedTo
}
- Framework: React 18, Vite
- Styling: Tailwind CSS, Shadcn UI, Lucide Icons
- State/Fetching: TanStack React Query, React Router DOM
- Forms: React Hook Form, Zod
- Editor: Tiptap
- Utils: date-fns, sonner (toast)
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB, Mongoose
- Auth: JWT (jsonwebtoken), bcryptjs
- Auth: JWT (jsonwebtoken), bcryptjs
- Validation: express-validator
- Email: Nodemailer (SMTP)
- Security: AES-256 Encryption (for sensitive credentials)
- Node.js: v18+
- MongoDB: v5+ (Local or Atlas)
-
Clone the Repository
git clone https://github.com/developer-yasir/support-desk.git cd support-desk -
Backend Setup
cd backend npm install # Create .env file echo "PORT=5000 MONGODB_URI=mongodb://localhost:27017/supportdesk JWT_SECRET=super_secret_key FRONTEND_URL=http://localhost:5173 EMAIL_HOST=smtp.gmail.com EMAIL_USER=your-email@gmail.com EMAIL_PASS=your-app-password ENCRYPTION_KEY=your-64-byte-hex-key" > .env # Run Server npm run dev
-
Frontend Setup
cd ../frontend npm install # Run Client npm run dev
-
Access App Open
http://localhost:5173.
| Action | Shortcut |
|---|---|
| New Ticket | Alt + N |
| Go to Tickets | Alt + T |
| Dashboard | Alt + D |
| Search | / |
Base URL: http://localhost:5000/api
POST /auth/register- Register userPOST /auth/login- Login
GET /tickets- List tickets (Role filtered)POST /tickets- Create ticketGET /tickets/:id- Get detailsPUT /tickets/:id- Update status/assignmentDELETE /tickets/:id- Delete ticketPOST /tickets/:id/comments- Reply (Internal/Public)POST /tickets/:id/forward- Forward ticket (Mock)
GET /companies- List companiesGET /companies/:id- Get company detailsPOST /companies- Create company
support-desk/
βββ backend/
β βββ src/
β β βββ controllers/ # Business Logic
β β βββ middleware/ # Auth, Error Handling
β β βββ models/ # Database Schemas
β β βββ routes/ # API Definition
β
βββ frontend/
β βββ src/
β β βββ components/ # UI Components (Alerts, Dialogs)
β β βββ contexts/ # AuthProvider
β β βββ pages/ # Full Views (TicketDetail, Dashboard)
β β βββ lib/ # API Client (axios)
Contributions are welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License.
Built with β€οΈ by Yasir