# aqilfadhil1225/reimbursement architecture

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

- Interactive diagram: https://gitdiagram.com/aqilfadhil1225/reimbursement
- Repository: https://github.com/aqilfadhil1225/reimbursement

## Overview

Reimbursely is a role-based reimbursement workflow: employees create claims, add expenses and receipt evidence, then submit; managers review, finance verifies and records payment. The backend exposes these stages through authenticated APIs, with related user, notification, audit-log and reporting capabilities. The tree documents those supporting areas, but their implementation details and wiring were not sampled, so the graph leaves their internal links out. The frontend dashboard excerpts show manager review behavior; other dashboard and action details are inferred only from their filenames.

Main entry points: [`backend/src/app.ts`](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/app.ts) (API app), [`frontend/app/page.tsx`](https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/page.tsx) (App entry), [`backend/src/routes/reimbursementRoutes.ts`](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/reimbursementRoutes.ts) (Claim routes), [`backend/src/controllers/reimbursementController.ts`](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/reimbursementController.ts) (Claim controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend["App entry<br/>[page.tsx]"]
  node_employee_ui["Employee dashboard"]
  node_manager_ui["Manager dashboard"]
  node_finance_ui["Finance dashboard"]
  node_claim_actions["Claim actions<br/>[reimbursements.ts]"]
end

subgraph group_api["API and access"]
  node_app["API app<br/>[app.ts]"]
  node_auth_routes["Auth routes<br/>[authRoutes.ts]"]
  node_auth_controller["Auth controller<br/>[authController.ts]"]
  node_auth_service["Auth service<br/>[authService.ts]"]
  node_auth_model["Auth model<br/>[authModel.ts]"]
  node_auth_middleware["Authentication<br/>[authMiddleware.ts]"]
end

subgraph group_workflow["Reimbursement workflow"]
  node_claim_routes["Claim routes"]
  node_claim_controller["Claim controller"]
  node_claim_service["Claim workflow"]
  node_claim_model["Claim model"]
  node_expense_routes["Expense routes<br/>[expenseRoutes.ts]"]
  node_expense_controller["Expense controller"]
  node_expense_service["Expense service<br/>[expenseService.ts]"]
  node_payment_routes["Payment routes<br/>[paymentRoutes.ts]"]
  node_payment_controller["Payment controller"]
  node_payment_service["Payment service<br/>[paymentService.ts]"]
  node_payment_model["Payment model<br/>[paymentModel.ts]"]
  node_receipt_upload["Receipt upload<br/>[uploadReceipt.ts]"]
  node_claim_view["Claim response view"]
end

subgraph group_support["Operations and insights"]
  node_audit_routes["Audit routes<br/>[auditLogRoutes.ts]"]
  node_notification_routes["Notification routes"]
  node_report_routes["Report routes<br/>[reportRoutes.ts]"]
  node_user_routes["User routes<br/>[userRoutes.ts]"]
end

node_employee(("Employee"))
node_manager(("Manager"))
node_finance(("Finance"))
node_database[("Database")]

node_employee -->|"uses"| node_frontend
node_manager -->|"uses"| node_frontend
node_finance -->|"uses"| node_frontend
node_frontend -->|"renders"| node_employee_ui
node_frontend -->|"renders"| node_manager_ui
node_frontend -->|"renders"| node_finance_ui
node_employee_ui -->|"claim actions"| node_claim_actions
node_claim_actions -->|"API requests"| node_app
node_app -->|"mounts"| node_auth_routes
node_app -->|"mounts"| node_claim_routes
node_app -->|"mounts"| node_expense_routes
node_app -->|"mounts"| node_payment_routes
node_app -->|"authenticates"| node_auth_middleware
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"queries"| node_auth_model
node_claim_routes -->|"dispatches"| node_claim_controller
node_claim_routes -->|"uploads"| node_receipt_upload
node_claim_controller -->|"calls"| node_claim_service
node_claim_controller -->|"formats response"| node_claim_view
node_claim_service -->|"reads and writes"| node_claim_model
node_claim_service -->|"audits changes"| node_database
node_expense_routes -->|"dispatches"| node_expense_controller
node_expense_routes -->|"uploads"| node_receipt_upload
node_expense_controller -->|"calls"| node_expense_service
node_expense_service -->|"persists expenses"| node_database
node_payment_routes -->|"dispatches"| node_payment_controller
node_payment_routes -->|"uploads"| node_receipt_upload
node_payment_controller -->|"calls"| node_payment_service
node_payment_service -->|"reads and writes"| node_payment_model
node_app -->|"mounts"| node_audit_routes
node_app -->|"mounts"| node_notification_routes
node_app -->|"mounts"| node_report_routes
node_app -->|"mounts"| node_user_routes

click node_frontend "https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/page.tsx"
click node_employee_ui "https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/components/EmployeeDashboard.tsx"
click node_manager_ui "https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/components/ManagerDashboard.tsx"
click node_finance_ui "https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/components/FinanceDashboard.tsx"
click node_claim_actions "https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/actions/reimbursements.ts"
click node_app "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/app.ts"
click node_auth_routes "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/authRoutes.ts"
click node_auth_controller "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/authController.ts"
click node_auth_service "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/services/authService.ts"
click node_auth_model "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/models/authModel.ts"
click node_auth_middleware "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/middleware/authMiddleware.ts"
click node_claim_routes "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/reimbursementRoutes.ts"
click node_claim_controller "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/reimbursementController.ts"
click node_claim_service "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/services/reimbursementService.ts"
click node_claim_model "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/models/reimbursementModel.ts"
click node_expense_routes "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/expenseRoutes.ts"
click node_expense_controller "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/expenseController.ts"
click node_expense_service "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/services/expenseService.ts"
click node_payment_routes "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/paymentRoutes.ts"
click node_payment_controller "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/paymentController.ts"
click node_payment_service "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/services/paymentService.ts"
click node_payment_model "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/models/paymentModel.ts"
click node_receipt_upload "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/middleware/uploadReceipt.ts"
click node_claim_view "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/views/reimbursementView.ts"
click node_audit_routes "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/auditLogRoutes.ts"
click node_notification_routes "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/notificationRoutes.ts"
click node_report_routes "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/reportRoutes.ts"
click node_user_routes "https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/userRoutes.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_frontend,node_employee_ui,node_manager_ui,node_finance_ui,node_claim_actions toneBlue
class node_app,node_auth_routes,node_auth_controller,node_auth_service,node_auth_model,node_auth_middleware,node_database toneAmber
class node_claim_routes,node_claim_controller,node_claim_service,node_claim_model,node_expense_routes,node_expense_controller,node_expense_service,node_payment_routes,node_payment_controller,node_payment_service,node_payment_model,node_receipt_upload,node_claim_view toneMint
class node_audit_routes,node_notification_routes,node_report_routes,node_user_routes toneRose
class node_employee,node_manager,node_finance toneIndigo
```

## Components

### Web client

- [App entry](https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Employee dashboard](https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/components/EmployeeDashboard.tsx): `frontend/app/components/EmployeeDashboard.tsx`
- [Manager dashboard](https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/components/ManagerDashboard.tsx): `frontend/app/components/ManagerDashboard.tsx`
- [Finance dashboard](https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/components/FinanceDashboard.tsx): `frontend/app/components/FinanceDashboard.tsx`
- [Claim actions](https://github.com/aqilfadhil1225/reimbursement/blob/main/frontend/app/actions/reimbursements.ts): `frontend/app/actions/reimbursements.ts`

### API and access

- [API app](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Auth routes](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/authRoutes.ts): `backend/src/routes/authRoutes.ts`
- [Auth controller](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/authController.ts): `backend/src/controllers/authController.ts`
- [Auth service](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/services/authService.ts): `backend/src/services/authService.ts`
- [Auth model](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/models/authModel.ts): `backend/src/models/authModel.ts`
- [Authentication](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/middleware/authMiddleware.ts): `backend/src/middleware/authMiddleware.ts`

### Reimbursement workflow

- [Claim routes](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/reimbursementRoutes.ts): `backend/src/routes/reimbursementRoutes.ts`
- [Claim controller](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/reimbursementController.ts): `backend/src/controllers/reimbursementController.ts`
- [Claim workflow](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/services/reimbursementService.ts): `backend/src/services/reimbursementService.ts`
- [Claim model](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/models/reimbursementModel.ts): `backend/src/models/reimbursementModel.ts`
- [Expense routes](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/expenseRoutes.ts): `backend/src/routes/expenseRoutes.ts`
- [Expense controller](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/expenseController.ts): `backend/src/controllers/expenseController.ts`
- [Expense service](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/services/expenseService.ts): `backend/src/services/expenseService.ts`
- [Payment routes](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/paymentRoutes.ts): `backend/src/routes/paymentRoutes.ts`
- [Payment controller](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/controllers/paymentController.ts): `backend/src/controllers/paymentController.ts`
- [Payment service](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/services/paymentService.ts): `backend/src/services/paymentService.ts`
- [Payment model](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/models/paymentModel.ts): `backend/src/models/paymentModel.ts`
- [Receipt upload](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/middleware/uploadReceipt.ts): `backend/src/middleware/uploadReceipt.ts`
- [Claim response view](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/views/reimbursementView.ts): `backend/src/views/reimbursementView.ts`

### Operations and insights

- [Audit routes](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/auditLogRoutes.ts): `backend/src/routes/auditLogRoutes.ts`
- [Notification routes](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/notificationRoutes.ts): `backend/src/routes/notificationRoutes.ts`
- [Report routes](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/reportRoutes.ts): `backend/src/routes/reportRoutes.ts`
- [User routes](https://github.com/aqilfadhil1225/reimbursement/blob/main/backend/src/routes/userRoutes.ts): `backend/src/routes/userRoutes.ts`

### Other components

- **Employee**
- **Manager**
- **Finance**
- **Database**

## Connections

- Employee → App entry: uses
- Manager → App entry: uses
- Finance → App entry: uses
- App entry → Employee dashboard: renders
- App entry → Manager dashboard: renders
- App entry → Finance dashboard: renders
- Employee dashboard → Claim actions: claim actions
- Claim actions → API app: API requests
- API app → Auth routes: mounts
- API app → Claim routes: mounts
- API app → Expense routes: mounts
- API app → Payment routes: mounts
- API app → Authentication: authenticates
- Auth routes → Auth controller: dispatches
- Auth controller → Auth service: calls
- Auth service → Auth model: queries
- Claim routes → Claim controller: dispatches
- Claim routes → Receipt upload: uploads
- Claim controller → Claim workflow: calls
- Claim controller → Claim response view: formats response
- Claim workflow → Claim model: reads and writes
- Claim workflow → Database: audits changes
- Expense routes → Expense controller: dispatches
- Expense routes → Receipt upload: uploads
- Expense controller → Expense service: calls
- Expense service → Database: persists expenses
- Payment routes → Payment controller: dispatches
- Payment routes → Receipt upload: uploads
- Payment controller → Payment service: calls
- Payment service → Payment model: reads and writes
- API app → Audit routes: mounts
- API app → Notification routes: mounts
- API app → Report routes: mounts
- API app → User routes: mounts
