# abeyakilesh/it-service-analyst-platform architecture

> Architecture diagram of the GitHub repository abeyakilesh/it-service-analyst-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abeyakilesh/it-service-analyst-platform
- Repository: https://github.com/abeyakilesh/it-service-analyst-platform

## Overview

#### 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: [`client/src/layouts/MainLayout.jsx`](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/layouts/MainLayout.jsx) (Protected app shell), [`server/middleware/auth.js`](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/middleware/auth.js) (Auth & error middleware), [`client/src/App.jsx`](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/App.jsx) (App routing), [`server/controllers/ticketController.js`](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/controllers/ticketController.js) (Ticket & SLA domain)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React Client"]
  node_client_bootstrap["Client bootstrap<br/>React entry<br/>[main.jsx]"]
  node_client_router["App routing<br/>React routes<br/>[App.jsx]"]
  node_dashboard_router["Dashboard selection<br/>role router"]
  node_client_shell["Protected app shell<br/>layout &amp; guard<br/>[MainLayout.jsx]"]
  node_client_state["Client state<br/>Zustand stores<br/>[authStore.js]"]
  node_ticket_ui["Ticket workflow UI<br/>React pages<br/>[TicketListPage.jsx]"]
  node_management_ui["Management &amp; analytics UI<br/>React pages<br/>[AdminDashboard.jsx]"]
  node_api_client{{"REST API modules<br/>Axios boundary<br/>[axios.js]"}}
  node_notification_ui["Notification listener<br/>realtime UI"]
end

subgraph group_api["Express API"]
  node_server_bootstrap["Server bootstrap<br/>Node entry<br/>[server.js]"]
  node_express_app["Express application<br/>app composition<br/>[app.js]"]
  node_auth_pipeline["Auth &amp; error middleware<br/>JWT middleware<br/>[auth.js]"]
  node_identity_tenancy["Identity &amp; organizations<br/>REST domain<br/>[auth.js]"]
  node_ticket_domain["Ticket &amp; SLA domain<br/>REST domain"]
  node_analytics_domain["Analytics domain<br/>REST domain"]
end

subgraph group_data["Data &amp; Realtime"]
  node_realtime_service["Socket service<br/>event delivery<br/>[socket.js]"]
  node_mongo_connection["Mongo connection<br/>Mongoose setup<br/>[db.js]"]
  node_mongodb_atlas[("MongoDB Atlas<br/>persistent store")]
end

node_client_bootstrap -->|"mounts"| node_client_router
node_client_router -->|"selects by role"| node_dashboard_router
node_client_router -->|"wraps authenticated routes"| node_client_shell
node_client_shell -->|"hosts"| node_ticket_ui
node_client_shell -->|"hosts"| node_management_ui
node_client_shell -->|"integrates"| node_notification_ui
node_client_state -->|"auth state"| node_client_router
node_ticket_ui -->|"ticket requests"| node_api_client
node_management_ui -->|"analytics requests"| node_api_client
node_api_client -->|"HTTPS REST"| node_express_app
node_server_bootstrap -->|"starts"| node_express_app
node_server_bootstrap -->|"connects"| node_mongo_connection
node_express_app -->|"applies"| node_auth_pipeline
node_auth_pipeline -->|"authorizes routes"| node_identity_tenancy
node_auth_pipeline -->|"authorizes routes"| node_ticket_domain
node_auth_pipeline -->|"authorizes routes"| node_analytics_domain
node_identity_tenancy -->|"users and organizations"| node_mongodb_atlas
node_ticket_domain -->|"tickets, SLA, audit logs"| node_mongodb_atlas
node_analytics_domain -->|"metrics and reports"| node_mongodb_atlas
node_mongo_connection -->|"Mongoose"| node_mongodb_atlas
node_ticket_domain -->|"ticket events"| node_realtime_service
node_realtime_service -->|"socket events"| node_notification_ui

click node_client_bootstrap "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/main.jsx"
click node_client_router "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/App.jsx"
click node_dashboard_router "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/routes/DashboardRouter.jsx"
click node_client_shell "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/layouts/MainLayout.jsx"
click node_client_state "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/store/authStore.js"
click node_ticket_ui "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/pages/TicketListPage.jsx"
click node_management_ui "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/pages/AdminDashboard.jsx"
click node_api_client "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/api/axios.js"
click node_notification_ui "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/components/NotificationListener.jsx"
click node_server_bootstrap "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/server.js"
click node_express_app "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/app.js"
click node_auth_pipeline "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/middleware/auth.js"
click node_identity_tenancy "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/routes/auth.js"
click node_ticket_domain "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/controllers/ticketController.js"
click node_analytics_domain "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/controllers/analyticsController.js"
click node_realtime_service "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/socket.js"
click node_mongo_connection "https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/config/db.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_bootstrap,node_client_router,node_dashboard_router,node_client_shell,node_client_state,node_ticket_ui,node_management_ui,node_api_client,node_notification_ui toneBlue
class node_server_bootstrap,node_express_app,node_auth_pipeline,node_identity_tenancy,node_ticket_domain,node_analytics_domain toneAmber
class node_realtime_service,node_mongo_connection,node_mongodb_atlas toneMint
```

## Components

### React Client

Vite browser application deployed to Vercel.

- [Client bootstrap](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/main.jsx): React entry · `client/src/main.jsx`
- [App routing](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/App.jsx): React routes · Selects role-aware dashboards and protected pages. · `client/src/App.jsx`
- [Dashboard selection](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/routes/DashboardRouter.jsx): role router · `client/src/routes/DashboardRouter.jsx`
- [Protected app shell](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/layouts/MainLayout.jsx): layout & guard · `client/src/layouts/MainLayout.jsx`
- [Client state](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/store/authStore.js): Zustand stores · Authentication and theme state. · `client/src/store/authStore.js`
- [Ticket workflow UI](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/pages/TicketListPage.jsx): React pages · List, create, and detail ticket operations. · `client/src/pages/TicketListPage.jsx`
- [Management & analytics UI](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/pages/AdminDashboard.jsx): React pages · Admin dashboard and organization reporting views. · `client/src/pages/AdminDashboard.jsx`
- [REST API modules](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/api/axios.js): Axios boundary · Centralized API base, token behavior, and domain calls. · `client/src/api/axios.js`
- [Notification listener](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/client/src/components/NotificationListener.jsx): realtime UI · `client/src/components/NotificationListener.jsx`

### Express API

Node service deployed to Render.

- [Server bootstrap](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/server.js): Node entry · `server/server.js`
- [Express application](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/app.js): app composition · Mounts REST routes and middleware pipeline. · `server/app.js`
- [Auth & error middleware](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/middleware/auth.js): JWT middleware · Protects requests and formats failures. · `server/middleware/auth.js`
- [Identity & organizations](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/routes/auth.js): REST domain · JWT login/profile and organization tenancy management. · `server/routes/auth.js`
- [Ticket & SLA domain](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/controllers/ticketController.js): REST domain · CRUD, status workflow, categories, SLA policy, and audit history. · `server/controllers/ticketController.js`
- [Analytics domain](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/controllers/analyticsController.js): REST domain · Organization service metrics and persisted reports. · `server/controllers/analyticsController.js`

### Data & Realtime

MongoDB-backed domain persistence and socket delivery.

- [Socket service](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/socket.js): event delivery · Delivers collaboration and notification events. · `server/socket.js`
- [Mongo connection](https://github.com/abeyakilesh/it-service-analyst-platform/blob/main/server/config/db.js): Mongoose setup · `server/config/db.js`
- **MongoDB Atlas**: persistent store · Stores users, organizations, tickets, policies, audit logs, and reports.

## Connections

- 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
