# localgroup/wishbox architecture

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

- Interactive diagram: https://gitdiagram.com/localgroup/wishbox
- Repository: https://github.com/localgroup/wishbox

## Overview

##### Project type and purpose
- **Type:** Full-stack e-commerce web application
- **Purpose:** Provide product listings, user account management, shopping cart, and order processing features via a Django backend and a Bootstrap-powered frontend.

##### File structure
- **Top-level:**
- manage.py, ecom/ (project settings & WSGI/ASGI)
- cart/, store/, payment_app/ (three Django “apps”)
- static/ & staticfiles/ (development and collected assets)
- media/uploads (user-uploaded product assets)
- db.sqlite3 (local DB; replaced by PostgreSQL in prod)
- **Apps:**
- store: product catalog, user registration/login, search, profiles
- cart: session-based shopping cart logic, context processors, cart summary template
- payment_app: checkout workflow, order & shipping models, billing forms, admin dashboard
- **Config files:**
- ecom/settings.py (DB, static/media config, installed apps, middleware)
- Procfile, runtime.txt, requirements.txt (deployment on Railway)

##### README for additional insights
- **Stack:** Django (MTV pattern), PostgreSQL, HTML/CSS/JS/Bootstrap
- **Deployment:** Hosted on Railway; production URL provided

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Clients and Services
    Client["Web Browser / Mobile"]:::external
    EmailService["Email/SMS Service"]:::external
    CDN["CDN / Static Server"]:::external

    %% Railway Hosting Boundary
    subgraph "Railway (Hosting)"
        direction TB

        %% Web Server
        WebServer["Django Web Server\n(Gunicorn/ASGI)"]:::backend

        %% Django Project Settings & Entry
        subgraph "Project Settings & Entry"
            direction TB
            manage["manage.py"]:::backend
            settings["ecom/settings.py"]:::backend
            ecom_urls["ecom/urls.py"]:::backend
            asgi["ecom/asgi.py"]:::backend
            wsgi["ecom/wsgi.py"]:::backend
        end

        %% URL Dispatcher and Context Processor
        URLDispatcher["URL Dispatcher"]:::backend
        ContextProcessor["Cart Context Processor"]:::backend

        %% Django Apps
        subgraph "Django Apps"
            direction TB
            storeApp["store app"]:::backend
            cartApp["cart app"]:::backend
            paymentApp["payment_app"]:::backend
        end

        %% ORM Layer
        ORM["Django ORM"]:::backend

        %% Deployment Config
        procfile["Procfile"]:::backend

    end

    %% Data Stores
    DB["PostgreSQL Database"]:::datastore
    MediaStorage["Media Storage"]:::datastore

    %% Static Assets
    staticDev["static/"]:::datastore
    staticProd["staticfiles/"]:::datastore
    media["media/uploads/product/"]:::datastore

    %% Connections
    Client -->|"HTTP(S) request/response"| WebServer
    WebServer -->|"routes via"| URLDispatcher
    WebServer -->|uses| ContextProcessor

    URLDispatcher -->|handles URLs| storeApp
    URLDispatcher -->|handles URLs| cartApp
    URLDispatcher -->|handles URLs| paymentApp

    storeApp -->|"ORM queries"| ORM
    cartApp -->|"ORM queries"| ORM
    paymentApp -->|"ORM queries"| ORM

    ORM -->|"SQL queries"| DB

    WebServer -->|"renders templates"| Client
    WebServer -->|"serves assets"| CDN
    WebServer -->|"stores/uploads"| MediaStorage
    WebServer -->|"deployment config"| procfile
    WebServer -->|"sends notifications"| EmailService

    WebServer --> staticDev
    WebServer --> staticProd
    WebServer --> media

    %% Click Events
    click manage "https://github.com/localgroup/wishbox/blob/master/manage.py"
    click settings "https://github.com/localgroup/wishbox/blob/master/ecom/settings.py"
    click ecom_urls "https://github.com/localgroup/wishbox/blob/master/ecom/urls.py"
    click asgi "https://github.com/localgroup/wishbox/blob/master/ecom/asgi.py"
    click wsgi "https://github.com/localgroup/wishbox/blob/master/ecom/wsgi.py"
    click storeApp "https://github.com/localgroup/wishbox/tree/master/store/"
    click cartApp "https://github.com/localgroup/wishbox/tree/master/cart/"
    click paymentApp "https://github.com/localgroup/wishbox/tree/master/payment_app/"
    click staticDev "https://github.com/localgroup/wishbox/tree/master/static/"
    click staticProd "https://github.com/localgroup/wishbox/tree/master/staticfiles/"
    click media "https://github.com/localgroup/wishbox/tree/master/media/uploads/product/"
    click procfile "https://github.com/localgroup/wishbox/tree/master/Procfile"

    %% Styles
    classDef frontend fill:#E3F2FD,stroke:#90CAF9
    classDef backend fill:#E8F5E9,stroke:#A5D6A7
    classDef datastore fill:#FFF3E0,stroke:#FFB74D
    classDef external fill:#ECEFF1,stroke:#B0BEC5

    class Client,CDN,EmailService external
    class WebServer,manage,settings,ecom_urls,asgi,wsgi,URLDispatcher,ContextProcessor,storeApp,cartApp,paymentApp,procfile backend
    class ORM backend
    class DB,MediaStorage,staticDev,staticProd,media datastore
```
