# thesahilganbhoj/swiftcourier architecture

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

- Interactive diagram: https://gitdiagram.com/thesahilganbhoj/swiftcourier
- Repository: https://github.com/thesahilganbhoj/swiftcourier

## Overview

This repository implements a courier-shipping application: public visitors can explore shipping information and request shipments, while clients, employees, and admins have role-specific dashboards. The frontend routes these experiences and uses shared authentication and HTTP helpers; the Spring backend exposes APIs whose controllers delegate to service interfaces. Admin and employee workflows include order, branch, staff, and complaint management; client workflows include shipment creation and order history. The excerpts show selected controller-to-service calls and user lookup, but not most service implementations or the full frontend API wiring.

Main entry points: [`Frontend/courier frontend/src/App.js`](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Frontend/courier%20frontend/src/App.js) (App routes), [`Backend/courier_service/src/main/java/com/app/controller/AdminController.java`](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/AdminController.java) (Admin API), [`Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java`](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java) (Employee API), [`Frontend/courier frontend/src/services/helper/index.js`](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Frontend/courier%20frontend/src/services/helper/index.js) (HTTP helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_front["Web application"]
  node_routes["App routes<br/>[App.js]"]
  node_public["Public shipping"]
  node_clientdash["Client dashboard"]
  node_employeedash["Employee dashboard"]
  node_admindash["Admin dashboard"]
  node_http["HTTP helper<br/>[index.js]"]
  node_authstate["Auth state<br/>[index.js]"]
end

subgraph group_api["Backend API"]
  node_clientapi["Client API"]
  node_employeeapi["Employee API"]
  node_adminapi["Admin API"]
  node_authapi["Authentication API"]
end

subgraph group_domain["Business services"]
  node_orders["Order service<br/>[OrderService.java]"]
  node_users["User service<br/>[UserService.java]"]
  node_complaints["Complaint service"]
  node_branches["Branch service<br/>[BranchService.java]"]
  node_employees["Employee service"]
  node_models["DTO models"]
  node_userdao[("User repository<br/>[UserDao.java]")]
end

subgraph group_security["Identity and access"]
  node_securityconfig["Security config"]
  node_jwt["JWT utilities<br/>[JwtUtils.java]"]
  node_userdetails["User lookup"]
end

node_visitor(("Visitor"))
node_client(("Client"))
node_employee(("Employee"))
node_admin(("Administrator"))

node_visitor -->|"opens"| node_routes
node_client -.->|"opens"| node_routes
node_employee -.->|"opens"| node_routes
node_admin -.->|"opens"| node_routes
node_routes -->|"routes to"| node_public
node_routes -->|"routes to"| node_clientdash
node_routes -->|"routes to"| node_employeedash
node_routes -->|"routes to"| node_admindash
node_public -.->|"uses"| node_http
node_clientdash -.->|"uses"| node_http
node_employeedash -->|"uses"| node_http
node_admindash -->|"uses"| node_http
node_http -->|"gets token"| node_authstate
node_clientapi -->|"delegates"| node_orders
node_clientapi -->|"delegates"| node_users
node_employeeapi -->|"delegates"| node_orders
node_employeeapi -->|"delegates"| node_users
node_employeeapi -->|"delegates"| node_complaints
node_adminapi -->|"delegates"| node_orders
node_adminapi -->|"delegates"| node_branches
node_adminapi -->|"delegates"| node_employees
node_adminapi -->|"delegates"| node_complaints
node_adminapi -->|"delegates"| node_users
node_authapi -->|"delegates"| node_users
node_authapi -->|"uses"| node_jwt
node_userdetails -->|"looks up"| node_userdao
node_clientdash -.->|"calls API"| node_clientapi
node_employeedash -.->|"calls API"| node_employeeapi
node_admindash -.->|"calls API"| node_adminapi
node_securityconfig -.->|"configures"| node_jwt
node_clientapi -->|"exchanges"| node_models
node_adminapi -->|"exchanges"| node_models
node_employeeapi -->|"exchanges"| node_models

click node_routes "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Frontend/courier%20frontend/src/App.js"
click node_public "https://github.com/thesahilganbhoj/swiftcourier/tree/main/Frontend/courier%20frontend/src/components/User/Common"
click node_clientdash "https://github.com/thesahilganbhoj/swiftcourier/tree/main/Frontend/courier%20frontend/src/components/User/Client/ClientDashboard"
click node_employeedash "https://github.com/thesahilganbhoj/swiftcourier/tree/main/Frontend/courier%20frontend/src/components/Employee/EmployeeDashboard"
click node_admindash "https://github.com/thesahilganbhoj/swiftcourier/tree/main/Frontend/courier%20frontend/src/components/Admin/AdminDashboard"
click node_http "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Frontend/courier%20frontend/src/services/helper/index.js"
click node_authstate "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Frontend/courier%20frontend/src/services/auth/index.js"
click node_clientapi "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/ClientController.java"
click node_employeeapi "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java"
click node_adminapi "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/AdminController.java"
click node_authapi "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/AuthController.java"
click node_orders "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/OrderService.java"
click node_users "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/UserService.java"
click node_complaints "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/ComplaintService.java"
click node_branches "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/BranchService.java"
click node_employees "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/EmployeeService.java"
click node_models "https://github.com/thesahilganbhoj/swiftcourier/tree/main/Backend/courier_service/src/main/java/com/app/dto"
click node_securityconfig "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/config/WebSecurityConfig.java"
click node_jwt "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/jwt_utils/JwtUtils.java"
click node_userdetails "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/CustomUserDetailsService.java"
click node_userdao "https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/dao/UserDao.java"

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_routes,node_public,node_clientdash,node_employeedash,node_admindash,node_http,node_authstate,node_client toneBlue
class node_clientapi,node_employeeapi,node_adminapi,node_authapi toneAmber
class node_orders,node_users,node_complaints,node_branches,node_employees,node_models,node_userdao toneMint
class node_securityconfig,node_jwt,node_userdetails toneRose
class node_visitor,node_employee,node_admin toneIndigo
```

## Components

### Web application

- [App routes](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Frontend/courier%20frontend/src/App.js): `Frontend/courier frontend/src/App.js`
- [Public shipping](https://github.com/thesahilganbhoj/swiftcourier/tree/main/Frontend/courier%20frontend/src/components/User/Common): `Frontend/courier frontend/src/components/User/Common`
- [Client dashboard](https://github.com/thesahilganbhoj/swiftcourier/tree/main/Frontend/courier%20frontend/src/components/User/Client/ClientDashboard): `Frontend/courier frontend/src/components/User/Client/ClientDashboard`
- [Employee dashboard](https://github.com/thesahilganbhoj/swiftcourier/tree/main/Frontend/courier%20frontend/src/components/Employee/EmployeeDashboard): `Frontend/courier frontend/src/components/Employee/EmployeeDashboard`
- [Admin dashboard](https://github.com/thesahilganbhoj/swiftcourier/tree/main/Frontend/courier%20frontend/src/components/Admin/AdminDashboard): `Frontend/courier frontend/src/components/Admin/AdminDashboard`
- [HTTP helper](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Frontend/courier%20frontend/src/services/helper/index.js): `Frontend/courier frontend/src/services/helper/index.js`
- [Auth state](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Frontend/courier%20frontend/src/services/auth/index.js): `Frontend/courier frontend/src/services/auth/index.js`

### Backend API

- [Client API](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/ClientController.java): `Backend/courier_service/src/main/java/com/app/controller/ClientController.java`
- [Employee API](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java): `Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java`
- [Admin API](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/AdminController.java): `Backend/courier_service/src/main/java/com/app/controller/AdminController.java`
- [Authentication API](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/controller/AuthController.java): `Backend/courier_service/src/main/java/com/app/controller/AuthController.java`

### Business services

- [Order service](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/OrderService.java): `Backend/courier_service/src/main/java/com/app/service/OrderService.java`
- [User service](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/UserService.java): `Backend/courier_service/src/main/java/com/app/service/UserService.java`
- [Complaint service](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/ComplaintService.java): `Backend/courier_service/src/main/java/com/app/service/ComplaintService.java`
- [Branch service](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/BranchService.java): `Backend/courier_service/src/main/java/com/app/service/BranchService.java`
- [Employee service](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/EmployeeService.java): `Backend/courier_service/src/main/java/com/app/service/EmployeeService.java`
- [DTO models](https://github.com/thesahilganbhoj/swiftcourier/tree/main/Backend/courier_service/src/main/java/com/app/dto): `Backend/courier_service/src/main/java/com/app/dto`
- [User repository](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/dao/UserDao.java): `Backend/courier_service/src/main/java/com/app/dao/UserDao.java`

### Identity and access

- [Security config](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/config/WebSecurityConfig.java): `Backend/courier_service/src/main/java/com/app/config/WebSecurityConfig.java`
- [JWT utilities](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/jwt_utils/JwtUtils.java): `Backend/courier_service/src/main/java/com/app/jwt_utils/JwtUtils.java`
- [User lookup](https://github.com/thesahilganbhoj/swiftcourier/blob/main/Backend/courier_service/src/main/java/com/app/service/CustomUserDetailsService.java): `Backend/courier_service/src/main/java/com/app/service/CustomUserDetailsService.java`

### Other components

- **Visitor**
- **Client**
- **Employee**
- **Administrator**

## Connections

- Visitor → App routes: opens (evidence: `Frontend/courier frontend/src/App.js`)
- Client → App routes: opens
- Employee → App routes: opens
- Administrator → App routes: opens
- App routes → Public shipping: routes to (evidence: `Frontend/courier frontend/src/App.js`)
- App routes → Client dashboard: routes to (evidence: `Frontend/courier frontend/src/App.js`)
- App routes → Employee dashboard: routes to (evidence: `Frontend/courier frontend/src/App.js`)
- App routes → Admin dashboard: routes to (evidence: `Frontend/courier frontend/src/App.js`)
- Public shipping → HTTP helper: uses (evidence: `Frontend/courier frontend/src/components/User/Common/CreateAShipment/index.js`)
- Client dashboard → HTTP helper: uses
- Employee dashboard → HTTP helper: uses (evidence: `Frontend/courier frontend/src/components/Employee/EmployeeDashboard/ViewOrders/index.js`)
- Admin dashboard → HTTP helper: uses (evidence: `Frontend/courier frontend/src/components/Admin/AdminDashboard/ViewEmployees/index.js`)
- HTTP helper → Auth state: gets token (evidence: `Frontend/courier frontend/src/services/helper/index.js`)
- Client API → Order service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/ClientController.java`)
- Client API → User service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/ClientController.java`)
- Employee API → Order service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java`)
- Employee API → User service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java`)
- Employee API → Complaint service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java`)
- Admin API → Order service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/AdminController.java`)
- Admin API → Branch service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/AdminController.java`)
- Admin API → Employee service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/AdminController.java`)
- Admin API → Complaint service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/AdminController.java`)
- Admin API → User service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/AdminController.java`)
- Authentication API → User service: delegates (evidence: `Backend/courier_service/src/main/java/com/app/controller/AuthController.java`)
- Authentication API → JWT utilities: uses (evidence: `Backend/courier_service/src/main/java/com/app/controller/AuthController.java`)
- User lookup → User repository: looks up (evidence: `Backend/courier_service/src/main/java/com/app/service/CustomUserDetailsService.java`)
- Client dashboard → Client API: calls API
- Employee dashboard → Employee API: calls API
- Admin dashboard → Admin API: calls API
- Security config → JWT utilities: configures
- Client API → DTO models: exchanges (evidence: `Backend/courier_service/src/main/java/com/app/controller/ClientController.java`)
- Admin API → DTO models: exchanges (evidence: `Backend/courier_service/src/main/java/com/app/controller/AdminController.java`)
- Employee API → DTO models: exchanges (evidence: `Backend/courier_service/src/main/java/com/app/controller/EmployeeController.java`)
