# bhimashankarkumbar/labour-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/bhimashankarkumbar/labour-tracker
- Repository: https://github.com/bhimashankarkumbar/labour-tracker

## Overview

Labour Tracker is a workforce and job-site management application. Managers use the React interface to authenticate, manage workers and worksites, record daily attendance and wages, log payments and expenses, and review dashboard and report views. The Spring backend exposes domain operations through controllers and services, with repositories and JPA entities providing persistence. The README documents MySQL and JWT authentication. Several backend capabilities are present in the tree but were not sampled, so their internal connections are left unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/App.jsx) (Routes and app shell), [`backend/src/main/java/com/labourtracker/repository`](https://github.com/bhimashankarkumbar/labour-tracker/tree/main/backend/src/main/java/com/labourtracker/repository) (Domain repositories), [`frontend/src/services/api.js`](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/api.js) (API client), [`backend/src/main/java/com/labourtracker/controller`](https://github.com/bhimashankarkumbar/labour-tracker/tree/main/backend/src/main/java/com/labourtracker/controller) (REST controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Routes and app shell<br/>[App.jsx]"]
  node_workers_ui["Worker management<br/>[WorkersPage.jsx]"]
  node_worker_detail["Worker details"]
  node_works_ui["Worksite management<br/>[WorksPage.jsx]"]
  node_work_detail["Worksite details<br/>[WorkDetailPage.jsx]"]
  node_payments_ui["Payments<br/>[PaymentsPage.jsx]"]
  node_expenses_ui["Expenses<br/>[ExpensesPage.jsx]"]
  node_dashboard_ui["Dashboard<br/>[DashboardPage.jsx]"]
  node_reports_ui["Reports<br/>[ReportsPage.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_auth["Authentication"]
  node_auth_context["Session context<br/>[AuthContext.jsx]"]
  node_login["Login and registration<br/>[LoginPage.jsx]"]
  node_auth_service["Auth service<br/>[authService.js]"]
  node_auth_backend["Authentication operations<br/>[AuthService.java]"]
end

subgraph group_workforce["Workforce and sites"]
  node_worker_service["Worker service<br/>[workerService.js]"]
  node_work_service["Work service<br/>[workService.js]"]
  node_worker_backend["Worker operations<br/>[WorkerService.java]"]
  node_work_backend["Worksite operations<br/>[WorkService.java]"]
  node_attendance_backend["Attendance and wage assignments"]
  node_workday_backend["Workday records"]
end

subgraph group_finance["Payments and expenses"]
  node_payment_service["Payment service<br/>[paymentService.js]"]
  node_finance_backend["Payments and expenses"]
  node_expense_backend["Expense operations"]
end

subgraph group_insights["Analytics and persistence"]
  node_dashboard_service["Dashboard service"]
  node_dashboard_backend["Dashboard metrics"]
  node_controllers["REST controllers"]
  node_repositories["Domain repositories"]
  node_entities[("JPA domain entities")]
end

node_manager(("Manager"))
node_mysql[("MySQL")]

node_manager -->|"uses"| node_app
node_app -->|"provides session"| node_auth_context
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_workers_ui
node_app -->|"routes to"| node_worker_detail
node_app -->|"routes to"| node_works_ui
node_app -->|"routes to"| node_work_detail
node_app -->|"routes to"| node_payments_ui
node_app -->|"routes to"| node_expenses_ui
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_reports_ui
node_auth_context -->|"uses"| node_auth_service
node_auth_service -->|"calls"| node_api_client
node_workers_ui -->|"calls"| node_worker_service
node_worker_detail -->|"calls"| node_worker_service
node_worker_service -->|"calls"| node_api_client
node_work_service -->|"calls"| node_api_client
node_payment_service -->|"calls"| node_api_client
node_login -.->|"submits credentials"| node_auth_service
node_works_ui -.->|"requests work data"| node_work_service
node_work_detail -.->|"requests work data"| node_work_service
node_payments_ui -.->|"requests payments"| node_payment_service
node_expenses_ui -.->|"requests expenses"| node_api_client
node_dashboard_ui -.->|"requests metrics"| node_dashboard_service
node_reports_ui -.->|"requests reports"| node_dashboard_service
node_controllers -->|"delegates work"| node_work_backend
node_controllers -->|"delegates workdays"| node_workday_backend
node_controllers -->|"delegates assignments"| node_attendance_backend
node_controllers -->|"delegates workers"| node_worker_backend
node_auth_backend -->|"reads users"| node_repositories
node_work_backend -->|"queries work data"| node_repositories
node_worker_backend -->|"queries workers"| node_repositories
node_workday_backend -->|"queries workdays"| node_repositories
node_attendance_backend -.->|"queries assignments"| node_repositories
node_finance_backend -.->|"queries payments"| node_repositories
node_expense_backend -.->|"queries expenses"| node_repositories
node_dashboard_backend -.->|"aggregates metrics"| node_repositories
node_repositories -.->|"persists records"| node_entities
node_entities -.->|"stores data"| node_mysql

click node_app "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/App.jsx"
click node_auth_context "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/context/AuthContext.jsx"
click node_login "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/auth/LoginPage.jsx"
click node_workers_ui "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/workers/WorkersPage.jsx"
click node_worker_detail "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/workers/WorkerDetailPage.jsx"
click node_works_ui "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/works/WorksPage.jsx"
click node_work_detail "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/works/WorkDetailPage.jsx"
click node_payments_ui "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/payments/PaymentsPage.jsx"
click node_expenses_ui "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/expenses/ExpensesPage.jsx"
click node_dashboard_ui "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/dashboard/DashboardPage.jsx"
click node_reports_ui "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/reports/ReportsPage.jsx"
click node_api_client "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/api.js"
click node_auth_service "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/authService.js"
click node_worker_service "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/workerService.js"
click node_work_service "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/workService.js"
click node_payment_service "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/paymentService.js"
click node_dashboard_service "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/dashboardService.js"
click node_auth_backend "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/AuthService.java"
click node_worker_backend "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/WorkerService.java"
click node_work_backend "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/WorkService.java"
click node_attendance_backend "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/DailyWorkerService.java"
click node_workday_backend "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/WorkDayService.java"
click node_finance_backend "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/PaymentService.java"
click node_expense_backend "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/ExpenseService.java"
click node_dashboard_backend "https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/DashboardService.java"
click node_controllers "https://github.com/bhimashankarkumbar/labour-tracker/tree/main/backend/src/main/java/com/labourtracker/controller"
click node_repositories "https://github.com/bhimashankarkumbar/labour-tracker/tree/main/backend/src/main/java/com/labourtracker/repository"
click node_entities "https://github.com/bhimashankarkumbar/labour-tracker/tree/main/backend/src/main/java/com/labourtracker/entity"

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_workers_ui,node_worker_detail,node_works_ui,node_work_detail,node_payments_ui,node_expenses_ui,node_dashboard_ui,node_reports_ui,node_api_client toneBlue
class node_auth_context,node_login,node_auth_service,node_auth_backend,node_mysql toneAmber
class node_worker_service,node_work_service,node_worker_backend,node_work_backend,node_attendance_backend,node_workday_backend toneMint
class node_payment_service,node_finance_backend,node_expense_backend toneRose
class node_dashboard_service,node_dashboard_backend,node_controllers,node_repositories,node_entities,node_manager toneIndigo
```

## Components

### Web application

- [Routes and app shell](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Worker management](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/workers/WorkersPage.jsx): `frontend/src/pages/workers/WorkersPage.jsx`
- [Worker details](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/workers/WorkerDetailPage.jsx): `frontend/src/pages/workers/WorkerDetailPage.jsx`
- [Worksite management](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/works/WorksPage.jsx): `frontend/src/pages/works/WorksPage.jsx`
- [Worksite details](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/works/WorkDetailPage.jsx): `frontend/src/pages/works/WorkDetailPage.jsx`
- [Payments](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/payments/PaymentsPage.jsx): `frontend/src/pages/payments/PaymentsPage.jsx`
- [Expenses](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/expenses/ExpensesPage.jsx): `frontend/src/pages/expenses/ExpensesPage.jsx`
- [Dashboard](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/dashboard/DashboardPage.jsx): `frontend/src/pages/dashboard/DashboardPage.jsx`
- [Reports](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/reports/ReportsPage.jsx): `frontend/src/pages/reports/ReportsPage.jsx`
- [API client](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Authentication

- [Session context](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Login and registration](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/pages/auth/LoginPage.jsx): `frontend/src/pages/auth/LoginPage.jsx`
- [Auth service](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Authentication operations](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/AuthService.java): `backend/src/main/java/com/labourtracker/service/AuthService.java`

### Workforce and sites

- [Worker service](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/workerService.js): `frontend/src/services/workerService.js`
- [Work service](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/workService.js): `frontend/src/services/workService.js`
- [Worker operations](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/WorkerService.java): `backend/src/main/java/com/labourtracker/service/WorkerService.java`
- [Worksite operations](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/WorkService.java): `backend/src/main/java/com/labourtracker/service/WorkService.java`
- [Attendance and wage assignments](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/DailyWorkerService.java): `backend/src/main/java/com/labourtracker/service/DailyWorkerService.java`
- [Workday records](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/WorkDayService.java): `backend/src/main/java/com/labourtracker/service/WorkDayService.java`

### Payments and expenses

- [Payment service](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/paymentService.js): `frontend/src/services/paymentService.js`
- [Payments and expenses](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/PaymentService.java): `backend/src/main/java/com/labourtracker/service/PaymentService.java`
- [Expense operations](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/ExpenseService.java): `backend/src/main/java/com/labourtracker/service/ExpenseService.java`

### Analytics and persistence

- [Dashboard service](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/frontend/src/services/dashboardService.js): `frontend/src/services/dashboardService.js`
- [Dashboard metrics](https://github.com/bhimashankarkumbar/labour-tracker/blob/main/backend/src/main/java/com/labourtracker/service/DashboardService.java): `backend/src/main/java/com/labourtracker/service/DashboardService.java`
- [REST controllers](https://github.com/bhimashankarkumbar/labour-tracker/tree/main/backend/src/main/java/com/labourtracker/controller): `backend/src/main/java/com/labourtracker/controller`
- [Domain repositories](https://github.com/bhimashankarkumbar/labour-tracker/tree/main/backend/src/main/java/com/labourtracker/repository): `backend/src/main/java/com/labourtracker/repository`
- [JPA domain entities](https://github.com/bhimashankarkumbar/labour-tracker/tree/main/backend/src/main/java/com/labourtracker/entity): `backend/src/main/java/com/labourtracker/entity`

### Other components

- **Manager**
- **MySQL**

## Connections

- Manager → Routes and app shell: uses (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Session context: provides session (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Login and registration: routes to (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Worker management: routes to (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Worker details: routes to (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Worksite management: routes to (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Worksite details: routes to (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Payments: routes to (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Expenses: routes to (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Routes and app shell → Reports: routes to (evidence: `frontend/src/App.jsx`)
- Session context → Auth service: uses (evidence: `frontend/src/context/AuthContext.jsx`)
- Auth service → API client: calls (evidence: `frontend/src/services/authService.js`)
- Worker management → Worker service: calls (evidence: `frontend/src/pages/workers/WorkersPage.jsx`)
- Worker details → Worker service: calls (evidence: `frontend/src/pages/workers/WorkerDetailPage.jsx`)
- Worker service → API client: calls (evidence: `frontend/src/services/workerService.js`)
- Work service → API client: calls (evidence: `frontend/src/services/workService.js`)
- Payment service → API client: calls (evidence: `frontend/src/services/paymentService.js`)
- Login and registration → Auth service: submits credentials
- Worksite management → Work service: requests work data
- Worksite details → Work service: requests work data
- Payments → Payment service: requests payments
- Expenses → API client: requests expenses
- Dashboard → Dashboard service: requests metrics
- Reports → Dashboard service: requests reports
- REST controllers → Worksite operations: delegates work (evidence: `backend/src/main/java/com/labourtracker/controller/WorkController.java`)
- REST controllers → Workday records: delegates workdays (evidence: `backend/src/main/java/com/labourtracker/controller/WorkDayController.java`)
- REST controllers → Attendance and wage assignments: delegates assignments (evidence: `backend/src/main/java/com/labourtracker/controller/WorkDayController.java`)
- REST controllers → Worker operations: delegates workers (evidence: `backend/src/main/java/com/labourtracker/controller/WorkerController.java`)
- Authentication operations → Domain repositories: reads users (evidence: `backend/src/main/java/com/labourtracker/service/AuthService.java`)
- Worksite operations → Domain repositories: queries work data (evidence: `backend/src/main/java/com/labourtracker/service/WorkService.java`)
- Worker operations → Domain repositories: queries workers (evidence: `backend/src/main/java/com/labourtracker/service/WorkerService.java`)
- Workday records → Domain repositories: queries workdays (evidence: `backend/src/main/java/com/labourtracker/service/WorkDayService.java`)
- Attendance and wage assignments → Domain repositories: queries assignments (evidence: `backend/src/main/java/com/labourtracker/service/DailyWorkerService.java`)
- Payments and expenses → Domain repositories: queries payments
- Expense operations → Domain repositories: queries expenses
- Dashboard metrics → Domain repositories: aggregates metrics
- Domain repositories → JPA domain entities: persists records (evidence: `backend/src/main/java/com/labourtracker/repository/DailyWorkerRepository.java`)
- JPA domain entities → MySQL: stores data
