# shaileshps21/lookbook-project architecture

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

- Interactive diagram: https://gitdiagram.com/shaileshps21/lookbook-project
- Repository: https://github.com/shaileshps21/lookbook-project

## Overview

LookBook is a full-stack book marketplace for renting, buying, and selling books, with account, reading, and community features. The principal flow is a reader browsing the frontend, using its routed pages to interact with the REST API, and receiving catalog or order results backed by MongoDB. Authentication, reviews, listings, administration, and background jobs are meaningful branches. The README documents the frontend/API boundary and product capabilities; source excerpts confirm app routing, admin routes, order handling, and worker startup, but many individual routes and handlers were not sampled.

Main entry points: [`lookbook-backend/src/app.ts`](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/app.ts) (Express app), [`lookbook-backend/src/controllers/orderController.ts`](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/orderController.ts) (Checkout and orders), [`lookbook-backend/src/server.ts`](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/server.ts) (API server), [`lookbook-backend/src/controllers/adminController.ts`](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/adminController.ts) (Marketplace administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["Web application<br/>[App.tsx]"]
  node_routes["Page routes<br/>[AppRoutes.tsx]"]
  node_api_client["API client<br/>[apiClient.ts]"]
end

subgraph group_api["REST API"]
  node_express_app["Express app<br/>[app.ts]"]
  node_route_index["API route index<br/>[index.ts]"]
  node_auth_routes["Authentication routes<br/>[authRoutes.ts]"]
  node_admin_routes["Admin routes<br/>[adminRoutes.ts]"]
end

subgraph group_domain["Marketplace and community"]
  node_orders["Checkout and orders<br/>[orderController.ts]"]
  node_reviews["Book reviews"]
  node_assistant["AI assistant"]
  node_admin["Marketplace administration<br/>[adminController.ts]"]
end

subgraph group_runtime["Persistence and jobs"]
  node_catalog[("Book catalog model<br/>[Book.ts]")]
  node_order_store[("Order model<br/>[Order.ts]")]
  node_user_store[("User model<br/>[User.ts]")]
  node_server["API server<br/>[server.ts]"]
  node_job_workers["Background workers"]
end

node_reader(("Reader or seller"))
node_mongodb[("MongoDB")]
node_redis["Redis queue service"]

node_reader -->|"uses"| node_app
node_app -->|"renders"| node_routes
node_routes -.->|"uses API"| node_api_client
node_api_client -->|"HTTP requests"| node_express_app
node_express_app -->|"mounts routes"| node_route_index
node_admin_routes -->|"dispatches"| node_admin
node_admin_routes -->|"protects admin"| node_auth_routes
node_orders -->|"reads and writes"| node_order_store
node_orders -->|"updates stock"| node_catalog
node_orders -->|"reads user"| node_user_store
node_reviews -->|"updates ratings"| node_catalog
node_reviews -->|"verifies purchases"| node_order_store
node_admin -->|"manages orders"| node_order_store
node_admin -->|"manages books"| node_catalog
node_server -->|"starts"| node_express_app
node_server -->|"connects"| node_mongodb
node_server -->|"starts workers"| node_job_workers
node_job_workers -.->|"queues jobs"| node_redis
node_express_app -->|"persists data"| node_mongodb

click node_app "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-frontend/src/App.tsx"
click node_routes "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-frontend/src/routes/AppRoutes.tsx"
click node_api_client "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-frontend/src/services/apiClient.ts"
click node_express_app "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/app.ts"
click node_route_index "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/routes/index.ts"
click node_auth_routes "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/routes/authRoutes.ts"
click node_admin_routes "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/routes/adminRoutes.ts"
click node_orders "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/orderController.ts"
click node_reviews "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/reviewController.ts"
click node_assistant "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/assistantController.ts"
click node_admin "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/adminController.ts"
click node_catalog "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/models/Book.ts"
click node_order_store "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/models/Order.ts"
click node_user_store "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/models/User.ts"
click node_server "https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/server.ts"
click node_job_workers "https://github.com/shaileshps21/lookbook-project/tree/main/lookbook-backend/src/queues"

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_api_client toneBlue
class node_express_app,node_route_index,node_auth_routes,node_admin_routes,node_mongodb,node_redis toneAmber
class node_orders,node_reviews,node_assistant,node_admin toneMint
class node_catalog,node_order_store,node_user_store,node_server,node_job_workers toneRose
class node_reader toneIndigo
```

## Components

### Frontend experience

- [Web application](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-frontend/src/App.tsx): `lookbook-frontend/src/App.tsx`
- [Page routes](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-frontend/src/routes/AppRoutes.tsx): `lookbook-frontend/src/routes/AppRoutes.tsx`
- [API client](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-frontend/src/services/apiClient.ts): `lookbook-frontend/src/services/apiClient.ts`

### REST API

- [Express app](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/app.ts): `lookbook-backend/src/app.ts`
- [API route index](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/routes/index.ts): `lookbook-backend/src/routes/index.ts`
- [Authentication routes](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/routes/authRoutes.ts): `lookbook-backend/src/routes/authRoutes.ts`
- [Admin routes](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/routes/adminRoutes.ts): `lookbook-backend/src/routes/adminRoutes.ts`

### Marketplace and community

- [Checkout and orders](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/orderController.ts): `lookbook-backend/src/controllers/orderController.ts`
- [Book reviews](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/reviewController.ts): `lookbook-backend/src/controllers/reviewController.ts`
- [AI assistant](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/assistantController.ts): `lookbook-backend/src/controllers/assistantController.ts`
- [Marketplace administration](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/controllers/adminController.ts): `lookbook-backend/src/controllers/adminController.ts`

### Persistence and jobs

- [Book catalog model](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/models/Book.ts): `lookbook-backend/src/models/Book.ts`
- [Order model](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/models/Order.ts): `lookbook-backend/src/models/Order.ts`
- [User model](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/models/User.ts): `lookbook-backend/src/models/User.ts`
- [API server](https://github.com/shaileshps21/lookbook-project/blob/main/lookbook-backend/src/server.ts): `lookbook-backend/src/server.ts`
- [Background workers](https://github.com/shaileshps21/lookbook-project/tree/main/lookbook-backend/src/queues): `lookbook-backend/src/queues`

### Other components

- **Reader or seller**
- **MongoDB**
- **Redis queue service**

## Connections

- Reader or seller → Web application: uses (evidence: `lookbook-frontend/src/App.tsx`)
- Web application → Page routes: renders (evidence: `lookbook-frontend/src/App.tsx`)
- Page routes → API client: uses API
- API client → Express app: HTTP requests (evidence: `README.md`)
- Express app → API route index: mounts routes (evidence: `lookbook-backend/src/app.ts`)
- Admin routes → Marketplace administration: dispatches (evidence: `lookbook-backend/src/routes/adminRoutes.ts`)
- Admin routes → Authentication routes: protects admin (evidence: `lookbook-backend/src/routes/adminRoutes.ts`)
- Checkout and orders → Order model: reads and writes (evidence: `lookbook-backend/src/controllers/orderController.ts`)
- Checkout and orders → Book catalog model: updates stock (evidence: `lookbook-backend/src/controllers/orderController.ts`)
- Checkout and orders → User model: reads user (evidence: `lookbook-backend/src/controllers/orderController.ts`)
- Book reviews → Book catalog model: updates ratings (evidence: `lookbook-backend/src/controllers/reviewController.ts`)
- Book reviews → Order model: verifies purchases (evidence: `lookbook-backend/src/controllers/reviewController.ts`)
- Marketplace administration → Order model: manages orders (evidence: `lookbook-backend/src/controllers/adminController.ts`)
- Marketplace administration → Book catalog model: manages books (evidence: `lookbook-backend/src/controllers/adminController.ts`)
- API server → Express app: starts (evidence: `lookbook-backend/src/server.ts`)
- API server → MongoDB: connects (evidence: `lookbook-backend/src/server.ts`)
- API server → Background workers: starts workers (evidence: `lookbook-backend/src/server.ts`)
- Background workers → Redis queue service: queues jobs
- Express app → MongoDB: persists data (evidence: `README.md`)
