# harshpatel-08/smart-courier-manager architecture

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

- Interactive diagram: https://gitdiagram.com/harshpatel-08/smart-courier-manager
- Repository: https://github.com/harshpatel-08/smart-courier-manager

## Overview

Smart Courier Manager is a Spring Boot REST API for courier operations. Clients authenticate or register, create and track orders, and staff assign parcels to delivery agents; assignment status and location can then be updated, including scheduled status progression. The graph preserves the documented JWT, role, email, validation, and centralized-error capabilities. Source excerpts establish several service calls and persistence interactions; other documented layers are represented from the README, while unsampled implementation details are not inferred.

Main entry points: [`src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java`](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java) (Order Lifecycle), [`src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java`](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java) (Delivery Assignment), [`src/main/java/com/Harsh/Smart/Courier/Manager/Repository/UserRepository.java`](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/UserRepository.java) (User Records), [`src/main/java/com/Harsh/Smart/Courier/Manager/Controller/OrderController.java`](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/OrderController.java) (Order API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_auth_controller["Authentication API"]
  node_user_controller["User API"]
  node_order_controller["Order API"]
  node_assignment_controller["Assignment API"]
  node_errors["Error Handling"]
end

subgraph group_security["Identity and Security"]
  node_jwt_filter["JWT Request Filter"]
  node_jwt_provider["JWT Tokens"]
  node_security_config["Access Configuration"]
  node_auth_service["Authentication<br/>[AuthService.java]"]
  node_registration["User Registration"]
end

subgraph group_operations["Courier Operations"]
  node_order_service["Order Lifecycle<br/>[OrderService.java]"]
  node_assignment_service["Delivery Assignment"]
  node_scheduled_updates["Scheduled Updates"]
  node_email["Email Notifications<br/>[EmailService.java]"]
end

subgraph group_persistence["Persistence"]
  node_users[("User Records")]
  node_orders[("Order Records")]
  node_parcels[("Parcel Records")]
  node_assignments[("Assignment Records")]
  node_locations[("Location Records")]
end

node_client(("API Client"))
node_mysql[("MySQL")]
node_smtp["Gmail SMTP"]

node_client -->|"sends requests"| node_jwt_filter
node_jwt_filter -->|"validates tokens"| node_jwt_provider
node_jwt_filter -.->|"uses security rules"| node_security_config
node_client -->|"submits login"| node_auth_controller
node_client -->|"registers users"| node_user_controller
node_client -->|"manages orders"| node_order_controller
node_client -->|"manages deliveries"| node_assignment_controller
node_auth_controller -->|"delegates login"| node_auth_service
node_user_controller -->|"delegates registration"| node_registration
node_order_controller -->|"delegates orders"| node_order_service
node_assignment_controller -->|"delegates assignments"| node_assignment_service
node_auth_service -->|"looks up users"| node_users
node_auth_service -->|"generates token"| node_jwt_provider
node_registration -.->|"persists accounts"| node_users
node_order_service -->|"loads customer"| node_users
node_order_service -->|"loads locations"| node_locations
node_order_service -->|"saves and queries"| node_orders
node_order_service -->|"requests notification"| node_email
node_email -.->|"sends mail"| node_smtp
node_assignment_service -->|"loads parcels"| node_parcels
node_assignment_service -->|"checks agents"| node_users
node_assignment_service -->|"reads locations"| node_locations
node_assignment_service -->|"reads and updates"| node_assignments
node_scheduled_updates -->|"loads in-transit records"| node_assignments
node_orders -->|"stores entities"| node_mysql
node_assignments -->|"stores entities"| node_mysql
node_users -->|"stores entities"| node_mysql
node_parcels -->|"stores entities"| node_mysql
node_locations -->|"stores entities"| node_mysql
node_order_controller -.->|"returns structured errors"| node_errors
node_assignment_controller -.->|"returns structured errors"| node_errors

click node_auth_controller "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/AuthController.java"
click node_user_controller "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/UserController.java"
click node_order_controller "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/OrderController.java"
click node_assignment_controller "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/DeliveryAssignmentController.java"
click node_errors "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Exception/GlobalExceptionHandler.java"
click node_jwt_filter "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Security/jwtAuthenticationFilter.java"
click node_jwt_provider "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Security/JwtTokenProvider.java"
click node_security_config "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Security/SecurityConfig.java"
click node_auth_service "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/AuthService.java"
click node_registration "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/RegisterUserUseCase.java"
click node_order_service "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java"
click node_assignment_service "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java"
click node_scheduled_updates "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/ScheduledDeliveryUpdateService.java"
click node_email "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/EmailService.java"
click node_users "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/UserRepository.java"
click node_orders "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/OrderRepository.java"
click node_parcels "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/ParcelRepository.java"
click node_assignments "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/DeliveryAssignmentRepository.java"
click node_locations "https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/LocationRepository.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_auth_controller,node_user_controller,node_order_controller,node_assignment_controller,node_errors,node_client toneBlue
class node_jwt_filter,node_jwt_provider,node_security_config,node_auth_service,node_registration,node_mysql toneAmber
class node_order_service,node_assignment_service,node_scheduled_updates,node_email toneMint
class node_users,node_orders,node_parcels,node_assignments,node_locations toneRose
class node_smtp toneIndigo
```

## Components

### REST API

- [Authentication API](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/AuthController.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Controller/AuthController.java`
- [User API](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/UserController.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Controller/UserController.java`
- [Order API](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/OrderController.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Controller/OrderController.java`
- [Assignment API](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Controller/DeliveryAssignmentController.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Controller/DeliveryAssignmentController.java`
- [Error Handling](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Exception/GlobalExceptionHandler.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Exception/GlobalExceptionHandler.java`

### Identity and Security

- [JWT Request Filter](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Security/jwtAuthenticationFilter.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Security/jwtAuthenticationFilter.java`
- [JWT Tokens](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Security/JwtTokenProvider.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Security/JwtTokenProvider.java`
- [Access Configuration](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Security/SecurityConfig.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Security/SecurityConfig.java`
- [Authentication](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/AuthService.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Service/AuthService.java`
- [User Registration](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/RegisterUserUseCase.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Service/RegisterUserUseCase.java`

### Courier Operations

- [Order Lifecycle](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java`
- [Delivery Assignment](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java`
- [Scheduled Updates](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/ScheduledDeliveryUpdateService.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Service/ScheduledDeliveryUpdateService.java`
- [Email Notifications](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Service/EmailService.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Service/EmailService.java`

### Persistence

- [User Records](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/UserRepository.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Repository/UserRepository.java`
- [Order Records](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/OrderRepository.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Repository/OrderRepository.java`
- [Parcel Records](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/ParcelRepository.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Repository/ParcelRepository.java`
- [Assignment Records](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/DeliveryAssignmentRepository.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Repository/DeliveryAssignmentRepository.java`
- [Location Records](https://github.com/harshpatel-08/smart-courier-manager/blob/main/src/main/java/com/Harsh/Smart/Courier/Manager/Repository/LocationRepository.java): `src/main/java/com/Harsh/Smart/Courier/Manager/Repository/LocationRepository.java`

### Other components

- **API Client**
- **MySQL**
- **Gmail SMTP**

## Connections

- API Client → JWT Request Filter: sends requests (evidence: `README.md`)
- JWT Request Filter → JWT Tokens: validates tokens (evidence: `README.md`)
- JWT Request Filter → Access Configuration: uses security rules
- API Client → Authentication API: submits login (evidence: `README.md`)
- API Client → User API: registers users (evidence: `README.md`)
- API Client → Order API: manages orders (evidence: `README.md`)
- API Client → Assignment API: manages deliveries (evidence: `README.md`)
- Authentication API → Authentication: delegates login (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Controller/AuthController.java`)
- User API → User Registration: delegates registration (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Controller/UserController.java`)
- Order API → Order Lifecycle: delegates orders (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Controller/OrderController.java`)
- Assignment API → Delivery Assignment: delegates assignments (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Controller/DeliveryAssignmentController.java`)
- Authentication → User Records: looks up users (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/AuthService.java`)
- Authentication → JWT Tokens: generates token (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/AuthService.java`)
- User Registration → User Records: persists accounts
- Order Lifecycle → User Records: loads customer (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java`)
- Order Lifecycle → Location Records: loads locations (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java`)
- Order Lifecycle → Order Records: saves and queries (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java`)
- Order Lifecycle → Email Notifications: requests notification (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/OrderService.java`)
- Email Notifications → Gmail SMTP: sends mail
- Delivery Assignment → Parcel Records: loads parcels (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java`)
- Delivery Assignment → User Records: checks agents (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java`)
- Delivery Assignment → Location Records: reads locations (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java`)
- Delivery Assignment → Assignment Records: reads and updates (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/DeliveryAssignmentService.java`)
- Scheduled Updates → Assignment Records: loads in-transit records (evidence: `src/main/java/com/Harsh/Smart/Courier/Manager/Service/ScheduledDeliveryUpdateService.java`)
- Order Records → MySQL: stores entities (evidence: `README.md`)
- Assignment Records → MySQL: stores entities (evidence: `README.md`)
- User Records → MySQL: stores entities (evidence: `README.md`)
- Parcel Records → MySQL: stores entities (evidence: `README.md`)
- Location Records → MySQL: stores entities (evidence: `README.md`)
- Order API → Error Handling: returns structured errors
- Assignment API → Error Handling: returns structured errors
