# enxproductofficial-bit/enterprenex-solutions architecture

> Architecture diagram of the GitHub repository enxproductofficial-bit/enterprenex-solutions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/enxproductofficial-bit/enterprenex-solutions
- Repository: https://github.com/enxproductofficial-bit/enterprenex-solutions

## Overview

Enterprenex combines a public technology-services website with an enterprise work-management platform: staff can authenticate and manage employees, attendance, tasks, and performance records, while administrators have broader client, project, finance, CRM, and operational pages. Prospective customers can browse service offerings and reach the contact flow. The backend is an Express API with JWT/role middleware and Prisma-backed routes. Frontend-to-backend wiring and several unsampled domains are not evidenced by the excerpts, so those links are omitted; broader admin capabilities are represented without asserting their implementation details.

Main entry points: [`backend/src/server.ts`](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/server.ts) (HTTP API Server), [`backend/src/db.ts`](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/db.ts) (Prisma Data Access), [`frontend/src/admin/context/AdminContext.tsx`](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/context/AdminContext.tsx) (Admin State), [`backend/src/middleware/auth.ts`](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/middleware/auth.ts) (Token and Role Checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Website"]
  node_services["Service Catalogue<br/>[ServicesPage.tsx]"]
  node_service_data["Service Content<br/>[servicesData.ts]"]
  node_service_detail["Service Details"]
  node_public_pages["Company and Contact Pages"]
end

subgraph group_admin["Admin Workspace"]
  node_admin_pages["Admin Operations"]
  node_client_admin["Client Management<br/>[ClientsPage.tsx]"]
  node_task_admin["Task Management<br/>[TasksPage.tsx]"]
  node_service_admin["Service Management"]
  node_admin_state["Admin State<br/>[AdminContext.tsx]"]
end

subgraph group_api["Backend API"]
  node_api_server["HTTP API Server<br/>[server.ts]"]
  node_auth_routes["Login and Profile<br/>[auth.routes.ts]"]
  node_employee_routes["Employee Management<br/>[employee.routes.ts]"]
  node_attendance_routes["Attendance"]
  node_task_routes["Task Workflow<br/>[task.routes.ts]"]
  node_kpi_routes["KPIs and OKRs<br/>[kpi.routes.ts]"]
end

subgraph group_identity["Identity and Data"]
  node_auth_middleware["Token and Role Checks<br/>[auth.ts]"]
  node_prisma_db[("Prisma Data Access<br/>[db.ts]")]
  node_seed_data["Initial Data Seeding<br/>[seed.ts]"]
end

node_visitor(("Visitor"))
node_staff(("Staff User"))

node_visitor -.->|"browses"| node_services
node_visitor -.->|"visits"| node_public_pages
node_services -->|"reads content"| node_service_data
node_services -.->|"links to detail"| node_service_detail
node_staff -.->|"uses workspace"| node_admin_pages
node_admin_pages -.->|"uses shared state"| node_admin_state
node_client_admin -->|"reads and updates"| node_admin_state
node_task_admin -->|"uses task state"| node_admin_state
node_service_admin -->|"uses service state"| node_admin_state
node_api_server -->|"mounts routes"| node_auth_routes
node_api_server -->|"mounts routes"| node_employee_routes
node_api_server -->|"mounts routes"| node_attendance_routes
node_api_server -->|"mounts routes"| node_task_routes
node_api_server -->|"mounts routes"| node_kpi_routes
node_auth_routes -->|"guards profile"| node_auth_middleware
node_employee_routes -->|"checks access"| node_auth_middleware
node_task_routes -->|"checks access"| node_auth_middleware
node_kpi_routes -->|"checks access"| node_auth_middleware
node_auth_routes -->|"queries users"| node_prisma_db
node_employee_routes -->|"manages records"| node_prisma_db
node_task_routes -->|"stores tasks"| node_prisma_db
node_kpi_routes -->|"stores metrics"| node_prisma_db
node_attendance_routes -.->|"uses data store"| node_prisma_db
node_seed_data -->|"seeds records"| node_prisma_db

click node_services "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/pages/ServicesPage.tsx"
click node_service_data "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/data/servicesData.ts"
click node_service_detail "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/layouts/ServicePageLayout.tsx"
click node_public_pages "https://github.com/enxproductofficial-bit/enterprenex-solutions/tree/main/frontend/src/pages"
click node_admin_pages "https://github.com/enxproductofficial-bit/enterprenex-solutions/tree/main/frontend/src/admin/pages"
click node_client_admin "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/pages/ClientsPage.tsx"
click node_task_admin "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/pages/TasksPage.tsx"
click node_service_admin "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/pages/ServicesManagePage.tsx"
click node_admin_state "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/context/AdminContext.tsx"
click node_api_server "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/server.ts"
click node_auth_routes "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/auth.routes.ts"
click node_employee_routes "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/employee.routes.ts"
click node_attendance_routes "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/attendance.routes.ts"
click node_task_routes "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/task.routes.ts"
click node_kpi_routes "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/kpi.routes.ts"
click node_auth_middleware "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/middleware/auth.ts"
click node_prisma_db "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/db.ts"
click node_seed_data "https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/seed.ts"

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_services,node_service_data,node_service_detail,node_public_pages,node_staff toneBlue
class node_admin_pages,node_client_admin,node_task_admin,node_service_admin,node_admin_state toneAmber
class node_api_server,node_auth_routes,node_employee_routes,node_attendance_routes,node_task_routes,node_kpi_routes toneMint
class node_auth_middleware,node_prisma_db,node_seed_data toneRose
class node_visitor toneIndigo
```

## Components

### Public Website

- [Service Catalogue](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/pages/ServicesPage.tsx): `frontend/src/pages/ServicesPage.tsx`
- [Service Content](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/data/servicesData.ts): `frontend/src/data/servicesData.ts`
- [Service Details](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/layouts/ServicePageLayout.tsx): `frontend/src/layouts/ServicePageLayout.tsx`
- [Company and Contact Pages](https://github.com/enxproductofficial-bit/enterprenex-solutions/tree/main/frontend/src/pages): `frontend/src/pages`

### Admin Workspace

- [Admin Operations](https://github.com/enxproductofficial-bit/enterprenex-solutions/tree/main/frontend/src/admin/pages): `frontend/src/admin/pages`
- [Client Management](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/pages/ClientsPage.tsx): `frontend/src/admin/pages/ClientsPage.tsx`
- [Task Management](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/pages/TasksPage.tsx): `frontend/src/admin/pages/TasksPage.tsx`
- [Service Management](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/pages/ServicesManagePage.tsx): `frontend/src/admin/pages/ServicesManagePage.tsx`
- [Admin State](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/frontend/src/admin/context/AdminContext.tsx): `frontend/src/admin/context/AdminContext.tsx`

### Backend API

- [HTTP API Server](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Login and Profile](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [Employee Management](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/employee.routes.ts): `backend/src/routes/employee.routes.ts`
- [Attendance](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/attendance.routes.ts): `backend/src/routes/attendance.routes.ts`
- [Task Workflow](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/task.routes.ts): `backend/src/routes/task.routes.ts`
- [KPIs and OKRs](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/routes/kpi.routes.ts): `backend/src/routes/kpi.routes.ts`

### Identity and Data

- [Token and Role Checks](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/middleware/auth.ts): `backend/src/middleware/auth.ts`
- [Prisma Data Access](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/db.ts): `backend/src/db.ts`
- [Initial Data Seeding](https://github.com/enxproductofficial-bit/enterprenex-solutions/blob/main/backend/src/seed.ts): `backend/src/seed.ts`

### Other components

- **Visitor**
- **Staff User**

## Connections

- Visitor → Service Catalogue: browses
- Visitor → Company and Contact Pages: visits
- Service Catalogue → Service Content: reads content (evidence: `frontend/src/pages/ServicesPage.tsx`)
- Service Catalogue → Service Details: links to detail
- Staff User → Admin Operations: uses workspace
- Admin Operations → Admin State: uses shared state (evidence: `frontend/src/admin/pages/TasksPage.tsx`)
- Client Management → Admin State: reads and updates (evidence: `frontend/src/admin/pages/ClientsPage.tsx`)
- Task Management → Admin State: uses task state (evidence: `frontend/src/admin/pages/TasksPage.tsx`)
- Service Management → Admin State: uses service state (evidence: `frontend/src/admin/pages/ServicesManagePage.tsx`)
- HTTP API Server → Login and Profile: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API Server → Employee Management: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API Server → Attendance: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API Server → Task Workflow: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API Server → KPIs and OKRs: mounts routes (evidence: `backend/src/server.ts`)
- Login and Profile → Token and Role Checks: guards profile (evidence: `backend/src/routes/auth.routes.ts`)
- Employee Management → Token and Role Checks: checks access (evidence: `backend/src/routes/employee.routes.ts`)
- Task Workflow → Token and Role Checks: checks access (evidence: `backend/src/routes/task.routes.ts`)
- KPIs and OKRs → Token and Role Checks: checks access (evidence: `backend/src/routes/kpi.routes.ts`)
- Login and Profile → Prisma Data Access: queries users (evidence: `backend/src/routes/auth.routes.ts`)
- Employee Management → Prisma Data Access: manages records (evidence: `backend/src/routes/employee.routes.ts`)
- Task Workflow → Prisma Data Access: stores tasks (evidence: `backend/src/routes/task.routes.ts`)
- KPIs and OKRs → Prisma Data Access: stores metrics (evidence: `backend/src/routes/kpi.routes.ts`)
- Attendance → Prisma Data Access: uses data store
- Initial Data Seeding → Prisma Data Access: seeds records (evidence: `backend/src/seed.ts`)
