# saurabhhdubey/do-it architecture

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

- Interactive diagram: https://gitdiagram.com/saurabhhdubey/do-it
- Repository: https://github.com/saurabhhdubey/do-it

## Overview

Do-It is a home-services booking platform with customer authentication, service selection, a persistent cart, and checkout, alongside vendor registration/status and admin management. The frontend route table and sampled backend routes/controllers establish much of the flow; checkout completion and several listed screens are only represented by their paths. The available README provides no usable capability detail, so unsampled behavior and frontend-to-backend wiring are kept limited or unverified.

Main entry points: [`frontend/src/main.jsx`](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/main.jsx) (App routes), [`backend/router/admin.routes.js`](https://github.com/saurabhhdubey/do-it/blob/main/backend/router/admin.routes.js) (Admin routes), [`backend/router/auth.router.js`](https://github.com/saurabhhdubey/do-it/blob/main/backend/router/auth.router.js) (Auth routes), [`backend/router/vendor.routes.js`](https://github.com/saurabhhdubey/do-it/blob/main/backend/router/vendor.routes.js) (Vendor routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_app_routes["App routes<br/>[main.jsx]"]
  node_home["Service discovery<br/>[Home.jsx]"]
  node_service_pages["Service booking pages"]
  node_cart["Booking cart<br/>[cartSlice.js]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_ui["Login and registration"]
  node_auth_api["Auth API client<br/>[authAPI.js]"]
  node_auth_state["Auth state<br/>[authSlice.js]"]
  node_auth_routes["Auth routes<br/>[auth.router.js]"]
  node_auth_controller["Auth handlers"]
  node_auth_middleware["Token verification<br/>[auth.middleware.js]"]
end

subgraph group_operations["Vendor and admin operations"]
  node_vendor_ui["Vendor screens"]
  node_vendor_api["Vendor API client<br/>[vendorAPI.js]"]
  node_vendor_routes["Vendor routes<br/>[vendor.routes.js]"]
  node_vendor_controller["Vendor handlers"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_admin_api["Admin API client<br/>[adminAPI.js]"]
  node_admin_routes["Admin routes<br/>[admin.routes.js]"]
  node_admin_controller["Admin handlers"]
  node_admin_guard["Admin authorization"]
end

subgraph group_backend_data["Backend data"]
  node_server["API server<br/>[server.js]"]
  node_user_model[("User records<br/>[user.model.js]")]
  node_vendor_model[("Vendor records<br/>[vendor.model.js]")]
end

node_visitor(("Customer"))

node_visitor -->|"opens"| node_app_routes
node_app_routes -->|"routes to"| node_home
node_app_routes -->|"routes to"| node_service_pages
node_app_routes -->|"routes to"| node_checkout
node_app_routes -->|"routes to"| node_auth_ui
node_service_pages -->|"updates"| node_cart
node_home -->|"uses"| node_vendor_api
node_auth_ui -->|"calls"| node_auth_api
node_auth_ui -->|"updates"| node_auth_state
node_auth_api -.->|"HTTP requests"| node_auth_routes
node_vendor_ui -.->|"uses"| node_vendor_api
node_vendor_api -.->|"HTTP requests"| node_vendor_routes
node_admin_ui -->|"calls"| node_admin_api
node_admin_api -.->|"HTTP requests"| node_admin_routes
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_vendor_routes
node_server -->|"mounts"| node_admin_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"protects profile"| node_auth_middleware
node_auth_controller -->|"reads and creates"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model
node_vendor_routes -->|"protects routes"| node_auth_middleware
node_vendor_routes -->|"dispatches"| node_vendor_controller
node_vendor_controller -->|"reads and creates"| node_vendor_model
node_admin_routes -->|"protects routes"| node_auth_middleware
node_admin_routes -->|"checks role"| node_admin_guard
node_admin_routes -->|"dispatches"| node_admin_controller
node_admin_controller -->|"queries and updates"| node_user_model
node_admin_controller -->|"queries and updates"| node_vendor_model

click node_app_routes "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/main.jsx"
click node_home "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/components/Home.jsx"
click node_service_pages "https://github.com/saurabhhdubey/do-it/tree/main/frontend/src/components"
click node_cart "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/redux/slices/cartSlice.js"
click node_checkout "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/components/Checkout.jsx"
click node_auth_ui "https://github.com/saurabhhdubey/do-it/tree/main/frontend/src/components"
click node_auth_api "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/api/authAPI.js"
click node_auth_state "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/redux/slices/authSlice.js"
click node_auth_routes "https://github.com/saurabhhdubey/do-it/blob/main/backend/router/auth.router.js"
click node_auth_controller "https://github.com/saurabhhdubey/do-it/blob/main/backend/controllers/auth.controllers.js"
click node_auth_middleware "https://github.com/saurabhhdubey/do-it/blob/main/backend/middleware/auth.middleware.js"
click node_vendor_api "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/api/vendorAPI.js"
click node_vendor_routes "https://github.com/saurabhhdubey/do-it/blob/main/backend/router/vendor.routes.js"
click node_vendor_controller "https://github.com/saurabhhdubey/do-it/blob/main/backend/controllers/vendor.controllers.js"
click node_admin_ui "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/components/admin/AdminDashboard.jsx"
click node_admin_api "https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/api/adminAPI.js"
click node_admin_routes "https://github.com/saurabhhdubey/do-it/blob/main/backend/router/admin.routes.js"
click node_admin_controller "https://github.com/saurabhhdubey/do-it/blob/main/backend/controllers/admin.controllers.js"
click node_admin_guard "https://github.com/saurabhhdubey/do-it/blob/main/backend/middleware/admin.middleware.js"
click node_server "https://github.com/saurabhhdubey/do-it/blob/main/backend/server.js"
click node_user_model "https://github.com/saurabhhdubey/do-it/blob/main/backend/models/user.model.js"
click node_vendor_model "https://github.com/saurabhhdubey/do-it/blob/main/backend/models/vendor.model.js"

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_routes,node_home,node_service_pages,node_cart,node_checkout toneBlue
class node_auth_ui,node_auth_api,node_auth_state,node_auth_routes,node_auth_controller,node_auth_middleware toneAmber
class node_vendor_ui,node_vendor_api,node_vendor_routes,node_vendor_controller,node_admin_ui,node_admin_api,node_admin_routes,node_admin_controller,node_admin_guard toneMint
class node_server,node_user_model,node_vendor_model toneRose
class node_visitor toneIndigo
```

## Components

### Customer experience

- [App routes](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Service discovery](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/components/Home.jsx): `frontend/src/components/Home.jsx`
- [Service booking pages](https://github.com/saurabhhdubey/do-it/tree/main/frontend/src/components): `frontend/src/components`
- [Booking cart](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/redux/slices/cartSlice.js): `frontend/src/redux/slices/cartSlice.js`
- [Checkout](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/components/Checkout.jsx): `frontend/src/components/Checkout.jsx`

### Identity and access

- [Login and registration](https://github.com/saurabhhdubey/do-it/tree/main/frontend/src/components): `frontend/src/components`
- [Auth API client](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/api/authAPI.js): `frontend/src/api/authAPI.js`
- [Auth state](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/redux/slices/authSlice.js): `frontend/src/redux/slices/authSlice.js`
- [Auth routes](https://github.com/saurabhhdubey/do-it/blob/main/backend/router/auth.router.js): `backend/router/auth.router.js`
- [Auth handlers](https://github.com/saurabhhdubey/do-it/blob/main/backend/controllers/auth.controllers.js): `backend/controllers/auth.controllers.js`
- [Token verification](https://github.com/saurabhhdubey/do-it/blob/main/backend/middleware/auth.middleware.js): `backend/middleware/auth.middleware.js`

### Vendor and admin operations

- **Vendor screens**
- [Vendor API client](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/api/vendorAPI.js): `frontend/src/api/vendorAPI.js`
- [Vendor routes](https://github.com/saurabhhdubey/do-it/blob/main/backend/router/vendor.routes.js): `backend/router/vendor.routes.js`
- [Vendor handlers](https://github.com/saurabhhdubey/do-it/blob/main/backend/controllers/vendor.controllers.js): `backend/controllers/vendor.controllers.js`
- [Admin dashboard](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/components/admin/AdminDashboard.jsx): `frontend/src/components/admin/AdminDashboard.jsx`
- [Admin API client](https://github.com/saurabhhdubey/do-it/blob/main/frontend/src/api/adminAPI.js): `frontend/src/api/adminAPI.js`
- [Admin routes](https://github.com/saurabhhdubey/do-it/blob/main/backend/router/admin.routes.js): `backend/router/admin.routes.js`
- [Admin handlers](https://github.com/saurabhhdubey/do-it/blob/main/backend/controllers/admin.controllers.js): `backend/controllers/admin.controllers.js`
- [Admin authorization](https://github.com/saurabhhdubey/do-it/blob/main/backend/middleware/admin.middleware.js): `backend/middleware/admin.middleware.js`

### Backend data

- [API server](https://github.com/saurabhhdubey/do-it/blob/main/backend/server.js): `backend/server.js`
- [User records](https://github.com/saurabhhdubey/do-it/blob/main/backend/models/user.model.js): `backend/models/user.model.js`
- [Vendor records](https://github.com/saurabhhdubey/do-it/blob/main/backend/models/vendor.model.js): `backend/models/vendor.model.js`

### Other components

- **Customer**

## Connections

- Customer → App routes: opens (evidence: `frontend/src/main.jsx`)
- App routes → Service discovery: routes to (evidence: `frontend/src/main.jsx`)
- App routes → Service booking pages: routes to (evidence: `frontend/src/main.jsx`)
- App routes → Checkout: routes to (evidence: `frontend/src/main.jsx`)
- App routes → Login and registration: routes to (evidence: `frontend/src/main.jsx`)
- Service booking pages → Booking cart: updates (evidence: `frontend/src/components/AcRepair.jsx`)
- Service discovery → Vendor API client: uses (evidence: `frontend/src/components/Home.jsx`)
- Login and registration → Auth API client: calls (evidence: `frontend/src/components/Login.jsx`)
- Login and registration → Auth state: updates (evidence: `frontend/src/components/Login.jsx`)
- Auth API client → Auth routes: HTTP requests
- Vendor screens → Vendor API client: uses
- Vendor API client → Vendor routes: HTTP requests
- Admin dashboard → Admin API client: calls (evidence: `frontend/src/components/admin/AdminDashboard.jsx`)
- Admin API client → Admin routes: HTTP requests
- API server → Auth routes: mounts (evidence: `backend/server.js`)
- API server → Vendor routes: mounts (evidence: `backend/server.js`)
- API server → Admin routes: mounts (evidence: `backend/server.js`)
- Auth routes → Auth handlers: dispatches (evidence: `backend/router/auth.router.js`)
- Auth routes → Token verification: protects profile (evidence: `backend/router/auth.router.js`)
- Auth handlers → User records: reads and creates (evidence: `backend/controllers/auth.controllers.js`)
- Token verification → User records: loads user (evidence: `backend/middleware/auth.middleware.js`)
- Vendor routes → Token verification: protects routes (evidence: `backend/router/vendor.routes.js`)
- Vendor routes → Vendor handlers: dispatches (evidence: `backend/router/vendor.routes.js`)
- Vendor handlers → Vendor records: reads and creates (evidence: `backend/controllers/vendor.controllers.js`)
- Admin routes → Token verification: protects routes (evidence: `backend/router/admin.routes.js`)
- Admin routes → Admin authorization: checks role (evidence: `backend/router/admin.routes.js`)
- Admin routes → Admin handlers: dispatches (evidence: `backend/router/admin.routes.js`)
- Admin handlers → User records: queries and updates (evidence: `backend/controllers/admin.controllers.js`)
- Admin handlers → Vendor records: queries and updates (evidence: `backend/controllers/admin.controllers.js`)
