How abeyakilesh/it-service-analyst-platform works
1. Purpose and deployment shape
This is a MERN IT service-ticketing and analytics platform. It manages organizations, users/roles, ticket lifecycles, categories/SLAs, auditability, analytics, messaging, and notifications. The React/Vite client is intended for Vercel; the Express API for Render; MongoDB Atlas is the persistent store.
2. Client bootstrap, routing, and UI shell
The browser entry point mounts the React application, with application-level routing and role-aware dashboard selection. Authenticated pages are wrapped by shared navigation/layout components.
• client/src/main.jsx
• client/src/App.jsx
• client/src/routes/DashboardRouter.jsx
• client/src/components/ProtectedRoute.jsx
• client/src/layouts/MainLayout.jsx
3. Client state and API boundary
UI pages invoke domain-specific Axios API modules rather than calling the server directly. Axios centralizes API-base configuration and likely token/request behavior; Zustand stores retain authentication and theme state. This is the browser-to-REST boundary.
• client/src/api/axios.js
• client/src/api/authApi.js
• client/src/api/ticketApi.js
• client/src/store/authStore.js
• client/src/store/themeStore.js
4. User-facing workflows
Ticket listing, creation, and detail pages constitute the core operational workflow. Admin and user dashboards surface role-specific views; analytics and organization pages support management and reporting. Real-time notification UI is integrated into the shared client shell.
• client/src/pages/TicketListPage.jsx
• client/src/pages/TicketCreatePage.jsx
• client/src/pages/TicketDetailPage.jsx
• client/src/pages/AdminDashboard.jsx
• client/src/pages/AnalyticsPage.jsx
• client/src/components/NotificationListener.jsx
5. Express application pipeline
The backend starts from a server bootstrap and application composition layer, connects to MongoDB through Mongoose, and exposes route groups. Requests flow route → authentication/validation/error middleware → controller → Mongoose model → JSON response.
• server/server.js
• server/app.js
• server/config/db.js
• server/middleware/auth.js
• server/middleware/errorHandler.js
6. Identity, authorization, and tenancy
JWT-based registration/login/profile processing establishes the user identity consumed by protected routes. Roles (admin, analyst, user) govern protected operations and dashboard behavior. Organizations are a core tenancy/ownership dimension for tickets and reporting.
• server/routes/auth.js
• server/controllers/authController.js
• server/models/User.js
• server/routes/organizations.js
• server/models/Organization.js
7. Ticket, SLA, and traceability domain
Ticket controllers implement the main CRUD and status workflow. Tickets link users, organizations, categories, and SLA targets; category/SLA management defines service policy. Audit logs provide compliance-oriented history, while messages and notifications support collaboration and event delivery.
• server/controllers/ticketController.js
• server/models/Ticket.js
• server/models/ServiceCategory.js
• server/models/SLA.js
• server/controllers/auditLogController.js
• server/socket.js
8. Analytics and infrastructure boundaries
Analytics endpoints calculate or retrieve organization-level service metrics for dashboard consumption, with persisted report support. External runtime dependencies are Node.js/Express, React 18/Vite, MongoDB Atlas/Mongoose, JWT/bcrypt, Axios, and Socket-based real-time communication. Environment variables provide Mongo connection, JWT secret, API URL, and port boundaries.
• server/routes/analytics.js
• server/controllers/analyticsController.js
• server/models/AnalyticsReport.js
• client/src/api/analyticsApi.js
Main entry points: MainLayout.jsx Protected app shell · auth.js Auth & error middleware · App.jsx App routing · ticketController.js Ticket & SLA domain
Components 18
React Client
Vite browser application deployed to Vercel.
- Client bootstrap
client/src/main.jsx - App routing · Selects role-aware dashboards and protected pages.
client/src/App.jsx - Dashboard selection
client/src/routes/DashboardRouter.jsx - Protected app shell
client/src/layouts/MainLayout.jsx - Client state · Authentication and theme state.
client/src/store/authStore.js - Ticket workflow UI · List, create, and detail ticket operations.
client/src/pages/TicketListPage.jsx - Management & analytics UI · Admin dashboard and organization reporting views.
client/src/pages/AdminDashboard.jsx - REST API modules · Centralized API base, token behavior, and domain calls.
client/src/api/axios.js - Notification listener
client/src/components/NotificationListener.jsx
Express API
Node service deployed to Render.
- Server bootstrap
server/server.js - Express application · Mounts REST routes and middleware pipeline.
server/app.js - Auth & error middleware · Protects requests and formats failures.
server/middleware/auth.js - Identity & organizations · JWT login/profile and organization tenancy management.
server/routes/auth.js - Ticket & SLA domain · CRUD, status workflow, categories, SLA policy, and audit history.
server/controllers/ticketController.js - Analytics domain · Organization service metrics and persisted reports.
server/controllers/analyticsController.js
Data & Realtime
MongoDB-backed domain persistence and socket delivery.
- Socket service · Delivers collaboration and notification events.
server/socket.js - Mongo connection
server/config/db.js - MongoDB Atlas · Stores users, organizations, tickets, policies, audit logs, and reports.
Connections 22
- Client bootstrap → App routing: mounts
- App routing → Dashboard selection: selects by role
- App routing → Protected app shell: wraps authenticated routes
- Protected app shell → Ticket workflow UI: hosts
- Protected app shell → Management & analytics UI: hosts
- Protected app shell → Notification listener: integrates
- Client state → App routing: auth state
- Ticket workflow UI → REST API modules: ticket requests
- Management & analytics UI → REST API modules: analytics requests
- REST API modules → Express application: HTTPS REST
- Server bootstrap → Express application: starts
- Server bootstrap → Mongo connection: connects
- Express application → Auth & error middleware: applies
- Auth & error middleware → Identity & organizations: authorizes routes
- Auth & error middleware → Ticket & SLA domain: authorizes routes
- Auth & error middleware → Analytics domain: authorizes routes
- Identity & organizations → MongoDB Atlas: users and organizations
- Ticket & SLA domain → MongoDB Atlas: tickets, SLA, audit logs
- Analytics domain → MongoDB Atlas: metrics and reports
- Mongo connection → MongoDB Atlas: Mongoose
- Ticket & SLA domain → Socket service: ticket events
- Socket service → Notification listener: socket events