# toviaferna/turbo-potato architecture

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

- Interactive diagram: https://gitdiagram.com/toviaferna/turbo-potato
- Repository: https://github.com/toviaferna/turbo-potato

## Overview

##### Project type and purpose
- Turbo-Potato is a Python/Django full-stack web application—a modular monolith—designed to manage agricultural operations (farming, inventory, sales, finance, supplies), user authentication, reporting and documentation.
- It is packaged for containerized deployment (Docker, Gunicorn, Nginx, Heroku/Procfile) and includes both a runtime web app and a static user-guide site (MkDocs).

##### File structure
- Top level:
- apps/ – Django “apps” (authentication, documentation, farming, finance, home, inventory, reports, sales, supplies)
- core/ – project settings, WSGI/ASGI, common utilities, templates, staticfiles config
- templates/ & apps/*/templates/ – Jinja/Django templates for UI
- apps/static/ & core/staticfiles/ – CSS/JS/image assets
- docs/ + site/ – MkDocs source and generated static site
- Dockerfile, docker-compose.yml, nginx/, gunicorn-cfg.py, Procfile – container and deployment config
- manage.py, requirements.txt – Django CLI and dependencies

##### README for insights
- Confirms Django usage, local development commands, virtual-env setup, migrations, runserver.

##### Detail without over-splitting
- Static asset paths and template rendering flow at a high level.
- Deployment units (Docker containers, services) vs. logical components (apps, database).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layers (top to bottom)
    Browser["Browser (End User)"]:::client
    subgraph "Edge / Ingress Layer"
        Nginx["Nginx (Reverse Proxy)"]:::infra
    end
    subgraph "Application Server Layer"
        Gunicorn["Gunicorn WSGI Server"]:::infra
    end
    subgraph "Django Monolith" 
        direction TB
        subgraph "Core"
            CoreSettings["core/settings.py"]:::app
            WSGI["core/wsgi.py"]:::app
            ASGI["core/asgi.py"]:::app
            Manage["manage.py"]:::app
            Utils["core/utils.py"]:::app
            Context["core/context_processors.py"]:::app
            Mixins["core/mixins.py"]:::app
            ViewsCore["core/views.py"]:::app
            Widgets["core/widgets.py"]:::app
            UrlsCore["core/urls.py"]:::app
        end
        subgraph "Apps"
            direction TB
            Auth["apps/authentication/"]:::app
            Home["apps/home/"]:::app
            Farming["apps/farming/"]:::app
            Inventory["apps/inventory/"]:::app
            Finance["apps/finance/"]:::app
            Sales["apps/sales/"]:::app
            Supplies["apps/supplies/"]:::app
            Reports["apps/reports/"]:::app
            DocumentationApp["apps/documentation/"]:::app
            Templates["apps/templates/"]:::app
        end
    end
    subgraph "Data Layer"
        DB["Relational DB\n(PostgreSQL/MySQL)"]:::data
    end
    subgraph "Static Content Layer"
        AppStatic["apps/static/assets/"]:::static
        CoreStatic["core/staticfiles/"]:::static
    end
    subgraph "Documentation Pipeline"
        DocsSrc["docs/ (MkDocs source)"]:::docs
        MkDocs["mkdocs.yml"]:::docs
        Site["site/ (generated)"]:::docs
    end
    subgraph "Deployment Configuration"
        Dockerfile["Dockerfile"]:::infra
        Compose["docker-compose.yml"]:::infra
        Procfile["Procfile"]:::infra
        Runtime["runtime.txt"]:::infra
    end

    %% Connections
    Browser -->|HTTP/HTTPS| Nginx
    Nginx -->|proxy_pass| Gunicorn
    Gunicorn -->|WSGI| CoreSettings
    CoreSettings -->|ORM| DB
    CoreSettings --> ViewsCore
    ViewsCore -->|renders| Templates
    ViewsCore -->|serves| AppStatic
    AppStatic -->|served by| Nginx
    CoreStatic -->|collected| Nginx
    Auth --> CoreSettings
    Home --> CoreSettings
    Farming --> CoreSettings
    Inventory --> CoreSettings
    Finance --> CoreSettings
    Sales --> CoreSettings
    Supplies --> CoreSettings
    Reports --> CoreSettings
    DocumentationApp --> CoreSettings
    DocsSrc --> MkDocs
    MkDocs --> Site
    Site -->|static serve| Nginx

    %% Click Events
    click Nginx "https://github.com/toviaferna/turbo-potato/blob/master/nginx/appseed-app.conf"
    click Gunicorn "https://github.com/toviaferna/turbo-potato/blob/master/gunicorn-cfg.py"
    click CoreSettings "https://github.com/toviaferna/turbo-potato/blob/master/core/settings.py"
    click WSGI "https://github.com/toviaferna/turbo-potato/blob/master/core/wsgi.py"
    click ASGI "https://github.com/toviaferna/turbo-potato/blob/master/core/asgi.py"
    click Manage "https://github.com/toviaferna/turbo-potato/blob/master/manage.py"
    click Utils "https://github.com/toviaferna/turbo-potato/blob/master/core/utils.py"
    click Context "https://github.com/toviaferna/turbo-potato/blob/master/core/context_processors.py"
    click Mixins "https://github.com/toviaferna/turbo-potato/blob/master/core/mixins.py"
    click ViewsCore "https://github.com/toviaferna/turbo-potato/blob/master/core/views.py"
    click Widgets "https://github.com/toviaferna/turbo-potato/blob/master/core/widgets.py"
    click UrlsCore "https://github.com/toviaferna/turbo-potato/blob/master/core/urls.py"
    click Auth "https://github.com/toviaferna/turbo-potato/tree/master/apps/authentication/"
    click Home "https://github.com/toviaferna/turbo-potato/tree/master/apps/home/"
    click Farming "https://github.com/toviaferna/turbo-potato/tree/master/apps/farming/"
    click Inventory "https://github.com/toviaferna/turbo-potato/tree/master/apps/inventory/"
    click Finance "https://github.com/toviaferna/turbo-potato/tree/master/apps/finance/"
    click Sales "https://github.com/toviaferna/turbo-potato/tree/master/apps/sales/"
    click Supplies "https://github.com/toviaferna/turbo-potato/tree/master/apps/supplies/"
    click Reports "https://github.com/toviaferna/turbo-potato/tree/master/apps/reports/"
    click DocumentationApp "https://github.com/toviaferna/turbo-potato/tree/master/apps/documentation/"
    click Templates "https://github.com/toviaferna/turbo-potato/tree/master/apps/templates/"
    click AppStatic "https://github.com/toviaferna/turbo-potato/tree/master/apps/static/assets/"
    click CoreStatic "https://github.com/toviaferna/turbo-potato/tree/master/core/staticfiles/"
    click Dockerfile "https://github.com/toviaferna/turbo-potato/tree/master/Dockerfile"
    click Compose "https://github.com/toviaferna/turbo-potato/blob/master/docker-compose.yml"
    click Procfile "https://github.com/toviaferna/turbo-potato/tree/master/Procfile"
    click Runtime "https://github.com/toviaferna/turbo-potato/blob/master/runtime.txt"
    click DocsSrc "https://github.com/toviaferna/turbo-potato/tree/master/docs/"
    click MkDocs "https://github.com/toviaferna/turbo-potato/blob/master/mkdocs.yml"
    click Site "https://github.com/toviaferna/turbo-potato/tree/master/site/"

    %% Styles
    classDef client fill:#f9f,stroke:#333,stroke-width:1px;
    classDef infra fill:#bbf,stroke:#333,stroke-width:1px;
    classDef app fill:#bfb,stroke:#333,stroke-width:1px;
    classDef data fill:#fbf,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;
    classDef static fill:#ffe,stroke:#333,stroke-width:1px;
    classDef docs fill:#ddd,stroke:#333,stroke-width:1px;
```
