# mahmudulhasanmaruf78/smart-pick architecture

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

- Interactive diagram: https://gitdiagram.com/mahmudulhasanmaruf78/smart-pick
- Repository: https://github.com/mahmudulhasanmaruf78/smart-pick

## Overview

Smart Pick & Drop is a delivery-management REST API. Customers and riders register or sign in, customers book and track consignments, verified riders claim and progress deliveries, and admins manage rider verification, users, zones, and system metrics. The map separates identity, user profiles, zone rates, order operations, and administration, with a shared persistence layer. README documents capabilities beyond the sampled excerpts; edges are limited to relationships shown in source or explicitly described there.

Main entry points: [`src/auth/auth.service.ts`](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/auth/auth.service.ts) (Registration and Login), [`src/orders/orders.service.ts`](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/orders/orders.service.ts) (Booking and Delivery Lifecycle), [`src/admin/admin.service.ts`](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/admin/admin.service.ts) (Metrics and Rider Verification), [`src/users/users.service.ts`](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/users/users.service.ts) (User and Rider Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and Access"]
  node_auth_api["Authentication API<br/>[auth.controller.ts]"]
  node_auth_service["Registration and Login<br/>[auth.service.ts]"]
  node_access["JWT and Role Guards"]
end

subgraph group_accounts["User Accounts"]
  node_user_api["Profile API"]
  node_user_service["User and Rider Records<br/>[users.service.ts]"]
  node_account_store[("Account Data")]
end

subgraph group_zones["Zones and Rates"]
  node_zone_api["Zone API"]
  node_zone_service["Zone Rates and Seeding<br/>[zones.service.ts]"]
  node_zone_store[("Delivery Zones")]
end

subgraph group_delivery["Delivery Operations"]
  node_orders_api["Orders API"]
  node_orders_service["Booking and Delivery Lifecycle<br/>[orders.service.ts]"]
  node_order_store[("Consignment Records<br/>[order.entity.ts]")]
  node_mailer["Email Service"]
end

subgraph group_admin["Administration"]
  node_admin_api["Admin API"]
  node_admin_service["Metrics and Rider Verification<br/>[admin.service.ts]"]
end

node_customer_rider(("Customer or Rider"))
node_admin_actor(("Administrator"))
node_platform_store[("Platform Database")]

node_customer_rider -->|"registers or signs in"| node_auth_api
node_auth_api -->|"delegates"| node_auth_service
node_auth_service -->|"looks up and creates users"| node_user_service
node_auth_service -->|"returns access token"| node_customer_rider
node_customer_rider -->|"manages profile"| node_user_api
node_user_api -->|"delegates"| node_user_service
node_admin_actor -->|"manages platform"| node_admin_api
node_admin_api -->|"delegates"| node_admin_service
node_customer_rider -->|"views zones"| node_zone_api
node_admin_actor -->|"manages rates"| node_zone_api
node_zone_api -->|"delegates"| node_zone_service
node_customer_rider -->|"books or tracks delivery"| node_orders_api
node_orders_api -->|"delegates"| node_orders_service
node_orders_service -->|"uses zone rates"| node_zone_service
node_orders_service -->|"notifies by email"| node_customer_rider
node_admin_service -->|"verifies or suspends"| node_customer_rider
node_auth_service -->|"persists identities"| node_platform_store
node_user_service -->|"reads and writes accounts"| node_platform_store
node_orders_service -->|"reads and writes orders"| node_platform_store
node_zone_service -.->|"stores rate cards"| node_platform_store
node_admin_service -.->|"queries system records"| node_platform_store

click node_auth_api "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/auth/auth.controller.ts"
click node_auth_service "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/auth/auth.service.ts"
click node_access "https://github.com/mahmudulhasanmaruf78/smart-pick/tree/main/src/common/guards"
click node_user_api "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/users/users.controller.ts"
click node_user_service "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/users/users.service.ts"
click node_account_store "https://github.com/mahmudulhasanmaruf78/smart-pick/tree/main/src/users/entities"
click node_zone_api "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/zones/zones.controller.ts"
click node_zone_service "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/zones/zones.service.ts"
click node_zone_store "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/zones/entities/delivery-zone.entity.ts"
click node_orders_api "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/orders/orders.controller.ts"
click node_orders_service "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/orders/orders.service.ts"
click node_order_store "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/orders/entities/order.entity.ts"
click node_admin_api "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/admin/admin.controller.ts"
click node_admin_service "https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/admin/admin.service.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_auth_api,node_auth_service,node_access toneBlue
class node_user_api,node_user_service,node_account_store,node_platform_store toneAmber
class node_zone_api,node_zone_service,node_zone_store toneMint
class node_orders_api,node_orders_service,node_order_store,node_mailer toneRose
class node_admin_api,node_admin_service,node_customer_rider,node_admin_actor toneIndigo
```

## Components

### Identity and Access

- [Authentication API](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/auth/auth.controller.ts): `src/auth/auth.controller.ts`
- [Registration and Login](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`
- [JWT and Role Guards](https://github.com/mahmudulhasanmaruf78/smart-pick/tree/main/src/common/guards): `src/common/guards`

### User Accounts

- [Profile API](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/users/users.controller.ts): `src/users/users.controller.ts`
- [User and Rider Records](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/users/users.service.ts): `src/users/users.service.ts`
- [Account Data](https://github.com/mahmudulhasanmaruf78/smart-pick/tree/main/src/users/entities): `src/users/entities`

### Zones and Rates

- [Zone API](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/zones/zones.controller.ts): `src/zones/zones.controller.ts`
- [Zone Rates and Seeding](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/zones/zones.service.ts): `src/zones/zones.service.ts`
- [Delivery Zones](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/zones/entities/delivery-zone.entity.ts): `src/zones/entities/delivery-zone.entity.ts`

### Delivery Operations

- [Orders API](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/orders/orders.controller.ts): `src/orders/orders.controller.ts`
- [Booking and Delivery Lifecycle](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/orders/orders.service.ts): `src/orders/orders.service.ts`
- [Consignment Records](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/orders/entities/order.entity.ts): `src/orders/entities/order.entity.ts`
- **Email Service**

### Administration

- [Admin API](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/admin/admin.controller.ts): `src/admin/admin.controller.ts`
- [Metrics and Rider Verification](https://github.com/mahmudulhasanmaruf78/smart-pick/blob/main/src/admin/admin.service.ts): `src/admin/admin.service.ts`

### Other components

- **Customer or Rider**
- **Administrator**
- **Platform Database**

## Connections

- Customer or Rider → Authentication API: registers or signs in (evidence: `README.md`)
- Authentication API → Registration and Login: delegates (evidence: `src/auth/auth.controller.ts`)
- Registration and Login → User and Rider Records: looks up and creates users (evidence: `src/auth/auth.service.ts`)
- Registration and Login → Customer or Rider: returns access token (evidence: `src/auth/auth.service.ts`)
- Customer or Rider → Profile API: manages profile (evidence: `README.md`)
- Profile API → User and Rider Records: delegates (evidence: `src/users/users.controller.ts`)
- Administrator → Admin API: manages platform (evidence: `README.md`)
- Admin API → Metrics and Rider Verification: delegates (evidence: `src/admin/admin.controller.ts`)
- Customer or Rider → Zone API: views zones (evidence: `README.md`)
- Administrator → Zone API: manages rates (evidence: `README.md`)
- Zone API → Zone Rates and Seeding: delegates (evidence: `src/zones/zones.controller.ts`)
- Customer or Rider → Orders API: books or tracks delivery (evidence: `README.md`)
- Orders API → Booking and Delivery Lifecycle: delegates (evidence: `src/orders/orders.controller.ts`)
- Booking and Delivery Lifecycle → Zone Rates and Seeding: uses zone rates (evidence: `README.md`)
- Booking and Delivery Lifecycle → Customer or Rider: notifies by email (evidence: `src/orders/orders.service.ts`)
- Metrics and Rider Verification → Customer or Rider: verifies or suspends (evidence: `README.md`)
- Registration and Login → Platform Database: persists identities (evidence: `src/auth/auth.service.ts`)
- User and Rider Records → Platform Database: reads and writes accounts (evidence: `src/users/users.service.ts`)
- Booking and Delivery Lifecycle → Platform Database: reads and writes orders (evidence: `src/orders/orders.service.ts`)
- Zone Rates and Seeding → Platform Database: stores rate cards
- Metrics and Rider Verification → Platform Database: queries system records
