# imsaurabh1/homecentre architecture

> Architecture diagram of the GitHub repository imsaurabh1/homecentre, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imsaurabh1/homecentre
- Repository: https://github.com/imsaurabh1/homecentre

## Overview

##### Project type and purpose
- This is a monolithic, full-stack Django e-commerce application (“homecentre”).
- It provides user authentication (signup, login, account management), product catalog & search, shopping cart, checkout with Stripe payments, order processing, and an admin interface for managing categories, products, and orders.

##### File structure
- Top-level Django project:
- homecentre/ – project settings (asgi.py, wsgi.py, settings.py, urls.py)
- manage.py
- db.sqlite3 – development database
- requirements.txt
- Django apps:
- core/ – user management, home & shop pages, account forms/views/templates
- product/ – product models, list/detail views, templates, filters, search
- cart/ – cart management (add/remove/update), context processors, templates
- order/ – order models, views, checkout forms, migrations
- media/ – user-uploaded files & UI snapshots
- templates/ – organized per app under each app’s templates/ subfolder
- No microservices: a single process handles all apps, using Django’s MTV pattern.

##### README for additional insights
- Tech stack: Python 3, Django, SQLite, stripe
- Functional flows: signup/login → browse shop → add to cart → checkout → Stripe API → success page
- Admin: built-in Django admin for CRUD on products, categories, orders

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    Browser["Web Browser"]:::client

    %% Django Web Server
    subgraph "Django Web Server"
        Settings["Settings"]:::django
        Router["URL Router"]:::django
        ASGI["ASGI Entry Point"]:::django
        WSGI["WSGI Entry Point"]:::django
        Manage["manage.py"]:::django
        Requirements["requirements.txt"]:::django

        %% Core App
        subgraph "Core App"
            CoreModels["core/models.py"]:::django
            CoreViews["core/views.py"]:::django
            CoreForms["core/forms.py"]:::django
            CoreURLs["core/urls.py"]:::django
            CoreTemplates["core/templates"]:::django
            CoreAdmin["core/admin.py"]:::django
        end

        %% Product App
        subgraph "Product App"
            ProdModels["product/models.py"]:::django
            ProdViews["product/views.py"]:::django
            ProdURLs["product/urls.py"]:::django
            ProdTemplates["product/templates"]:::django
            ProdAdmin["product/admin.py"]:::django
        end

        %% Cart App
        subgraph "Cart App"
            CartLogic["cart/cart.py"]:::django
            CartModels["cart/models.py"]:::django
            CartCtx["cart/context_processors.py"]:::django
            CartViews["cart/views.py"]:::django
            CartURLs["cart/urls.py"]:::django
            CartTemplates["cart/templates"]:::django
            CartAdmin["cart/admin.py"]:::django
        end

        %% Order App
        subgraph "Order App"
            OrderModels["order/models.py"]:::django
            OrderViews["order/views.py"]:::django
            OrderURLs["order/urls.py"]:::django
            OrderMigs["order/migrations"]:::django
            OrderAdmin["order/admin.py"]:::django
        end

        %% Internal Flow
        ASGI --> Router
        WSGI --> Router
        Router --> CoreURLs
        Router --> ProdURLs
        Router --> CartURLs
        Router --> OrderURLs

        CoreURLs --> CoreViews
        ProdURLs --> ProdViews
        CartURLs --> CartViews
        OrderURLs --> OrderViews

        CoreViews --> CoreModels
        ProdViews --> ProdModels
        CartViews --> CartModels
        OrderViews --> OrderModels

        CoreViews --> CoreTemplates
        ProdViews --> ProdTemplates
        CartViews --> CartTemplates
        OrderViews --> CartTemplates
        CartCtx --> CartTemplates

    end

    %% Presentation to Client
    CoreTemplates --> Browser
    ProdTemplates --> Browser
    CartTemplates --> Browser
    OrderViews -->|"checkout request"| Stripe
    Stripe -->|"payment result"| OrderViews

    %% Storage Layer
    ORM["Django ORM"]:::django
    ORM --> DB
    CoreModels --> ORM
    ProdModels --> ORM
    CartModels --> ORM
    OrderModels --> ORM

    DB["SQLite Database"]:::storage
    Media["Media & Static Store"]:::storage

    Browser -->|"static/media request"| Media
    CartViews --> Media
    ProdViews --> Media

    %% Admin Interface
    Browser -->|"Admin UI"| AdminUI["Django Admin Interface"]:::django
    AdminUI --> Router
    AdminUI --> DB

    %% Management & Configuration Links
    Settings --> Router
    Manage --> ASGI
    Manage --> WSGI
    Requirements --> Settings

    %% External Service
    Stripe["Stripe Payment Gateway"]:::external

    %% Click Events
    click Settings "https://github.com/imsaurabh1/homecentre/blob/master/homecentre/settings.py"
    click Router "https://github.com/imsaurabh1/homecentre/blob/master/homecentre/urls.py"
    click ASGI "https://github.com/imsaurabh1/homecentre/blob/master/homecentre/asgi.py"
    click WSGI "https://github.com/imsaurabh1/homecentre/blob/master/homecentre/wsgi.py"
    click Manage "https://github.com/imsaurabh1/homecentre/blob/master/manage.py"
    click Requirements "https://github.com/imsaurabh1/homecentre/blob/master/requirements.txt"
    click DB "https://github.com/imsaurabh1/homecentre/blob/master/db.sqlite3"
    click Media "https://github.com/imsaurabh1/homecentre/tree/master/media/uploads/"
    click CoreModels "https://github.com/imsaurabh1/homecentre/blob/master/core/models.py"
    click CoreViews "https://github.com/imsaurabh1/homecentre/blob/master/core/views.py"
    click CoreForms "https://github.com/imsaurabh1/homecentre/blob/master/core/forms.py"
    click CoreURLs "https://github.com/imsaurabh1/homecentre/blob/master/core/urls.py"
    click CoreTemplates "https://github.com/imsaurabh1/homecentre/tree/master/core/templates/core/"
    click CoreAdmin "https://github.com/imsaurabh1/homecentre/blob/master/core/admin.py"
    click ProdModels "https://github.com/imsaurabh1/homecentre/blob/master/product/models.py"
    click ProdViews "https://github.com/imsaurabh1/homecentre/blob/master/product/views.py"
    click ProdURLs "https://github.com/imsaurabh1/homecentre/blob/master/product/urls.py"
    click ProdTemplates "https://github.com/imsaurabh1/homecentre/tree/master/product/templates/product/"
    click ProdAdmin "https://github.com/imsaurabh1/homecentre/blob/master/product/admin.py"
    click CartLogic "https://github.com/imsaurabh1/homecentre/blob/master/cart/cart.py"
    click CartModels "https://github.com/imsaurabh1/homecentre/blob/master/cart/models.py"
    click CartCtx "https://github.com/imsaurabh1/homecentre/blob/master/cart/context_processors.py"
    click CartViews "https://github.com/imsaurabh1/homecentre/blob/master/cart/views.py"
    click CartURLs "https://github.com/imsaurabh1/homecentre/blob/master/cart/urls.py"
    click CartTemplates "https://github.com/imsaurabh1/homecentre/tree/master/cart/templates/cart/"
    click CartAdmin "https://github.com/imsaurabh1/homecentre/blob/master/cart/admin.py"
    click OrderModels "https://github.com/imsaurabh1/homecentre/blob/master/order/models.py"
    click OrderViews "https://github.com/imsaurabh1/homecentre/blob/master/order/views.py"
    click OrderURLs "https://github.com/imsaurabh1/homecentre/blob/master/order/urls.py"
    click OrderMigs "https://github.com/imsaurabh1/homecentre/tree/master/order/migrations/"
    click OrderAdmin "https://github.com/imsaurabh1/homecentre/blob/master/order/admin.py"

    %% Styles
    classDef django fill:#AED6F1,stroke:#2E86C1,stroke-width:1px
    classDef storage fill:#A9DFBF,stroke:#27AE60,stroke-width:1px
    classDef external fill:#F5B041,stroke:#B9770E,stroke-width:1px
    classDef client fill:#D7DBDD,stroke:#808B96,stroke-width:1px
```
