# azamat1012/flowershop architecture

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

- Interactive diagram: https://gitdiagram.com/azamat1012/flowershop
- Repository: https://github.com/azamat1012/flowershop

## Overview

#### Purpose and entry points
This is a Django-based flower shop service with a customer-facing catalog/order flow, consultation and quiz pages, payment/order result pages, and Django-admin sales operations. Primary process entry points are `manage.py`, `flower_shop_project/wsgi.py`, and `flower_shop_project/asgi.py`. Project routing begins in `flower_shop_project/urls.py`.

#### Application and domain layer
The main business application is `website/`. Its domain models are centralized in `website/models.py`; migrations show the system persists orders, consultations, payment identifiers, and courier-assignment/status-related order data under `website/migrations/`. Form validation/input binding is separated into `website/forms.py`.

#### HTTP routing and request handling
Django dispatches project routes through `flower_shop_project/urls.py` into application routes in `website/urls.py`, with handlers implemented in `website/views.py`. These views are the boundary between browser requests, forms/models, rendered pages, and order-related side effects.

#### Customer purchase journey
The template set defines a server-rendered, multi-step customer experience:
- Shop discovery/catalog and item cards: `templates/index.html`, `templates/catalog.html`, `templates/card.html`
- Guided selection: `templates/quiz.html`, `templates/quiz-step.html`, `templates/result.html`
- Order and payment progression: `templates/order.html`, `templates/order-step.html`, `templates/payment.html`
- Consultation capture: `templates/consultation.html`

Shared layout is composed from `templates/base/main.html`, `templates/base/header.html`, and `templates/base/footer.html`. Static styling and catalog imagery are served from `static/css/main.css` and `static/img/catalog`.

#### Order operations and admin reporting
Django admin is customized in `website/admin.py`. Dedicated admin templates indicate order management and sales reporting extensions: `templates/admin/website/order/change_list.html` and `templates/admin/website/order/sales_dashboard.html`. The order model/migrations are the persistence boundary for pricing, status, payment, and courier workflow changes.

#### Notifications and asynchronous integration boundary
`website/signals.py` likely connects model lifecycle events to secondary actions, while `website/telegram_bot.py` is the repository’s explicit external-notification integration point. Consultation notification migration fields (`website/migrations/0002_consultation_notified_consultation_notified_at.py`) suggest notification delivery state is persisted to prevent or track repeat sends.

#### Runtime and deployment
The service runs on Django, configured by `flower_shop_project/settings.py`, with both WSGI and ASGI interfaces available. Container deployment is defined by `Dockerfile`, `docker-compose.yml`, and `entrypoint.sh`; Python dependencies are declared in `requirements.txt`. No separate frontend build system or standalone API service is present in the tree.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Django Runtime"]
  node_manage{{"Management CLI<br/>Django entry point<br/>[manage.py]"}}
  node_wsgi{{"WSGI interface<br/>deployment entry point<br/>[wsgi.py]"}}
  node_asgi{{"ASGI interface<br/>deployment entry point<br/>[asgi.py]"}}
  node_settings["Project settings<br/>Django configuration<br/>[settings.py]"]
  node_project_urls["Project routes<br/>URL routing<br/>[urls.py]"]
end

subgraph group_app["Website Application"]
  node_app_urls["Website routes<br/>URL routing<br/>[urls.py]"]
  node_views["Request handlers<br/>Django views<br/>[views.py]"]
  node_forms["Input forms<br/>Django forms<br/>[forms.py]"]
  node_models[("Shop domain models<br/>Django ORM<br/>[models.py]")]
  node_migrations["Schema history<br/>Django migrations"]
  node_signals["Lifecycle signals<br/>Django signals<br/>[signals.py]"]
  node_telegram{{"Telegram notifications<br/>external integration<br/>[telegram_bot.py]"}}
end

subgraph group_customer["Customer Experience"]
  node_storefront["Catalog and order pages<br/>server-rendered templates<br/>[order.html]"]
  node_layout["Shared storefront layout<br/>template composition<br/>[main.html]"]
  node_static["Styles and catalog media<br/>static assets<br/>[main.css]"]
end

subgraph group_operations["Sales Operations"]
  node_admin["Admin customization<br/>Django admin<br/>[admin.py]"]
  node_sales_dashboard["Sales reporting<br/>admin template"]
end

subgraph group_deployment["Deployment"]
  node_container{{"Container deployment<br/>Docker Compose stack<br/>[docker-compose.yml]"}}
  node_entrypoint["Container bootstrap<br/>startup script<br/>[entrypoint.sh]"]
end

node_wsgi -->|"loads"| node_settings
node_asgi -->|"loads"| node_settings
node_manage -->|"uses"| node_settings
node_settings -->|"configures"| node_project_urls
node_project_urls -->|"includes"| node_app_urls
node_app_urls -->|"dispatches to"| node_views
node_views -->|"binds and validates"| node_forms
node_views -->|"reads and writes"| node_models
node_views -->|"renders"| node_storefront
node_storefront -->|"composes"| node_layout
node_storefront -->|"uses"| node_static
node_migrations -->|"evolves schema for"| node_models
node_models -.->|"emits lifecycle events"| node_signals
node_signals -.->|"triggers notifications"| node_telegram
node_admin -->|"manages orders"| node_models
node_admin -->|"renders"| node_sales_dashboard
node_container -->|"starts with"| node_entrypoint
node_entrypoint -->|"runs Django commands"| node_manage
node_container -->|"serves application"| node_wsgi

click node_manage "https://github.com/azamat1012/flowershop/blob/main/manage.py"
click node_wsgi "https://github.com/azamat1012/flowershop/blob/main/flower_shop_project/wsgi.py"
click node_asgi "https://github.com/azamat1012/flowershop/blob/main/flower_shop_project/asgi.py"
click node_settings "https://github.com/azamat1012/flowershop/blob/main/flower_shop_project/settings.py"
click node_project_urls "https://github.com/azamat1012/flowershop/blob/main/flower_shop_project/urls.py"
click node_app_urls "https://github.com/azamat1012/flowershop/blob/main/website/urls.py"
click node_views "https://github.com/azamat1012/flowershop/blob/main/website/views.py"
click node_forms "https://github.com/azamat1012/flowershop/blob/main/website/forms.py"
click node_models "https://github.com/azamat1012/flowershop/blob/main/website/models.py"
click node_migrations "https://github.com/azamat1012/flowershop/blob/main/website/migrations/0002_consultation_notified_consultation_notified_at.py"
click node_signals "https://github.com/azamat1012/flowershop/blob/main/website/signals.py"
click node_telegram "https://github.com/azamat1012/flowershop/blob/main/website/telegram_bot.py"
click node_storefront "https://github.com/azamat1012/flowershop/blob/main/templates/order.html"
click node_layout "https://github.com/azamat1012/flowershop/blob/main/templates/base/main.html"
click node_static "https://github.com/azamat1012/flowershop/blob/main/static/css/main.css"
click node_admin "https://github.com/azamat1012/flowershop/blob/main/website/admin.py"
click node_sales_dashboard "https://github.com/azamat1012/flowershop/blob/main/templates/admin/website/order/sales_dashboard.html"
click node_container "https://github.com/azamat1012/flowershop/blob/main/docker-compose.yml"
click node_entrypoint "https://github.com/azamat1012/flowershop/blob/main/entrypoint.sh"

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_manage,node_wsgi,node_asgi,node_settings,node_project_urls toneBlue
class node_app_urls,node_views,node_forms,node_models,node_migrations,node_signals,node_telegram toneAmber
class node_storefront,node_layout,node_static toneMint
class node_admin,node_sales_dashboard toneRose
class node_container,node_entrypoint toneIndigo
```

## Components

### Django Runtime

- [Management CLI](https://github.com/azamat1012/flowershop/blob/main/manage.py): Django entry point · `manage.py`
- [WSGI interface](https://github.com/azamat1012/flowershop/blob/main/flower_shop_project/wsgi.py): deployment entry point · `flower_shop_project/wsgi.py`
- [ASGI interface](https://github.com/azamat1012/flowershop/blob/main/flower_shop_project/asgi.py): deployment entry point · `flower_shop_project/asgi.py`
- [Project settings](https://github.com/azamat1012/flowershop/blob/main/flower_shop_project/settings.py): Django configuration · `flower_shop_project/settings.py`
- [Project routes](https://github.com/azamat1012/flowershop/blob/main/flower_shop_project/urls.py): URL routing · `flower_shop_project/urls.py`

### Website Application

- [Website routes](https://github.com/azamat1012/flowershop/blob/main/website/urls.py): URL routing · `website/urls.py`
- [Request handlers](https://github.com/azamat1012/flowershop/blob/main/website/views.py): Django views · Coordinates forms, models, pages, and order side effects. · `website/views.py`
- [Input forms](https://github.com/azamat1012/flowershop/blob/main/website/forms.py): Django forms · `website/forms.py`
- [Shop domain models](https://github.com/azamat1012/flowershop/blob/main/website/models.py): Django ORM · Persists orders, consultations, payments, courier assignment, and statuses. · `website/models.py`
- [Schema history](https://github.com/azamat1012/flowershop/blob/main/website/migrations/0002_consultation_notified_consultation_notified_at.py): Django migrations · Includes persisted consultation notification state. · `website/migrations/0002_consultation_notified_consultation_notified_at.py`
- [Lifecycle signals](https://github.com/azamat1012/flowershop/blob/main/website/signals.py): Django signals · `website/signals.py`
- [Telegram notifications](https://github.com/azamat1012/flowershop/blob/main/website/telegram_bot.py): external integration · `website/telegram_bot.py`

### Customer Experience

- [Catalog and order pages](https://github.com/azamat1012/flowershop/blob/main/templates/order.html): server-rendered templates · Catalog, quiz, order, payment, and consultation journey. · `templates/order.html`
- [Shared storefront layout](https://github.com/azamat1012/flowershop/blob/main/templates/base/main.html): template composition · `templates/base/main.html`
- [Styles and catalog media](https://github.com/azamat1012/flowershop/blob/main/static/css/main.css): static assets · `static/css/main.css`

### Sales Operations

- [Admin customization](https://github.com/azamat1012/flowershop/blob/main/website/admin.py): Django admin · `website/admin.py`
- [Sales reporting](https://github.com/azamat1012/flowershop/blob/main/templates/admin/website/order/sales_dashboard.html): admin template · `templates/admin/website/order/sales_dashboard.html`

### Deployment

- [Container deployment](https://github.com/azamat1012/flowershop/blob/main/docker-compose.yml): Docker Compose stack · `docker-compose.yml`
- [Container bootstrap](https://github.com/azamat1012/flowershop/blob/main/entrypoint.sh): startup script · `entrypoint.sh`

## Connections

- WSGI interface → Project settings: loads
- ASGI interface → Project settings: loads
- Management CLI → Project settings: uses
- Project settings → Project routes: configures
- Project routes → Website routes: includes
- Website routes → Request handlers: dispatches to
- Request handlers → Input forms: binds and validates
- Request handlers → Shop domain models: reads and writes
- Request handlers → Catalog and order pages: renders
- Catalog and order pages → Shared storefront layout: composes
- Catalog and order pages → Styles and catalog media: uses
- Schema history → Shop domain models: evolves schema for
- Shop domain models → Lifecycle signals: emits lifecycle events
- Lifecycle signals → Telegram notifications: triggers notifications
- Admin customization → Shop domain models: manages orders
- Admin customization → Sales reporting: renders
- Container deployment → Container bootstrap: starts with
- Container bootstrap → Management CLI: runs Django commands
- Container deployment → WSGI interface: serves application
