# shahadat-gith/lifebookz architecture

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

- Interactive diagram: https://gitdiagram.com/shahadat-gith/lifebookz
- Repository: https://github.com/shahadat-gith/lifebookz

## Overview

LifeBookz is a multi-portal platform for reading and publishing personal stories, booking expert consultations, and operating the service. Readers browse stories and authors; authors create and manage story content; consultation flows connect clients and experts to checkout and live sessions. Admin and developer portals support operations. The sampled backend shows API setup, story routing, authentication, and parts of author and consultation handling. Many portal-to-API and unsampled payment/session connections are not shown, so those links are omitted or marked unverified.

Main entry points: [`backend/src/services/author.service.js`](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/author.service.js) (Author accounts), [`web/client/src/App.jsx`](https://github.com/shahadat-gith/lifebookz/blob/main/web/client/src/App.jsx) (Client portal), [`backend/src/routes/story.routes.js`](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/routes/story.routes.js) (Story routes), [`backend/src/routes/index.js`](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/routes/index.js) (API route registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["User portals"]
  node_client["Client portal<br/>[App.jsx]"]
  node_author_portal["Author portal<br/>[App.jsx]"]
  node_expert_portal["Expert portal<br/>[App.jsx]"]
  node_admin_portal["Admin portal<br/>[App.jsx]"]
  node_developer_portal["Developer portal<br/>[App.jsx]"]
  node_payment_portal["Payment portal<br/>[App.jsx]"]
  node_session_portal["Session portal<br/>[App.jsx]"]
end

subgraph group_api["API routing"]
  node_api_app["API application<br/>[app.js]"]
  node_api_routes["API route registry<br/>[index.js]"]
  node_story_routes["Story routes<br/>[story.routes.js]"]
  node_auth_middleware["Authentication<br/>[auth.js]"]
end

subgraph group_domain["Domain services"]
  node_story_controller["Story handlers"]
  node_consult_controller["Consult handlers"]
  node_consult_service["Consultation workflow"]
  node_story_service["Story workflow<br/>[story.service.js]"]
  node_author_service["Author accounts<br/>[author.service.js]"]
  node_upload_service["Media uploads<br/>[upload.service.js]"]
  node_payment_controller["Payment handlers"]
  node_payment_service["Payment workflow<br/>[payment.service.js]"]
end

subgraph group_data["Data and integrations"]
  node_author_model[("Author records<br/>[Author.js]")]
  node_story_model[("Story records<br/>[Story.js]")]
end

node_reader(("Readers"))
node_author(("Authors"))

node_reader -->|"browses"| node_client
node_author -->|"publishes stories"| node_author_portal
node_api_app -->|"mounts routes"| node_api_routes
node_api_routes -.->|"registers routes"| node_story_routes
node_story_routes -->|"gates access"| node_auth_middleware
node_story_routes -->|"dispatches requests"| node_story_controller
node_story_controller -->|"calls"| node_story_service
node_consult_controller -->|"calls"| node_consult_service
node_author_service -->|"reads and writes"| node_author_model
node_author_service -->|"reads stories"| node_story_model
node_author_service -->|"uploads images"| node_upload_service
node_client -->|"hands off checkout"| node_payment_portal
node_client -->|"hands off sessions"| node_session_portal
node_payment_controller -.->|"delegates payment"| node_payment_service

click node_client "https://github.com/shahadat-gith/lifebookz/blob/main/web/client/src/App.jsx"
click node_author_portal "https://github.com/shahadat-gith/lifebookz/blob/main/web/author/src/App.jsx"
click node_expert_portal "https://github.com/shahadat-gith/lifebookz/blob/main/web/expert/src/App.jsx"
click node_admin_portal "https://github.com/shahadat-gith/lifebookz/blob/main/web/admin/src/App.jsx"
click node_developer_portal "https://github.com/shahadat-gith/lifebookz/blob/main/web/developer/src/App.jsx"
click node_payment_portal "https://github.com/shahadat-gith/lifebookz/blob/main/web/payment/src/App.jsx"
click node_session_portal "https://github.com/shahadat-gith/lifebookz/blob/main/web/session/src/App.jsx"
click node_api_app "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/app.js"
click node_api_routes "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/routes/index.js"
click node_story_routes "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/routes/story.routes.js"
click node_story_controller "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/controllers/story.controller.js"
click node_consult_controller "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/controllers/consultations.controller.js"
click node_consult_service "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/consultations.service.js"
click node_story_service "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/story.service.js"
click node_author_service "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/author.service.js"
click node_auth_middleware "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/middleware/auth.js"
click node_author_model "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/models/Author.js"
click node_story_model "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/models/Story.js"
click node_upload_service "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/upload.service.js"
click node_payment_controller "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/controllers/payment.controller.js"
click node_payment_service "https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/payment.service.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_client,node_author_portal,node_expert_portal,node_admin_portal,node_developer_portal,node_payment_portal,node_session_portal toneBlue
class node_api_app,node_api_routes,node_story_routes,node_auth_middleware toneAmber
class node_story_controller,node_consult_controller,node_consult_service,node_story_service,node_author_service,node_upload_service,node_payment_controller,node_payment_service toneMint
class node_author_model,node_story_model toneRose
class node_reader,node_author toneIndigo
```

## Components

### User portals

- [Client portal](https://github.com/shahadat-gith/lifebookz/blob/main/web/client/src/App.jsx): `web/client/src/App.jsx`
- [Author portal](https://github.com/shahadat-gith/lifebookz/blob/main/web/author/src/App.jsx): `web/author/src/App.jsx`
- [Expert portal](https://github.com/shahadat-gith/lifebookz/blob/main/web/expert/src/App.jsx): `web/expert/src/App.jsx`
- [Admin portal](https://github.com/shahadat-gith/lifebookz/blob/main/web/admin/src/App.jsx): `web/admin/src/App.jsx`
- [Developer portal](https://github.com/shahadat-gith/lifebookz/blob/main/web/developer/src/App.jsx): `web/developer/src/App.jsx`
- [Payment portal](https://github.com/shahadat-gith/lifebookz/blob/main/web/payment/src/App.jsx): `web/payment/src/App.jsx`
- [Session portal](https://github.com/shahadat-gith/lifebookz/blob/main/web/session/src/App.jsx): `web/session/src/App.jsx`

### API routing

- [API application](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/app.js): `backend/src/app.js`
- [API route registry](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/routes/index.js): `backend/src/routes/index.js`
- [Story routes](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/routes/story.routes.js): `backend/src/routes/story.routes.js`
- [Authentication](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`

### Domain services

- [Story handlers](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/controllers/story.controller.js): `backend/src/controllers/story.controller.js`
- [Consult handlers](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/controllers/consultations.controller.js): `backend/src/controllers/consultations.controller.js`
- [Consultation workflow](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/consultations.service.js): `backend/src/services/consultations.service.js`
- [Story workflow](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/story.service.js): `backend/src/services/story.service.js`
- [Author accounts](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/author.service.js): `backend/src/services/author.service.js`
- [Media uploads](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/upload.service.js): `backend/src/services/upload.service.js`
- [Payment handlers](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/controllers/payment.controller.js): `backend/src/controllers/payment.controller.js`
- [Payment workflow](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/services/payment.service.js): `backend/src/services/payment.service.js`

### Data and integrations

- [Author records](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/models/Author.js): `backend/src/models/Author.js`
- [Story records](https://github.com/shahadat-gith/lifebookz/blob/main/backend/src/models/Story.js): `backend/src/models/Story.js`

### Other components

- **Readers**
- **Authors**

## Connections

- Readers → Client portal: browses (evidence: `web/client/src/App.jsx`)
- Authors → Author portal: publishes stories (evidence: `web/author/src/App.jsx`)
- API application → API route registry: mounts routes (evidence: `backend/src/app.js`)
- API route registry → Story routes: registers routes
- Story routes → Authentication: gates access (evidence: `backend/src/routes/story.routes.js`)
- Story routes → Story handlers: dispatches requests (evidence: `backend/src/routes/story.routes.js`)
- Story handlers → Story workflow: calls (evidence: `backend/src/controllers/story.controller.js`)
- Consult handlers → Consultation workflow: calls (evidence: `backend/src/controllers/consultations.controller.js`)
- Author accounts → Author records: reads and writes (evidence: `backend/src/services/author.service.js`)
- Author accounts → Story records: reads stories (evidence: `backend/src/services/author.service.js`)
- Author accounts → Media uploads: uploads images (evidence: `backend/src/services/author.service.js`)
- Client portal → Payment portal: hands off checkout (evidence: `web/client/src/App.jsx`)
- Client portal → Session portal: hands off sessions (evidence: `web/client/src/App.jsx`)
- Payment handlers → Payment workflow: delegates payment
