# kimyonghwan1996/oliveyoung-porject architecture

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

- Interactive diagram: https://gitdiagram.com/kimyonghwan1996/oliveyoung-porject
- Repository: https://github.com/kimyonghwan1996/oliveyoung-porject

## Overview

Oliveyoung Clone is a small online beauty-shop application: users browse products, authenticate, manage a cart, and place or review orders through a web UI and FastAPI backend. A separate Streamlit UI provides the documented chatbot path; the README describes FastAPI-backed product lookup and Bedrock answers. The sampled startup registers the root-level routers, while backend/routers contains a separate, more developed chat implementation that is not shown as registered. Edges reflect sampled code and README statements; unsampled integrations are left unconnected.

Main entry points: [`routers/items.py`](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/routers/items.py) (Shop routes), [`backend/main.py`](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/main.py) (FastAPI app), [`routers/auth.py`](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/routers/auth.py) (Authentication), [`backend/database.py`](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/database.py) (DB sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web clients"]
  node_web_ui["Shop UI<br/>[app.js]"]
  node_chat_ui["Chat UI<br/>[app.py]"]
end

subgraph group_api["API routes"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_shop_routes["Shop routes<br/>[items.py]"]
  node_chat_route["Chat route<br/>[chat.py]"]
end

subgraph group_core["Shop services"]
  node_auth_core["Auth logic<br/>[crud.py]"]
  node_shop_core["Shop logic<br/>[crud.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_models["Data models<br/>[models.py]"]
  node_db_session["DB sessions<br/>[database.py]"]
  node_postgres[("PostgreSQL<br/>[init.sql]")]
end

subgraph group_ai["AI advisor"]
  node_advanced_chat["Tool chat<br/>[chat.py]"]
  node_bedrock{{"Bedrock"}}
  node_vector_search["Semantic search<br/>[chat.py]"]
  node_vector_store[("S3 Vectors")]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_web_ui
node_web_ui -->|"calls API"| node_api_app
node_api_app -->|"registers"| node_auth
node_api_app -->|"registers"| node_shop_routes
node_api_app -->|"registers"| node_chat_route
node_auth -->|"calls"| node_auth_core
node_shop_routes -->|"calls"| node_shop_core
node_shop_routes -->|"checks identity"| node_auth
node_auth -->|"gets session"| node_db_session
node_shop_routes -->|"gets session"| node_db_session
node_chat_route -->|"gets session"| node_db_session
node_auth -->|"validates with"| node_schemas
node_shop_routes -->|"validates with"| node_schemas
node_chat_route -->|"validates with"| node_schemas
node_auth_core -->|"queries"| node_models
node_shop_core -->|"queries"| node_models
node_models -->|"uses base"| node_db_session
node_db_session -->|"connects to"| node_postgres
node_shopper -->|"asks"| node_chat_ui
node_chat_ui -->|"sends chat"| node_api_app
node_advanced_chat -->|"invokes"| node_bedrock
node_advanced_chat -->|"dispatches tool"| node_vector_search
node_vector_search -->|"searches"| node_vector_store
node_advanced_chat -->|"queries products"| node_postgres

click node_web_ui "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/frontend/js/app.js"
click node_chat_ui "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/streamlit/app.py"
click node_api_app "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/main.py"
click node_auth "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/routers/auth.py"
click node_shop_routes "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/routers/items.py"
click node_chat_route "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/routers/chat.py"
click node_auth_core "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/crud.py"
click node_shop_core "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/crud.py"
click node_schemas "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/schemas.py"
click node_models "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/models.py"
click node_db_session "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/database.py"
click node_postgres "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/db/init.sql"
click node_advanced_chat "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/routers/chat.py"
click node_vector_search "https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/routers/chat.py"

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_web_ui,node_chat_ui toneBlue
class node_api_app,node_auth,node_shop_routes,node_chat_route toneAmber
class node_auth_core,node_shop_core,node_schemas,node_models,node_db_session,node_postgres toneMint
class node_advanced_chat,node_bedrock,node_vector_search,node_vector_store toneRose
class node_shopper toneIndigo
```

## Components

### Web clients

- [Shop UI](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [Chat UI](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/streamlit/app.py): `streamlit/app.py`

### API routes

- [FastAPI app](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/main.py): `backend/main.py`
- [Authentication](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/routers/auth.py): `routers/auth.py`
- [Shop routes](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/routers/items.py): `routers/items.py`
- [Chat route](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/routers/chat.py): `routers/chat.py`

### Shop services

- [Auth logic](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/crud.py): `backend/crud.py`
- [Shop logic](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/crud.py): `backend/crud.py`
- [API schemas](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/schemas.py): `backend/schemas.py`
- [Data models](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/models.py): `backend/models.py`
- [DB sessions](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/database.py): `backend/database.py`
- [PostgreSQL](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/db/init.sql): `db/init.sql`

### AI advisor

- [Tool chat](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/routers/chat.py): `backend/routers/chat.py`
- **Bedrock**
- [Semantic search](https://github.com/kimyonghwan1996/oliveyoung-porject/blob/main/backend/routers/chat.py): `backend/routers/chat.py`
- **S3 Vectors**

### Other components

- **Shopper**

## Connections

- Shopper → Shop UI: uses (evidence: `README.md`)
- Shop UI → FastAPI app: calls API (evidence: `README.md`)
- FastAPI app → Authentication: registers (evidence: `backend/main.py`)
- FastAPI app → Shop routes: registers (evidence: `backend/main.py`)
- FastAPI app → Chat route: registers (evidence: `backend/main.py`)
- Authentication → Auth logic: calls (evidence: `routers/auth.py`)
- Shop routes → Shop logic: calls (evidence: `routers/items.py`)
- Shop routes → Authentication: checks identity (evidence: `routers/items.py`)
- Authentication → DB sessions: gets session (evidence: `routers/auth.py`)
- Shop routes → DB sessions: gets session (evidence: `routers/items.py`)
- Chat route → DB sessions: gets session (evidence: `routers/chat.py`)
- Authentication → API schemas: validates with (evidence: `routers/auth.py`)
- Shop routes → API schemas: validates with (evidence: `routers/items.py`)
- Chat route → API schemas: validates with (evidence: `routers/chat.py`)
- Auth logic → Data models: queries (evidence: `backend/crud.py`)
- Shop logic → Data models: queries (evidence: `backend/crud.py`)
- Data models → DB sessions: uses base (evidence: `backend/models.py`)
- DB sessions → PostgreSQL: connects to (evidence: `README.md`)
- Shopper → Chat UI: asks (evidence: `README.md`)
- Chat UI → FastAPI app: sends chat (evidence: `README.md`)
- Tool chat → Bedrock: invokes (evidence: `backend/routers/chat.py`)
- Tool chat → Semantic search: dispatches tool (evidence: `backend/routers/chat.py`)
- Semantic search → S3 Vectors: searches (evidence: `backend/routers/chat.py`)
- Tool chat → PostgreSQL: queries products (evidence: `backend/routers/chat.py`)
