# iuh20002975/laptop_store architecture

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

- Interactive diagram: https://gitdiagram.com/iuh20002975/laptop_store
- Repository: https://github.com/iuh20002975/laptop_store

## Overview

Laptop Store is an Express/EJS storefront with an admin area for managing products and users, plus a dashboard and order page. The customer workflow loads product data for the home page and product details; admin controllers handle product and user operations through services backed by Prisma. The route module is registered by the app, but its dispatch wiring was not sampled, so route-to-controller links are omitted. The order page is visible in the tree, but no order-processing implementation is evidenced.

Main entry points: [`src/config/client.ts`](https://github.com/iuh20002975/laptop_store/blob/main/src/config/client.ts) (Prisma client), [`src/services/client/item.service.ts`](https://github.com/iuh20002975/laptop_store/blob/main/src/services/client/item.service.ts) (Storefront product service), [`src/controllers/admin/dashboard.controller.ts`](https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/admin/dashboard.controller.ts) (Admin dashboard controller), [`src/controllers/admin/product.controller.ts`](https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/admin/product.controller.ts) (Admin product controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_app["Express app<br/>[app.ts]"]
  node_routes["Web routes<br/>[web.ts]"]
end

subgraph group_storefront["Customer storefront"]
  node_client_controller["Home controller<br/>[user.controller.ts]"]
  node_client_product_controller["Product detail controller"]
  node_client_service["Storefront product service<br/>[item.service.ts]"]
  node_home_view["Storefront home<br/>[show.ejs]"]
  node_detail_view["Product detail view<br/>[detail.ejs]"]
  node_client_assets["Storefront assets"]
end

subgraph group_admin["Administration"]
  node_dashboard_controller["Admin dashboard controller"]
  node_product_controller["Admin product controller"]
  node_user_controller["User controller<br/>[user.controller.ts]"]
  node_product_validation["Product validation<br/>[product.schema.ts]"]
  node_admin_product_service["Admin product service<br/>[product.service.ts]"]
  node_user_service["User service<br/>[user.service.ts]"]
  node_dashboard_view["Dashboard view<br/>[show.ejs]"]
  node_admin_product_view["Admin product views"]
  node_admin_user_view["Admin user views"]
  node_order_view["Order page<br/>[show.ejs]"]
end

subgraph group_data["Persistence"]
  node_prisma_client["Prisma client<br/>[client.ts]"]
  node_schema["Data model<br/>[schema.prisma]"]
  node_database[("MySQL database")]
end

node_visitor(("Shopper"))
node_staff(("Admin user"))

node_app -->|"registers"| node_routes
node_app -->|"serves static"| node_client_assets
node_client_controller -->|"loads products"| node_client_service
node_client_product_controller -->|"loads product"| node_client_service
node_client_controller -->|"renders"| node_home_view
node_client_product_controller -->|"renders"| node_detail_view
node_client_service -->|"queries"| node_prisma_client
node_product_controller -->|"validates"| node_product_validation
node_product_controller -->|"manages products"| node_admin_product_service
node_product_controller -->|"renders"| node_admin_product_view
node_dashboard_controller -->|"loads products"| node_admin_product_service
node_dashboard_controller -->|"loads users"| node_user_service
node_dashboard_controller -->|"renders"| node_dashboard_view
node_user_controller -->|"manages users"| node_user_service
node_user_controller -->|"loads products"| node_client_service
node_user_controller -->|"renders"| node_admin_user_view
node_admin_product_service -->|"queries and writes"| node_prisma_client
node_user_service -->|"queries and writes"| node_prisma_client
node_prisma_client -->|"accesses"| node_database
node_schema -->|"defines data model"| node_prisma_client
node_visitor -->|"requests pages"| node_routes
node_staff -->|"requests admin"| node_routes

click node_app "https://github.com/iuh20002975/laptop_store/blob/main/src/app.ts"
click node_routes "https://github.com/iuh20002975/laptop_store/blob/main/src/routes/web.ts"
click node_client_controller "https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/user.controller.ts"
click node_client_product_controller "https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/client/product.controller.ts"
click node_client_service "https://github.com/iuh20002975/laptop_store/blob/main/src/services/client/item.service.ts"
click node_home_view "https://github.com/iuh20002975/laptop_store/blob/main/src/views/client/home/show.ejs"
click node_detail_view "https://github.com/iuh20002975/laptop_store/blob/main/src/views/client/product/detail.ejs"
click node_client_assets "https://github.com/iuh20002975/laptop_store/tree/main/public/client"
click node_dashboard_controller "https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/admin/dashboard.controller.ts"
click node_product_controller "https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/admin/product.controller.ts"
click node_user_controller "https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/user.controller.ts"
click node_product_validation "https://github.com/iuh20002975/laptop_store/blob/main/src/validation/product.schema.ts"
click node_admin_product_service "https://github.com/iuh20002975/laptop_store/blob/main/src/services/admin/product.service.ts"
click node_user_service "https://github.com/iuh20002975/laptop_store/blob/main/src/services/user.service.ts"
click node_dashboard_view "https://github.com/iuh20002975/laptop_store/blob/main/src/views/admin/dashboard/show.ejs"
click node_admin_product_view "https://github.com/iuh20002975/laptop_store/tree/main/src/views/admin/product"
click node_admin_user_view "https://github.com/iuh20002975/laptop_store/tree/main/src/views/admin/user"
click node_order_view "https://github.com/iuh20002975/laptop_store/blob/main/src/views/admin/order/show.ejs"
click node_prisma_client "https://github.com/iuh20002975/laptop_store/blob/main/src/config/client.ts"
click node_schema "https://github.com/iuh20002975/laptop_store/blob/main/prisma/schema.prisma"

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,node_routes,node_staff toneBlue
class node_client_controller,node_client_product_controller,node_client_service,node_home_view,node_detail_view,node_client_assets toneAmber
class node_dashboard_controller,node_product_controller,node_user_controller,node_product_validation,node_admin_product_service,node_user_service,node_dashboard_view,node_admin_product_view,node_admin_user_view,node_order_view toneMint
class node_prisma_client,node_schema,node_database toneRose
class node_visitor toneIndigo
```

## Components

### Application runtime

- [Express app](https://github.com/iuh20002975/laptop_store/blob/main/src/app.ts): `src/app.ts`
- [Web routes](https://github.com/iuh20002975/laptop_store/blob/main/src/routes/web.ts): `src/routes/web.ts`

### Customer storefront

- [Home controller](https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/user.controller.ts): `src/controllers/user.controller.ts`
- [Product detail controller](https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/client/product.controller.ts): `src/controllers/client/product.controller.ts`
- [Storefront product service](https://github.com/iuh20002975/laptop_store/blob/main/src/services/client/item.service.ts): `src/services/client/item.service.ts`
- [Storefront home](https://github.com/iuh20002975/laptop_store/blob/main/src/views/client/home/show.ejs): `src/views/client/home/show.ejs`
- [Product detail view](https://github.com/iuh20002975/laptop_store/blob/main/src/views/client/product/detail.ejs): `src/views/client/product/detail.ejs`
- [Storefront assets](https://github.com/iuh20002975/laptop_store/tree/main/public/client): `public/client`

### Administration

- [Admin dashboard controller](https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/admin/dashboard.controller.ts): `src/controllers/admin/dashboard.controller.ts`
- [Admin product controller](https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/admin/product.controller.ts): `src/controllers/admin/product.controller.ts`
- [User controller](https://github.com/iuh20002975/laptop_store/blob/main/src/controllers/user.controller.ts): `src/controllers/user.controller.ts`
- [Product validation](https://github.com/iuh20002975/laptop_store/blob/main/src/validation/product.schema.ts): `src/validation/product.schema.ts`
- [Admin product service](https://github.com/iuh20002975/laptop_store/blob/main/src/services/admin/product.service.ts): `src/services/admin/product.service.ts`
- [User service](https://github.com/iuh20002975/laptop_store/blob/main/src/services/user.service.ts): `src/services/user.service.ts`
- [Dashboard view](https://github.com/iuh20002975/laptop_store/blob/main/src/views/admin/dashboard/show.ejs): `src/views/admin/dashboard/show.ejs`
- [Admin product views](https://github.com/iuh20002975/laptop_store/tree/main/src/views/admin/product): `src/views/admin/product`
- [Admin user views](https://github.com/iuh20002975/laptop_store/tree/main/src/views/admin/user): `src/views/admin/user`
- [Order page](https://github.com/iuh20002975/laptop_store/blob/main/src/views/admin/order/show.ejs): `src/views/admin/order/show.ejs`

### Persistence

- [Prisma client](https://github.com/iuh20002975/laptop_store/blob/main/src/config/client.ts): `src/config/client.ts`
- [Data model](https://github.com/iuh20002975/laptop_store/blob/main/prisma/schema.prisma): `prisma/schema.prisma`
- **MySQL database**

### Other components

- **Shopper**
- **Admin user**

## Connections

- Express app → Web routes: registers
- Express app → Storefront assets: serves static
- Home controller → Storefront product service: loads products
- Product detail controller → Storefront product service: loads product
- Home controller → Storefront home: renders
- Product detail controller → Product detail view: renders
- Storefront product service → Prisma client: queries
- Admin product controller → Product validation: validates
- Admin product controller → Admin product service: manages products
- Admin product controller → Admin product views: renders
- Admin dashboard controller → Admin product service: loads products
- Admin dashboard controller → User service: loads users
- Admin dashboard controller → Dashboard view: renders
- User controller → User service: manages users
- User controller → Storefront product service: loads products
- User controller → Admin user views: renders
- Admin product service → Prisma client: queries and writes
- User service → Prisma client: queries and writes
- Prisma client → MySQL database: accesses
- Data model → Prisma client: defines data model
- Shopper → Web routes: requests pages
- Admin user → Web routes: requests admin
