# aditi9975/swati_creation architecture

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

- Interactive diagram: https://gitdiagram.com/aditi9975/swati_creation
- Repository: https://github.com/aditi9975/swati_creation

## Overview

1. **Project shape**
   - This is a small **Flask-based application** named *Swati_Creation*.
   - The repository is organized as a classic server-rendered web app with **Python backend + Jinja templates + static frontend assets + SQLite persistence**.

2. **Main runtime entrypoint**
   - `app.py` is the central application module and likely wires together Flask, routes, forms, models, and configuration.
   - `config.py` holds environment/app settings, most importantly the database configuration for the local SQLite file in `instance/swati_creation.db`.

3. **Persistence layer**
   - `models.py` defines the database schema and ORM entities.
   - The presence of `instance/swati_creation.db` indicates the app uses a **file-backed SQLite database** rather than a remote DB service.
   - This makes the data flow local: requests go from browser to Flask, then to SQLite through the model layer.

4. **Form/input boundary**
   - `forms.py` is the input-validation boundary for user/admin interactions.
   - It likely contains Flask-WTF-style forms for login, signup, product CRUD, and cart-related actions, separating request validation from route logic.

5. **Presentation layer**
   - `templates/` contains all server-rendered UI pages.
   - `templates/base.html` is the shared layout shell, with page-specific templates extending it.
   - The app uses **Jinja templating** to render dynamic pages from backend data.

6. **Public site pages**
   - `templates/index.html`, `templates/shop.html`, `templates/login.html`, `templates/signup.html`, and `templates/my_cart.html` suggest the public-facing flow:
     - landing page
     - product browsing/shop listing
     - authentication
     - cart viewing
   - `templates/user/product_detail.html` is the product detail view for browsing and purchase decisions.

7. **Role-based areas**
   - The template split under `templates/admin/` and `templates/user/` indicates two primary application roles:
     - **Admin**: `dashboard.html`, `add_product.html`, `edit_product.html`
     - **User**: `dashboard.html`, `product_detail.html`
   - This suggests authorization boundaries in the backend, with different route sets and permissions for staff vs. regular users.

8. **Core business capabilities**
   - The repository appears centered on **product catalog management and shopping/cart workflows**.
   - Admin can create, edit, and manage products.
   - Users can browse products, inspect details, and manage a cart.
   - The app likely models products and possibly users/orders in `models.py`, though only product/cart-related templates are visible.

9. **Static asset layer**
   - `static/css/bootstrap.css` and `static/css/style.css` show a mix of framework styling and app-specific overrides.
   - `static/js/main.js` likely handles client-side behavior such as UI interactions, navigation helpers, or cart-related enhancements.
   - `static/images/uploads/` suggests user/admin-uploaded product images are stored locally and served as static files.
   - `static/videos/intro.mp4` indicates the landing page or homepage includes a promotional media element.

10. **Request-to-response flow**
    - Browser requests hit Flask routes in `app.py`.
    - Route handlers validate input via `forms.py`, read/write data through `models.py`, then render a Jinja template.
    - Templates pull in shared CSS/JS and may reference uploaded images/videos from `static/`.

11. **Storage and deployment boundary**
    - Because the database is local SQLite and uploads are under `static/images/uploads`, this is a **single-node, file-based deployment**.
    - There is no evidence of external cloud storage, message queues, or separate API services.

12. **Important architectural takeaway**
    - The system is a **monolithic, server-rendered CRUD/e-commerce-style Flask app** with clear separation between:
      - routing/application logic (`app.py`)
      - validation (`forms.py`)
      - data model/persistence (`models.py`, SQLite)
      - presentation (`templates/`)
      - static assets (`static/`)
    - For a diagram, the key boundaries are browser, Flask app, SQLite DB, and local static/uploaded media.

Main entry points: [`app.py`](https://github.com/aditi9975/swati_creation/blob/main/app.py) (App), [`templates/base.html`](https://github.com/aditi9975/swati_creation/blob/main/templates/base.html) (Base Layout), [`static/images/uploads`](https://github.com/aditi9975/swati_creation/tree/main/static/images/uploads) (Uploads), [`models.py`](https://github.com/aditi9975/swati_creation/blob/main/models.py) (Models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_browser(("Browser<br/>client"))
end

subgraph group_backend["Flask App"]
  node_app["App<br/>flask entry<br/>[app.py]"]
  node_config["Config<br/>settings<br/>[config.py]"]
  node_forms["Forms<br/>validation<br/>[forms.py]"]
  node_models["Models<br/>orm schema<br/>[models.py]"]
end

subgraph group_views["Templates"]
  node_base_tpl["Base Layout<br/>jinja shell<br/>[base.html]"]
  node_home_tpl["Home<br/>public page<br/>[index.html]"]
  node_shop_tpl["Shop<br/>catalog page<br/>[shop.html]"]
  node_login_tpl["Login<br/>auth page<br/>[login.html]"]
  node_signup_tpl["Signup<br/>auth page<br/>[signup.html]"]
  node_cart_tpl["Cart<br/>shopping page<br/>[my_cart.html]"]
  node_admin_dash_tpl["Admin Dash<br/>admin page<br/>[dashboard.html]"]
  node_admin_add_tpl["Add Product<br/>admin page<br/>[add_product.html]"]
  node_admin_edit_tpl["Edit Product<br/>admin page<br/>[edit_product.html]"]
  node_user_dash_tpl["User Dash<br/>user page<br/>[dashboard.html]"]
  node_product_tpl["Product Detail<br/>product page"]
end

subgraph group_assets["Static Assets"]
  node_style_css["Styles<br/>css theme<br/>[style.css]"]
  node_main_js["Main JS<br/>client script<br/>[main.js]"]
  node_uploads[("Uploads<br/>image storage")]
  node_intro_video["Intro Video<br/>media asset<br/>[intro.mp4]"]
end

subgraph group_data["Persistence"]
  node_sqlite_db[("SQLite DB<br/>local database<br/>[swati_creation.db]")]
end

node_browser -->|"requests"| node_app
node_app -->|"loads"| node_config
node_app -->|"validates with"| node_forms
node_app -->|"reads/writes"| node_models
node_models -->|"stores"| node_sqlite_db
node_app -->|"renders"| node_base_tpl
node_app -->|"renders"| node_home_tpl
node_app -->|"renders"| node_shop_tpl
node_app -->|"renders"| node_login_tpl
node_app -->|"renders"| node_signup_tpl
node_app -->|"renders"| node_cart_tpl
node_app -->|"renders"| node_admin_dash_tpl
node_app -->|"renders"| node_admin_add_tpl
node_app -->|"renders"| node_admin_edit_tpl
node_app -->|"renders"| node_user_dash_tpl
node_app -->|"renders"| node_product_tpl
node_base_tpl -->|"includes"| node_style_css
node_base_tpl -->|"includes"| node_main_js
node_home_tpl -->|"uses"| node_intro_video
node_admin_add_tpl -->|"uploads"| node_uploads
node_admin_edit_tpl -->|"uploads"| node_uploads
node_product_tpl -->|"displays"| node_uploads

click node_app "https://github.com/aditi9975/swati_creation/blob/main/app.py"
click node_config "https://github.com/aditi9975/swati_creation/blob/main/config.py"
click node_forms "https://github.com/aditi9975/swati_creation/blob/main/forms.py"
click node_models "https://github.com/aditi9975/swati_creation/blob/main/models.py"
click node_base_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/base.html"
click node_home_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/index.html"
click node_shop_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/shop.html"
click node_login_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/login.html"
click node_signup_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/signup.html"
click node_cart_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/my_cart.html"
click node_admin_dash_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/admin/dashboard.html"
click node_admin_add_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/admin/add_product.html"
click node_admin_edit_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/admin/edit_product.html"
click node_user_dash_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/user/dashboard.html"
click node_product_tpl "https://github.com/aditi9975/swati_creation/blob/main/templates/user/product_detail.html"
click node_style_css "https://github.com/aditi9975/swati_creation/blob/main/static/css/style.css"
click node_main_js "https://github.com/aditi9975/swati_creation/blob/main/static/js/main.js"
click node_uploads "https://github.com/aditi9975/swati_creation/tree/main/static/images/uploads"
click node_intro_video "https://github.com/aditi9975/swati_creation/blob/main/static/videos/intro.mp4"
click node_sqlite_db "https://github.com/aditi9975/swati_creation/blob/main/instance/swati_creation.db"

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_browser toneBlue
class node_app,node_config,node_forms,node_models toneAmber
class node_base_tpl,node_home_tpl,node_shop_tpl,node_login_tpl,node_signup_tpl,node_cart_tpl,node_admin_dash_tpl,node_admin_add_tpl,node_admin_edit_tpl,node_user_dash_tpl,node_product_tpl toneMint
class node_style_css,node_main_js,node_uploads,node_intro_video toneRose
class node_sqlite_db toneIndigo
```

## Components

### Client

End-user browser and request entrypoint

- **Browser**: client · User and admin access point

### Flask App

Application logic, routing, validation, and data access

- [App](https://github.com/aditi9975/swati_creation/blob/main/app.py): flask entry · Central Flask application and route wiring · `app.py`
- [Config](https://github.com/aditi9975/swati_creation/blob/main/config.py): settings · Application and database configuration · `config.py`
- [Forms](https://github.com/aditi9975/swati_creation/blob/main/forms.py): validation · Request and input validation boundary · `forms.py`
- [Models](https://github.com/aditi9975/swati_creation/blob/main/models.py): orm schema · Database entities and persistence logic · `models.py`

### Templates

Server-rendered Jinja pages for public, user, and admin areas

- [Base Layout](https://github.com/aditi9975/swati_creation/blob/main/templates/base.html): jinja shell · Shared page shell extended by other templates · `templates/base.html`
- [Home](https://github.com/aditi9975/swati_creation/blob/main/templates/index.html): public page · Landing page with promotional content · `templates/index.html`
- [Shop](https://github.com/aditi9975/swati_creation/blob/main/templates/shop.html): catalog page · Product browsing and listing view · `templates/shop.html`
- [Login](https://github.com/aditi9975/swati_creation/blob/main/templates/login.html): auth page · User sign-in page · `templates/login.html`
- [Signup](https://github.com/aditi9975/swati_creation/blob/main/templates/signup.html): auth page · User registration page · `templates/signup.html`
- [Cart](https://github.com/aditi9975/swati_creation/blob/main/templates/my_cart.html): shopping page · Cart view and checkout-related flow · `templates/my_cart.html`
- [Admin Dash](https://github.com/aditi9975/swati_creation/blob/main/templates/admin/dashboard.html): admin page · Admin overview and management hub · `templates/admin/dashboard.html`
- [Add Product](https://github.com/aditi9975/swati_creation/blob/main/templates/admin/add_product.html): admin page · Admin product creation form · `templates/admin/add_product.html`
- [Edit Product](https://github.com/aditi9975/swati_creation/blob/main/templates/admin/edit_product.html): admin page · Admin product update form · `templates/admin/edit_product.html`
- [User Dash](https://github.com/aditi9975/swati_creation/blob/main/templates/user/dashboard.html): user page · User account and browsing hub · `templates/user/dashboard.html`
- [Product Detail](https://github.com/aditi9975/swati_creation/blob/main/templates/user/product_detail.html): product page · Individual product detail view · `templates/user/product_detail.html`

### Static Assets

Styles, scripts, media, and uploads served locally

- [Styles](https://github.com/aditi9975/swati_creation/blob/main/static/css/style.css): css theme · Application-specific styling overrides · `static/css/style.css`
- [Main JS](https://github.com/aditi9975/swati_creation/blob/main/static/js/main.js): client script · Client-side interactions and UI behavior · `static/js/main.js`
- [Uploads](https://github.com/aditi9975/swati_creation/tree/main/static/images/uploads): image storage · Locally stored product images · `static/images/uploads`
- [Intro Video](https://github.com/aditi9975/swati_creation/blob/main/static/videos/intro.mp4): media asset · Promotional homepage video · `static/videos/intro.mp4`

### Persistence

Local SQLite database file

- [SQLite DB](https://github.com/aditi9975/swati_creation/blob/main/instance/swati_creation.db): local database · File-backed application data store · `instance/swati_creation.db`

## Connections

- Browser → App: requests · HTTP traffic enters the Flask app
- App → Config: loads · App configuration includes database and environment settings
- App → Forms: validates with · Route handlers use forms for input validation
- App → Models: reads/writes · Business logic persists data through ORM models
- Models → SQLite DB: stores · Database entities are persisted in the local SQLite file
- App → Base Layout: renders · Shared layout is used across pages
- App → Home: renders · Landing page response
- App → Shop: renders · Catalog page response
- App → Login: renders · Authentication page response
- App → Signup: renders · Registration page response
- App → Cart: renders · Cart page response
- App → Admin Dash: renders · Admin dashboard response
- App → Add Product: renders · Admin create-product response
- App → Edit Product: renders · Admin edit-product response
- App → User Dash: renders · User dashboard response
- App → Product Detail: renders · Product detail response
- Base Layout → Styles: includes · Shared styling is loaded by templates
- Base Layout → Main JS: includes · Shared client-side behavior is loaded by templates
- Home → Intro Video: uses · Homepage references local promotional media
- Add Product → Uploads: uploads · Product images are stored in the local uploads directory
- Edit Product → Uploads: uploads · Edited product images may reuse local uploads storage
- Product Detail → Uploads: displays · Product detail pages render uploaded images
