# highpolar-softwares/bakerydemo architecture

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

- Interactive diagram: https://gitdiagram.com/highpolar-softwares/bakerydemo
- Repository: https://github.com/highpolar-softwares/bakerydemo

## Overview

##### Project type and purpose
- This is a full-stack demonstration website built on Django + Wagtail CMS.
- Purpose: showcase Wagtail features (streamfields, custom page models, snippets, search) via multiple Django “apps” (base, blog, breads, locations, recipes, search).
- It includes a frontend (HTML/CSS/JS templates), a backend (Django/Wagtail), and a relational database for content and user data.

##### File structure
- Top-level config & devops:
- Dockerfile, docker-compose.yml, Procfile, Vagrantfile, GitHub workflows → containerized & CI/CD pipelines
- .env.example, requirements/ → dependency management
- Main codebase under bakerydemo/:
- bakerydemo/settings/ → environment‐specific settings (dev, prod, base)
- bakerydemo/api.py, urls.py, wsgi.py → entry points for HTTP/WSGI
- bakerydemo/static/, bakerydemo/templates/ → static assets & HTML templates for the frontend
- bakerydemo/base, blog, breads, locations, recipes, search → domain-specific Django apps
- Management and data:
- base/management/commands → custom CLI commands (load_initial_data, reset_demo, etc.)
- base/fixtures/bakerydemo.json → initial content dump
- Migration folders in each app → schema evolution
- CI/CD configs in .github/workflows & Travis → linting, Docker builds

##### README for additional insights
- Confirms a demo site for Wagtail, not production-grade
- Describes key features: custom content models, mixins, snippets, admin hooks, search integration (DB search fallback), contact form email backend
- Deployment instructions for various environments (Gitpod, Docker, Vagrant, virtualenv)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Browser["Browser"]:::client
        CDN["Static/CDN"]:::client
    end

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        Nginx["Nginx Reverse Proxy"]:::app
        Gunicorn["Gunicorn/uWSGI"]:::app

        subgraph "Django Application"
            direction TB
            WSGI["WSGI Entry (wsgi.py)"]:::app
            API["API Entry (api.py)"]:::app
            URLs["URL Config (urls.py)"]:::app

            subgraph "Settings Layer"
                direction TB
                BaseS["base.py"]:::app
                DevS["dev.py"]:::app
                ProdS["production.py"]:::app
                LocalS["local.py.example"]:::app
            end

            subgraph "Django Apps"
                direction TB
                BaseApp["Base App"]:::app
                BlogApp["Blog App"]:::app
                BreadsApp["Breads App"]:::app
                LocationsApp["Locations App"]:::app
                RecipesApp["Recipes App"]:::app
                SearchApp["Search App"]:::app
            end
        end
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        Postgres["PostgreSQL Database"]:::db
        Redis["Redis Cache"]:::db
    end

    %% DevOps & Infrastructure
    subgraph "Dev & CI/CD"
        direction TB
        DockerCompose["Docker Compose"]:::infra
        Vagrant["Vagrant VM"]:::infra
        GitHubActions["GitHub Actions"]:::infra
        TravisCI["Travis CI"]:::infra
    end

    %% Connections
    Browser -->|"HTTP/HTTPS"| Nginx
    CDN --> Browser
    Nginx --> Gunicorn
    Gunicorn --> WSGI
    Gunicorn --> API
    WSGI --> URLs
    API --> URLs
    URLs --> BaseS
    URLs --> DevS
    URLs --> ProdS
    URLs --> LocalS
    WSGI --> BaseApp
    WSGI --> BlogApp
    WSGI --> BreadsApp
    WSGI --> LocationsApp
    WSGI --> RecipesApp
    WSGI --> SearchApp
    BaseApp -->|reads/writes| Postgres
    BlogApp -->|reads/writes| Postgres
    BreadsApp -->|reads/writes| Postgres
    LocationsApp -->|reads/writes| Postgres
    RecipesApp -->|reads/writes| Postgres
    SearchApp -->|queries| Postgres
    SearchApp -->|caches| Redis
    DockerCompose --> Gunicorn
    DockerCompose --> Postgres
    DockerCompose --> Redis
    Vagrant --> Gunicorn
    GitHubActions --> DockerCompose
    TravisCI --> DockerCompose

    %% Click Events
    click WSGI "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/wsgi.py"
    click API "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/api.py"
    click BaseS "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/settings/base.py"
    click DevS "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/settings/dev.py"
    click ProdS "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/settings/production.py"
    click LocalS "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/settings/local.py.example"
    click BaseApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/base/models.py"
    click BaseApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/base/blocks.py"
    click BaseApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/base/wagtail_hooks.py"
    click BaseApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/base/fixtures/bakerydemo.json"
    click BaseApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/base/management/commands/load_initial_data.py"
    click BaseApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/base/management/commands/reset_demo.py"
    click BaseApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/base/management/commands/create_random_data.py"
    click BlogApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/blog/models.py"
    click BreadsApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/breads/models.py"
    click BreadsApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/breads/wagtail_hooks.py"
    click LocationsApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/locations/models.py"
    click LocationsApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/locations/choices.py"
    click RecipesApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/recipes/blocks.py"
    click RecipesApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/recipes/models.py"
    click SearchApp "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/search/views.py"
    click URLs "https://github.com/highpolar-softwares/bakerydemo/blob/main/bakerydemo/urls.py"
    click DockerCompose "https://github.com/highpolar-softwares/bakerydemo/blob/main/docker-compose.yml"
    click Vagrant "https://github.com/highpolar-softwares/bakerydemo/tree/main/Vagrantfile"
    click GitHubActions "https://github.com/highpolar-softwares/bakerydemo/blob/main/.github/workflows/docker.yml"
    click TravisCI "https://github.com/highpolar-softwares/bakerydemo/blob/main/.travis.yml"

    %% Styles
    classDef client fill:#D0E8FF,stroke:#0288D1,color:#000
    classDef app fill:#DFF7DF,stroke:#388E3C,color:#000
    classDef db fill:#FFF3E0,stroke:#F57C00,color:#000
    classDef infra fill:#ECEFF1,stroke:#546E7A,color:#000
```
