# bvaishnavi25/beautybloom architecture

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

- Interactive diagram: https://gitdiagram.com/bvaishnavi25/beautybloom
- Repository: https://github.com/bvaishnavi25/beautybloom

## Overview

BeautyBloom is a personalized skincare and beauty guidance application. Visitors sign up or sign in, then the dashboard loads profile and saved state; the Skin Quiz produces the canonical skin profile used to tailor guidance. Users can also track routines, keep a journal, save favorites, and review progress. The backend routes authenticated requests to quiz, profile, state, content, and collection handlers backed by a switchable data layer. The graph reflects documented routes and excerpted calls; unsampled frontend API wiring and several page internals are not asserted.

Main entry points: [`backend/src/routes/index.js`](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/routes/index.js) (API routes), [`backend/src/db/index.js`](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/db/index.js) (Data layer switch), [`frontend/src/App.jsx`](https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/App.jsx) (Application router), [`backend/src/controllers/quizController.js`](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/quizController.js) (Skin Quiz)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Application router<br/>[App.jsx]"]
  node_authui["Sign-in UI<br/>[AuthPage.jsx]"]
  node_dashboard["Dashboard pages"]
  node_appdata["App data context<br/>[AppDataContext.jsx]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_personalization["Quiz and guidance"]
  node_quiz["Skin Quiz<br/>[quizController.js]"]
  node_content["Beauty content<br/>[content.js]"]
  node_video["Video catalog<br/>[videos.js]"]
  node_personalizer["Personalization engine"]
end

subgraph group_backend["API services"]
  node_auth["Authentication<br/>[authController.js]"]
  node_profile["Profile management"]
  node_state["State and privacy<br/>[stateController.js]"]
  node_collections["Saved collections"]
  node_favorites["Favorite resolver"]
  node_routes["API routes<br/>[index.js]"]
  node_server["HTTP application<br/>[app.js]"]
  node_config["Runtime configuration<br/>[env.js]"]
end

subgraph group_persistence["Persistence"]
  node_dbswitch["Data layer switch<br/>[index.js]"]
  node_mongo[("Mongo adapter<br/>[mongoAdapter.js]")]
  node_memory[("Memory adapter<br/>[memoryDb.js]")]
  node_models["Stored records"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_dashboard
node_app -->|"wraps dashboard"| node_appdata
node_appdata -.->|"loads state"| node_api
node_api -.->|"requests API"| node_server
node_server -->|"configures"| node_config
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_auth
node_routes -->|"dispatches"| node_quiz
node_routes -->|"dispatches"| node_profile
node_routes -->|"dispatches"| node_state
node_routes -->|"dispatches"| node_collections
node_quiz -->|"scores with"| node_content
node_quiz -->|"builds recommendations"| node_personalizer
node_quiz -->|"saves quiz"| node_dbswitch
node_state -->|"computes guidance"| node_personalizer
node_state -->|"loads state"| node_dbswitch
node_personalizer -->|"uses guidance data"| node_content
node_content -->|"imports catalog"| node_video
node_profile -->|"loads current state"| node_state
node_profile -->|"saves profile"| node_dbswitch
node_collections -->|"reads and writes"| node_dbswitch
node_collections -->|"resolves favorites"| node_favorites
node_favorites -->|"canonicalizes items"| node_content
node_dbswitch -->|"selects adapter"| node_mongo
node_dbswitch -->|"selects adapter"| node_memory
node_mongo -->|"uses records"| node_models

click node_app "https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/pages/AuthPage.jsx"
click node_dashboard "https://github.com/bvaishnavi25/beautybloom/tree/main/frontend/src/pages/dashboard"
click node_appdata "https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/context/AppDataContext.jsx"
click node_api "https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/lib/api.js"
click node_quiz "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/quizController.js"
click node_content "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/data/content.js"
click node_video "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/data/videos.js"
click node_personalizer "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/services/personalizationEngine.js"
click node_auth "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/authController.js"
click node_profile "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/profileController.js"
click node_state "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/stateController.js"
click node_collections "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/collectionsController.js"
click node_favorites "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/services/favoritesService.js"
click node_routes "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/routes/index.js"
click node_server "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/app.js"
click node_dbswitch "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/db/index.js"
click node_mongo "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/db/mongoAdapter.js"
click node_memory "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/db/memoryDb.js"
click node_models "https://github.com/bvaishnavi25/beautybloom/tree/main/backend/src/models"
click node_config "https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/config/env.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,node_authui,node_dashboard,node_appdata,node_api toneBlue
class node_quiz,node_content,node_video,node_personalizer toneAmber
class node_auth,node_profile,node_state,node_collections,node_favorites,node_routes,node_server,node_config toneMint
class node_dbswitch,node_mongo,node_memory,node_models toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Application router](https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in UI](https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/pages/AuthPage.jsx): `frontend/src/pages/AuthPage.jsx`
- [Dashboard pages](https://github.com/bvaishnavi25/beautybloom/tree/main/frontend/src/pages/dashboard): `frontend/src/pages/dashboard`
- [App data context](https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/context/AppDataContext.jsx): `frontend/src/context/AppDataContext.jsx`
- [API client](https://github.com/bvaishnavi25/beautybloom/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`

### Quiz and guidance

- [Skin Quiz](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/quizController.js): `backend/src/controllers/quizController.js`
- [Beauty content](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/data/content.js): `backend/src/data/content.js`
- [Video catalog](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/data/videos.js): `backend/src/data/videos.js`
- [Personalization engine](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/services/personalizationEngine.js): `backend/src/services/personalizationEngine.js`

### API services

- [Authentication](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Profile management](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/profileController.js): `backend/src/controllers/profileController.js`
- [State and privacy](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/stateController.js): `backend/src/controllers/stateController.js`
- [Saved collections](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/controllers/collectionsController.js): `backend/src/controllers/collectionsController.js`
- [Favorite resolver](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/services/favoritesService.js): `backend/src/services/favoritesService.js`
- [API routes](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/routes/index.js): `backend/src/routes/index.js`
- [HTTP application](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/app.js): `backend/src/app.js`
- [Runtime configuration](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/config/env.js): `backend/src/config/env.js`

### Persistence

- [Data layer switch](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/db/index.js): `backend/src/db/index.js`
- [Mongo adapter](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/db/mongoAdapter.js): `backend/src/db/mongoAdapter.js`
- [Memory adapter](https://github.com/bvaishnavi25/beautybloom/blob/main/backend/src/db/memoryDb.js): `backend/src/db/memoryDb.js`
- [Stored records](https://github.com/bvaishnavi25/beautybloom/tree/main/backend/src/models): `backend/src/models`

### Other components

- **Visitor**

## Connections

- Visitor → Application router: opens (evidence: `frontend/src/App.jsx`)
- Application router → Sign-in UI: routes to (evidence: `frontend/src/App.jsx`)
- Application router → Dashboard pages: routes to (evidence: `frontend/src/App.jsx`)
- Application router → App data context: wraps dashboard (evidence: `frontend/src/App.jsx`)
- App data context → API client: loads state
- API client → HTTP application: requests API
- HTTP application → Runtime configuration: configures (evidence: `backend/src/app.js`)
- HTTP application → API routes: mounts (evidence: `backend/src/app.js`)
- API routes → Authentication: dispatches (evidence: `backend/src/routes/index.js`)
- API routes → Skin Quiz: dispatches (evidence: `backend/src/routes/index.js`)
- API routes → Profile management: dispatches (evidence: `backend/src/routes/index.js`)
- API routes → State and privacy: dispatches (evidence: `backend/src/routes/index.js`)
- API routes → Saved collections: dispatches (evidence: `backend/src/routes/index.js`)
- Skin Quiz → Beauty content: scores with (evidence: `backend/src/controllers/quizController.js`)
- Skin Quiz → Personalization engine: builds recommendations (evidence: `backend/src/controllers/quizController.js`)
- Skin Quiz → Data layer switch: saves quiz (evidence: `backend/src/controllers/quizController.js`)
- State and privacy → Personalization engine: computes guidance (evidence: `backend/src/controllers/stateController.js`)
- State and privacy → Data layer switch: loads state (evidence: `backend/src/controllers/stateController.js`)
- Personalization engine → Beauty content: uses guidance data (evidence: `backend/src/services/personalizationEngine.js`)
- Beauty content → Video catalog: imports catalog (evidence: `backend/src/data/content.js`)
- Profile management → State and privacy: loads current state (evidence: `backend/src/controllers/profileController.js`)
- Profile management → Data layer switch: saves profile (evidence: `backend/src/controllers/profileController.js`)
- Saved collections → Data layer switch: reads and writes (evidence: `backend/src/controllers/collectionsController.js`)
- Saved collections → Favorite resolver: resolves favorites (evidence: `backend/src/controllers/collectionsController.js`)
- Favorite resolver → Beauty content: canonicalizes items (evidence: `backend/src/services/favoritesService.js`)
- Data layer switch → Mongo adapter: selects adapter (evidence: `backend/src/db/index.js`)
- Data layer switch → Memory adapter: selects adapter (evidence: `backend/src/db/index.js`)
- Mongo adapter → Stored records: uses records (evidence: `backend/src/db/mongoAdapter.js`)
