# mukeshkumar9787/dams architecture

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

- Interactive diagram: https://gitdiagram.com/mukeshkumar9787/dams
- Repository: https://github.com/mukeshkumar9787/dams

## Overview

DAMS is a full-stack commerce application: customers browse a catalog, manage carts and wishlists, authenticate, and place and track orders; administrators manage catalog data, orders, users, configuration, and audit activity. The graph connects the Next.js experience to the Express API, then shows the API’s routing, service, and persistence layers, plus documented payment, email, and object-storage integrations. Several backend domains are represented by their exact tree paths but were not sampled, so their internal call relationships are not inferred.

Main entry points: [`web_client/src/http/apiCalls.js`](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/http/apiCalls.js) (API client), [`server/routes/index.js`](https://github.com/mukeshkumar9787/dams/blob/master/server/routes/index.js) (API routes), [`server/prisma/client.js`](https://github.com/mukeshkumar9787/dams/blob/master/server/prisma/client.js) (PostgreSQL), [`server/services/auth.js`](https://github.com/mukeshkumar9787/dams/blob/master/server/services/auth.js) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_shop["Browse catalog<br/>[index.tsx]"]
  node_product_detail["Product details<br/>[index.tsx]"]
  node_cart_ui["Cart and wishlist<br/>[index.tsx]"]
  node_checkout_ui["Checkout<br/>[index.tsx]"]
  node_account_ui["Account and orders<br/>[index.tsx]"]
end

subgraph group_identity["Identity"]
  node_auth_ui["Sign-in and signup<br/>[index.tsx]"]
  node_auth_controller["Auth controller<br/>[auth.js]"]
  node_auth_service["Authentication<br/>[auth.js]"]
end

subgraph group_commerce["Commerce API"]
  node_catalog["Catalog services<br/>[products.js]"]
  node_cart_orders["Cart and orders<br/>[orders.js]"]
  node_payment["Payment service<br/>[payment.js]"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin console<br/>[index.tsx]"]
  node_admin_services["Admin domains<br/>[dashboard.js]"]
  node_audit["Audit logging"]
end

subgraph group_platform["Platform"]
  node_api_client["API client<br/>[apiCalls.js]"]
  node_api["Express API<br/>[index.js]"]
  node_routes["API routes<br/>[index.js]"]
  node_files["File management<br/>[files.js]"]
  node_database[("PostgreSQL<br/>[client.js]")]
end

node_customer(("Customer"))
node_razorpay["Razorpay"]
node_smtp["SMTP email"]
node_object_storage["R2 storage"]
node_google["Google sign-in"]

node_customer -->|"browses"| node_shop
node_shop -->|"requests catalog"| node_api_client
node_product_detail -->|"loads product"| node_api_client
node_cart_ui -->|"syncs cart"| node_api_client
node_customer -->|"signs in"| node_auth_ui
node_auth_ui -->|"submits credentials"| node_api_client
node_customer -->|"checks out"| node_checkout_ui
node_checkout_ui -->|"places order"| node_api_client
node_customer -->|"views history"| node_account_ui
node_account_ui -->|"requests orders"| node_api_client
node_admin_ui -->|"manages records"| node_api_client
node_api_client -->|"calls API"| node_api
node_api -->|"mounts routes"| node_routes
node_routes -->|"routes auth"| node_auth_controller
node_auth_controller -->|"delegates auth"| node_auth_service
node_routes -->|"applies logging"| node_audit
node_routes -->|"routes catalog"| node_catalog
node_routes -.->|"routes orders"| node_cart_orders
node_routes -.->|"routes admin"| node_admin_services
node_auth_service -->|"reads and writes"| node_database
node_catalog -->|"reads and writes"| node_database
node_cart_orders -.->|"persists commerce"| node_database
node_cart_orders -.->|"handles payment"| node_payment
node_payment -->|"verifies payment"| node_razorpay
node_auth_service -->|"sends OTP"| node_smtp
node_auth_service -->|"verifies token"| node_google
node_admin_services -.->|"reads and writes"| node_database
node_audit -->|"records activity"| node_database
node_files -->|"stores uploads"| node_object_storage
node_files -.->|"tracks file records"| node_database

click node_shop "https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/ShopWithSidebar/index.tsx"
click node_product_detail "https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/ShopDetails/index.tsx"
click node_cart_ui "https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/Cart/index.tsx"
click node_checkout_ui "https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/Checkout/index.tsx"
click node_account_ui "https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/MyAccount/index.tsx"
click node_auth_ui "https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/Auth/Signin/index.tsx"
click node_api_client "https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/http/apiCalls.js"
click node_api "https://github.com/mukeshkumar9787/dams/blob/master/server/index.js"
click node_routes "https://github.com/mukeshkumar9787/dams/blob/master/server/routes/index.js"
click node_auth_controller "https://github.com/mukeshkumar9787/dams/blob/master/server/controllers/auth.js"
click node_auth_service "https://github.com/mukeshkumar9787/dams/blob/master/server/services/auth.js"
click node_catalog "https://github.com/mukeshkumar9787/dams/blob/master/server/services/products.js"
click node_cart_orders "https://github.com/mukeshkumar9787/dams/blob/master/server/services/orders.js"
click node_payment "https://github.com/mukeshkumar9787/dams/blob/master/server/services/payment.js"
click node_admin_ui "https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/AdminDesktopShell/index.tsx"
click node_admin_services "https://github.com/mukeshkumar9787/dams/blob/master/server/services/dashboard.js"
click node_audit "https://github.com/mukeshkumar9787/dams/blob/master/server/middlewares/auditLogMiddleware.js"
click node_files "https://github.com/mukeshkumar9787/dams/blob/master/server/services/files.js"
click node_database "https://github.com/mukeshkumar9787/dams/blob/master/server/prisma/client.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_shop,node_product_detail,node_cart_ui,node_checkout_ui,node_account_ui toneBlue
class node_auth_ui,node_auth_controller,node_auth_service,node_object_storage toneAmber
class node_catalog,node_cart_orders,node_payment toneMint
class node_admin_ui,node_admin_services,node_audit toneRose
class node_api_client,node_api,node_routes,node_files,node_database,node_customer,node_razorpay,node_smtp,node_google toneIndigo
```

## Components

### Storefront

- [Browse catalog](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/ShopWithSidebar/index.tsx): `web_client/src/components/ShopWithSidebar/index.tsx`
- [Product details](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/ShopDetails/index.tsx): `web_client/src/components/ShopDetails/index.tsx`
- [Cart and wishlist](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/Cart/index.tsx): `web_client/src/components/Cart/index.tsx`
- [Checkout](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/Checkout/index.tsx): `web_client/src/components/Checkout/index.tsx`
- [Account and orders](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/MyAccount/index.tsx): `web_client/src/components/MyAccount/index.tsx`

### Identity

- [Sign-in and signup](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/Auth/Signin/index.tsx): `web_client/src/components/Auth/Signin/index.tsx`
- [Auth controller](https://github.com/mukeshkumar9787/dams/blob/master/server/controllers/auth.js): `server/controllers/auth.js`
- [Authentication](https://github.com/mukeshkumar9787/dams/blob/master/server/services/auth.js): `server/services/auth.js`

### Commerce API

- [Catalog services](https://github.com/mukeshkumar9787/dams/blob/master/server/services/products.js): `server/services/products.js`
- [Cart and orders](https://github.com/mukeshkumar9787/dams/blob/master/server/services/orders.js): `server/services/orders.js`
- [Payment service](https://github.com/mukeshkumar9787/dams/blob/master/server/services/payment.js): `server/services/payment.js`

### Administration

- [Admin console](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/components/AdminDesktopShell/index.tsx): `web_client/src/components/AdminDesktopShell/index.tsx`
- [Admin domains](https://github.com/mukeshkumar9787/dams/blob/master/server/services/dashboard.js): `server/services/dashboard.js`
- [Audit logging](https://github.com/mukeshkumar9787/dams/blob/master/server/middlewares/auditLogMiddleware.js): `server/middlewares/auditLogMiddleware.js`

### Platform

- [API client](https://github.com/mukeshkumar9787/dams/blob/master/web_client/src/http/apiCalls.js): `web_client/src/http/apiCalls.js`
- [Express API](https://github.com/mukeshkumar9787/dams/blob/master/server/index.js): `server/index.js`
- [API routes](https://github.com/mukeshkumar9787/dams/blob/master/server/routes/index.js): `server/routes/index.js`
- [File management](https://github.com/mukeshkumar9787/dams/blob/master/server/services/files.js): `server/services/files.js`
- [PostgreSQL](https://github.com/mukeshkumar9787/dams/blob/master/server/prisma/client.js): `server/prisma/client.js`

### Other components

- **Customer**
- **Razorpay**
- **SMTP email**
- **R2 storage**
- **Google sign-in**

## Connections

- Customer → Browse catalog: browses (evidence: `README.md`)
- Browse catalog → API client: requests catalog (evidence: `README.md`)
- Product details → API client: loads product (evidence: `README.md`)
- Cart and wishlist → API client: syncs cart (evidence: `README.md`)
- Customer → Sign-in and signup: signs in (evidence: `README.md`)
- Sign-in and signup → API client: submits credentials (evidence: `README.md`)
- Customer → Checkout: checks out (evidence: `README.md`)
- Checkout → API client: places order (evidence: `README.md`)
- Customer → Account and orders: views history (evidence: `README.md`)
- Account and orders → API client: requests orders (evidence: `README.md`)
- Admin console → API client: manages records (evidence: `README.md`)
- API client → Express API: calls API (evidence: `README.md`)
- Express API → API routes: mounts routes (evidence: `server/index.js`)
- API routes → Auth controller: routes auth
- Auth controller → Authentication: delegates auth (evidence: `server/controllers/auth.js`)
- API routes → Audit logging: applies logging (evidence: `server/routes/index.js`)
- API routes → Catalog services: routes catalog (evidence: `server/routes/index.js`)
- API routes → Cart and orders: routes orders
- API routes → Admin domains: routes admin
- Authentication → PostgreSQL: reads and writes (evidence: `server/services/auth.js`)
- Catalog services → PostgreSQL: reads and writes (evidence: `server/services/products.js`)
- Cart and orders → PostgreSQL: persists commerce
- Cart and orders → Payment service: handles payment
- Payment service → Razorpay: verifies payment (evidence: `README.md`)
- Authentication → SMTP email: sends OTP (evidence: `server/services/auth.js`)
- Authentication → Google sign-in: verifies token (evidence: `server/services/auth.js`)
- Admin domains → PostgreSQL: reads and writes
- Audit logging → PostgreSQL: records activity (evidence: `server/middlewares/auditLogMiddleware.js`)
- File management → R2 storage: stores uploads (evidence: `README.md`)
- File management → PostgreSQL: tracks file records
