# ayushbhatt14257/plexigenius architecture

> Architecture diagram of the GitHub repository ayushbhatt14257/plexigenius, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ayushbhatt14257/plexigenius
- Repository: https://github.com/ayushbhatt14257/plexigenius

## Overview

This is an employee and task management app with an Express/Mongoose backend and a React admin interface. The main workflow is admin login, then managing employees and tasks; tasks are assigned to employees and surfaced in both dashboards. The backend protects employee/task routes with JWT middleware and stores admins, employees, and tasks through Mongoose models. Several frontend-to-API links are evidenced by fetch calls; links for unsampled login and task-dashboard behavior are omitted where the available references do not establish the action.

Main entry points: [`frontend/src/App.js`](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/App.js) (App routing), [`backend/routes/taskRoutes.js`](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/routes/taskRoutes.js) (Task endpoints), [`backend/server.js`](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/server.js) (HTTP server), [`frontend/src/pages/Employee/EmployeeDash.jsx`](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/pages/Employee/EmployeeDash.jsx) (Employee dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Admin interface"]
  node_app["App routing<br/>[App.js]"]
  node_login["Login screen<br/>[Login.jsx]"]
  node_navbar["Navigation<br/>[Nav.jsx]"]
  node_employee_dash["Employee dashboard<br/>[EmployeeDash.jsx]"]
  node_employee_modal["Employee editor<br/>[EmployeeModal.jsx]"]
  node_task_dash["Task dashboard<br/>[TaskDash.jsx]"]
  node_task_modal["Task editor<br/>[TaskModal.jsx]"]
end

subgraph group_identity["Admin identity"]
  node_auth_context["Auth state<br/>[AuthContext.js]"]
  node_admin_routes["Admin endpoints<br/>[adminRoutes.js]"]
  node_auth_middleware["JWT protection<br/>[authMiddleware.js]"]
  node_token["Token generation<br/>[generateToken.js]"]
end

subgraph group_operations["Employee and task operations"]
  node_server["HTTP server<br/>[server.js]"]
  node_employee_routes["Employee endpoints<br/>[employessRoute.js]"]
  node_task_routes["Task endpoints<br/>[taskRoutes.js]"]
end

subgraph group_persistence["Data persistence"]
  node_admin_model["Admin model<br/>[adminSchema.js]"]
  node_employee_model["Employee model<br/>[employess.js]"]
  node_task_model["Task model<br/>[taskSchema.js]"]
  node_mongo[("MongoDB<br/>[conn.js]")]
end

node_admin(("Admin"))

node_admin -.->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"wraps pages"| node_navbar
node_app -->|"routes to"| node_employee_dash
node_app -->|"routes to"| node_task_dash
node_app -->|"reads admin"| node_auth_context
node_login -->|"imports"| node_auth_context
node_navbar -->|"reads auth"| node_auth_context
node_employee_dash -->|"renders"| node_employee_modal
node_employee_dash -->|"fetches employees"| node_employee_routes
node_employee_dash -->|"fetches tasks"| node_task_routes
node_task_dash -->|"imports"| node_task_modal
node_task_modal -->|"submits task requests"| node_task_routes
node_server -->|"loads connection"| node_mongo
node_server -->|"mounts routes"| node_admin_routes
node_server -->|"mounts routes"| node_employee_routes
node_server -->|"mounts routes"| node_task_routes
node_admin_routes -->|"queries"| node_admin_model
node_admin_routes -->|"generates token"| node_token
node_employee_routes -->|"protects routes"| node_auth_middleware
node_employee_routes -->|"queries"| node_employee_model
node_task_routes -->|"protects routes"| node_auth_middleware
node_task_routes -->|"queries"| node_task_model
node_task_routes -->|"checks assignee"| node_employee_model
node_auth_middleware -->|"loads admin"| node_admin_model

click node_app "https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/App.js"
click node_login "https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/pages/Login/Login.jsx"
click node_navbar "https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/Layout/navbar/Nav.jsx"
click node_employee_dash "https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/pages/Employee/EmployeeDash.jsx"
click node_employee_modal "https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/modal/employeeModal/EmployeeModal.jsx"
click node_task_dash "https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/pages/Task/TaskDash.jsx"
click node_task_modal "https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/modal/taskModal/TaskModal.jsx"
click node_auth_context "https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/context/AuthContext.js"
click node_server "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/server.js"
click node_admin_routes "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/routes/adminRoutes.js"
click node_auth_middleware "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/middleware/authMiddleware.js"
click node_token "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/utils/generateToken.js"
click node_employee_routes "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/routes/employessRoute.js"
click node_task_routes "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/routes/taskRoutes.js"
click node_admin_model "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/model/adminSchema.js"
click node_employee_model "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/model/employess.js"
click node_task_model "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/model/taskSchema.js"
click node_mongo "https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/db/conn.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_app,node_login,node_navbar,node_employee_dash,node_employee_modal,node_task_dash,node_task_modal toneBlue
class node_auth_context,node_admin_routes,node_auth_middleware,node_token toneAmber
class node_server,node_employee_routes,node_task_routes toneMint
class node_admin_model,node_employee_model,node_task_model,node_mongo toneRose
class node_admin toneIndigo
```

## Components

### Admin interface

- [App routing](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Login screen](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/pages/Login/Login.jsx): `frontend/src/pages/Login/Login.jsx`
- [Navigation](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/Layout/navbar/Nav.jsx): `frontend/src/Layout/navbar/Nav.jsx`
- [Employee dashboard](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/pages/Employee/EmployeeDash.jsx): `frontend/src/pages/Employee/EmployeeDash.jsx`
- [Employee editor](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/modal/employeeModal/EmployeeModal.jsx): `frontend/src/modal/employeeModal/EmployeeModal.jsx`
- [Task dashboard](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/pages/Task/TaskDash.jsx): `frontend/src/pages/Task/TaskDash.jsx`
- [Task editor](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/modal/taskModal/TaskModal.jsx): `frontend/src/modal/taskModal/TaskModal.jsx`

### Admin identity

- [Auth state](https://github.com/ayushbhatt14257/plexigenius/blob/main/frontend/src/context/AuthContext.js): `frontend/src/context/AuthContext.js`
- [Admin endpoints](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/routes/adminRoutes.js): `backend/routes/adminRoutes.js`
- [JWT protection](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Token generation](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/utils/generateToken.js): `backend/utils/generateToken.js`

### Employee and task operations

- [HTTP server](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/server.js): `backend/server.js`
- [Employee endpoints](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/routes/employessRoute.js): `backend/routes/employessRoute.js`
- [Task endpoints](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/routes/taskRoutes.js): `backend/routes/taskRoutes.js`

### Data persistence

- [Admin model](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/model/adminSchema.js): `backend/model/adminSchema.js`
- [Employee model](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/model/employess.js): `backend/model/employess.js`
- [Task model](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/model/taskSchema.js): `backend/model/taskSchema.js`
- [MongoDB](https://github.com/ayushbhatt14257/plexigenius/blob/main/backend/db/conn.js): `backend/db/conn.js`

### Other components

- **Admin**

## Connections

- Admin → App routing: uses
- App routing → Login screen: routes to (evidence: `frontend/src/App.js`)
- App routing → Navigation: wraps pages (evidence: `frontend/src/App.js`)
- App routing → Employee dashboard: routes to (evidence: `frontend/src/App.js`)
- App routing → Task dashboard: routes to (evidence: `frontend/src/App.js`)
- App routing → Auth state: reads admin (evidence: `frontend/src/App.js`)
- Login screen → Auth state: imports (evidence: `frontend/src/pages/Login/Login.jsx`)
- Navigation → Auth state: reads auth (evidence: `frontend/src/Layout/navbar/Nav.jsx`)
- Employee dashboard → Employee editor: renders (evidence: `frontend/src/pages/Employee/EmployeeDash.jsx`)
- Employee dashboard → Employee endpoints: fetches employees (evidence: `frontend/src/pages/Employee/EmployeeDash.jsx`)
- Employee dashboard → Task endpoints: fetches tasks (evidence: `frontend/src/pages/Employee/EmployeeDash.jsx`)
- Task dashboard → Task editor: imports (evidence: `frontend/src/pages/Task/TaskDash.jsx`)
- Task editor → Task endpoints: submits task requests (evidence: `frontend/src/modal/taskModal/TaskModal.jsx`)
- HTTP server → MongoDB: loads connection (evidence: `backend/server.js`)
- HTTP server → Admin endpoints: mounts routes (evidence: `backend/server.js`)
- HTTP server → Employee endpoints: mounts routes (evidence: `backend/server.js`)
- HTTP server → Task endpoints: mounts routes (evidence: `backend/server.js`)
- Admin endpoints → Admin model: queries (evidence: `backend/routes/adminRoutes.js`)
- Admin endpoints → Token generation: generates token (evidence: `backend/routes/adminRoutes.js`)
- Employee endpoints → JWT protection: protects routes (evidence: `backend/routes/employessRoute.js`)
- Employee endpoints → Employee model: queries (evidence: `backend/routes/employessRoute.js`)
- Task endpoints → JWT protection: protects routes (evidence: `backend/routes/taskRoutes.js`)
- Task endpoints → Task model: queries (evidence: `backend/routes/taskRoutes.js`)
- Task endpoints → Employee model: checks assignee (evidence: `backend/routes/taskRoutes.js`)
- JWT protection → Admin model: loads admin (evidence: `backend/middleware/authMiddleware.js`)
