# souravdasz/bablu-s-saree architecture

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

- Interactive diagram: https://gitdiagram.com/souravdasz/bablu-s-saree
- Repository: https://github.com/souravdasz/bablu-s-saree

## Overview

Saree App is a FastAPI storefront with an admin-managed product catalog. The primary workflow is admin sign-in, product creation or maintenance (including image upload), followed by customers browsing, filtering, and viewing products and categories. The graph also includes the documented about/contact pages, session configuration, database setup, and image storage. Source excerpts show the route-to-model and storage calls; template rendering is documented in route code. Some integrations and runtime wiring are not sampled, so unsupported links are omitted.

Main entry points: [`app/main.py`](https://github.com/souravdasz/bablu-s-saree/blob/main/app/main.py) (FastAPI app), [`app/models/product.py`](https://github.com/souravdasz/bablu-s-saree/blob/main/app/models/product.py) (Product model), [`app/routers/admin.py`](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/admin.py) (Product management), [`app/templates`](https://github.com/souravdasz/bablu-s-saree/tree/main/app/templates) (Jinja templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_templates["Jinja templates"]
end

subgraph group_admin["Admin catalog"]
  node_login["Admin login<br/>[admin.py]"]
  node_auth["Session guard<br/>[auth.py]"]
  node_dashboard["Admin dashboard<br/>[admin.py]"]
  node_catalog_admin["Product management<br/>[admin.py]"]
end

subgraph group_storefront["Customer storefront"]
  node_about_contact["About and contact<br/>[about_us.py]"]
  node_storefront_home["Storefront pages<br/>[home.py]"]
  node_product_browse["Product browsing<br/>[home.py]"]
  node_category_browse["Category browsing<br/>[home.py]"]
  node_product_detail["Product details<br/>[home.py]"]
end

subgraph group_data["Catalog data"]
  node_product_model["Product model<br/>[product.py]"]
  node_database[("SQL database<br/>[database.py]")]
end

subgraph group_infrastructure["Configuration and storage"]
  node_configuration["App configuration<br/>[config.py]"]
  node_image_storage["Image storage<br/>[storage.py]"]
end

node_visitor(("Shop visitor"))
node_administrator(("Administrator"))
node_supabase[("Supabase storage")]

node_visitor -->|"requests pages"| node_fastapi
node_administrator -->|"requests admin"| node_fastapi
node_fastapi -->|"registers router"| node_about_contact
node_fastapi -->|"registers router"| node_login
node_fastapi -->|"registers router"| node_storefront_home
node_login -->|"checks credentials"| node_configuration
node_login -->|"protects routes"| node_auth
node_catalog_admin -->|"checks session"| node_auth
node_dashboard -->|"counts products"| node_product_model
node_catalog_admin -->|"queries and updates"| node_product_model
node_storefront_home -->|"renders pages"| node_templates
node_about_contact -->|"renders pages"| node_templates
node_login -->|"renders login"| node_templates
node_dashboard -->|"renders dashboard"| node_templates
node_catalog_admin -->|"renders catalog"| node_templates
node_storefront_home -->|"serves listings"| node_product_browse
node_product_browse -->|"queries products"| node_product_model
node_category_browse -->|"groups products"| node_product_model
node_product_detail -->|"queries product"| node_product_model
node_product_model -->|"uses ORM base"| node_database
node_fastapi -->|"creates tables"| node_database
node_catalog_admin -->|"uploads and deletes"| node_image_storage
node_image_storage -->|"reads storage settings"| node_configuration
node_image_storage -->|"uploads and removes"| node_supabase
node_fastapi -->|"loads session secret"| node_configuration
node_product_browse -->|"formats image URLs"| node_image_storage
node_catalog_admin -->|"opens database session"| node_database
node_product_browse -->|"opens database session"| node_database

click node_fastapi "https://github.com/souravdasz/bablu-s-saree/blob/main/app/main.py"
click node_about_contact "https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/about_us.py"
click node_login "https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/admin.py"
click node_auth "https://github.com/souravdasz/bablu-s-saree/blob/main/app/core/auth.py"
click node_dashboard "https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/admin.py"
click node_catalog_admin "https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/admin.py"
click node_storefront_home "https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/home.py"
click node_product_browse "https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/home.py"
click node_category_browse "https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/home.py"
click node_product_detail "https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/home.py"
click node_product_model "https://github.com/souravdasz/bablu-s-saree/blob/main/app/models/product.py"
click node_database "https://github.com/souravdasz/bablu-s-saree/blob/main/app/database.py"
click node_configuration "https://github.com/souravdasz/bablu-s-saree/blob/main/app/core/config.py"
click node_image_storage "https://github.com/souravdasz/bablu-s-saree/blob/main/app/services/storage.py"
click node_templates "https://github.com/souravdasz/bablu-s-saree/tree/main/app/templates"

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_fastapi,node_templates toneBlue
class node_login,node_auth,node_dashboard,node_catalog_admin,node_supabase toneAmber
class node_about_contact,node_storefront_home,node_product_browse,node_category_browse,node_product_detail toneMint
class node_product_model,node_database toneRose
class node_configuration,node_image_storage,node_visitor,node_administrator toneIndigo
```

## Components

### Application

- [FastAPI app](https://github.com/souravdasz/bablu-s-saree/blob/main/app/main.py): `app/main.py`
- [Jinja templates](https://github.com/souravdasz/bablu-s-saree/tree/main/app/templates): `app/templates`

### Admin catalog

- [Admin login](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/admin.py): `app/routers/admin.py`
- [Session guard](https://github.com/souravdasz/bablu-s-saree/blob/main/app/core/auth.py): `app/core/auth.py`
- [Admin dashboard](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/admin.py): `app/routers/admin.py`
- [Product management](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/admin.py): `app/routers/admin.py`

### Customer storefront

- [About and contact](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/about_us.py): `app/routers/about_us.py`
- [Storefront pages](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/home.py): `app/routers/home.py`
- [Product browsing](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/home.py): `app/routers/home.py`
- [Category browsing](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/home.py): `app/routers/home.py`
- [Product details](https://github.com/souravdasz/bablu-s-saree/blob/main/app/routers/home.py): `app/routers/home.py`

### Catalog data

- [Product model](https://github.com/souravdasz/bablu-s-saree/blob/main/app/models/product.py): `app/models/product.py`
- [SQL database](https://github.com/souravdasz/bablu-s-saree/blob/main/app/database.py): `app/database.py`

### Configuration and storage

- [App configuration](https://github.com/souravdasz/bablu-s-saree/blob/main/app/core/config.py): `app/core/config.py`
- [Image storage](https://github.com/souravdasz/bablu-s-saree/blob/main/app/services/storage.py): `app/services/storage.py`

### Other components

- **Shop visitor**
- **Administrator**
- **Supabase storage**

## Connections

- Shop visitor → FastAPI app: requests pages (evidence: `README.md`)
- Administrator → FastAPI app: requests admin (evidence: `README.md`)
- FastAPI app → About and contact: registers router (evidence: `app/main.py`)
- FastAPI app → Admin login: registers router (evidence: `app/main.py`)
- FastAPI app → Storefront pages: registers router (evidence: `app/main.py`)
- Admin login → App configuration: checks credentials (evidence: `app/routers/admin.py`)
- Admin login → Session guard: protects routes (evidence: `app/routers/admin.py`)
- Product management → Session guard: checks session (evidence: `app/routers/admin.py`)
- Admin dashboard → Product model: counts products (evidence: `app/routers/admin.py`)
- Product management → Product model: queries and updates (evidence: `app/routers/admin.py`)
- Storefront pages → Jinja templates: renders pages (evidence: `app/routers/home.py`)
- About and contact → Jinja templates: renders pages (evidence: `app/routers/about_us.py`)
- Admin login → Jinja templates: renders login (evidence: `app/routers/admin.py`)
- Admin dashboard → Jinja templates: renders dashboard (evidence: `app/routers/admin.py`)
- Product management → Jinja templates: renders catalog (evidence: `app/routers/admin.py`)
- Storefront pages → Product browsing: serves listings (evidence: `app/routers/home.py`)
- Product browsing → Product model: queries products (evidence: `app/routers/home.py`)
- Category browsing → Product model: groups products (evidence: `app/routers/home.py`)
- Product details → Product model: queries product (evidence: `app/routers/home.py`)
- Product model → SQL database: uses ORM base (evidence: `app/models/product.py`)
- FastAPI app → SQL database: creates tables (evidence: `app/main.py`)
- Product management → Image storage: uploads and deletes (evidence: `app/routers/admin.py`)
- Image storage → App configuration: reads storage settings (evidence: `app/services/storage.py`)
- Image storage → Supabase storage: uploads and removes (evidence: `app/services/storage.py`)
- FastAPI app → App configuration: loads session secret (evidence: `app/main.py`)
- Product browsing → Image storage: formats image URLs (evidence: `app/routers/home.py`)
- Product management → SQL database: opens database session (evidence: `app/routers/admin.py`)
- Product browsing → SQL database: opens database session (evidence: `app/routers/home.py`)
