# nicorenard/visiopompe architecture

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

- Interactive diagram: https://gitdiagram.com/nicorenard/visiopompe
- Repository: https://github.com/nicorenard/visiopompe

## Overview

##### Project type and purpose
- This is a full-stack, monolithic Django web application (“Visiopompe”) for managing a fleet of mechanical pumps and related maintenance equipment.
- It uses Django’s MVC (MVT) pattern for the backend, W3.css for frontend styling, MariaDB (or SQLite by default) for persistence, served via Apache + mod_wsgi in production.

##### File structure
- Top-level:
- src/config: Django project settings, URL routing, WSGI/ASGI entry points
- src/pompe: Main Django app (models, views, templates, static assets, URL config)
- requirements-prod.txt / .env-example: production dependencies & environment variables
- documentations: Sphinx-based standalone docs (user & developer guides)
- Patterns:
- MVT: models.py, views.py, templates/…
- Static/media separation: static assets in src/pompe/static, user‐uploaded media under src/media
- Deployment: Apache 2 + mod_wsgi config lives outside but documented
- Database migrations in src/pompe/migrations

##### Key README insights
- Architecture: Apache serves HTTP, forwards to Django via WSGI; Django ORM → MariaDB
- Frontend: static CSS/JS resources, Django templates render pages
- Admin interface: built-in Django admin for import/export, superuser management
- Documentation: Sphinx site under documentations/ to be served or linked

##### Essential elements
- Don’t overcomplicate—include every Django subcomponent only as part of the WSGI app node
- How Sphinx docs are generated from documentations/ and can be hosted separately
- Environmental config (.env → settings.py) as a startup dependency

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client & Presentation Tier
    subgraph "Client & Presentation"
        Browser["Browser"]:::client
    end

    subgraph "Presentation Layer"
        Static["Static Assets"]:::static
        Media["Media Storage"]:::media
        Docs["Sphinx Documentation"]:::doc
    end

    %% Web & Application Tier
    subgraph "Web & App Tier"
        Apache["Apache 2"]:::webserver
        modwsgi["mod_wsgi"]:::webserver

        subgraph "Django Application"
            subgraph "src/config"
                Settings["settings.py"]:::config
                Urls["urls.py"]:::config
                Wsgi["wsgi.py"]:::config
                Asgi["asgi.py"]:::config
                Manage["manage.py"]:::config
            end

            subgraph "src/pompe"
                Models["models.py"]:::app
                Views["views.py"]:::app
                UrlsP["urls.py"]:::app
                Admin["admin.py"]:::app
                Apps["apps.py"]:::app
                Context["context_processor.py"]:::app
                Filters["filters.py"]:::app
                Forms["forms.py"]:::app
                Resource["resource.py"]:::app
                Utils["utils.py"]:::app
                Migrations["migrations/"]:::app
            end
        end
    end

    %% Data Tier
    subgraph "Data Tier"
        DB["MariaDB / SQLite"]:::database
    end

    %% Environment
    ENV["Environment (.env)"]:::env

    %% Interactions
    Browser -->|"HTTP Request"| Apache
    Apache -->|"Serve Static"| Static
    Apache -->|"Serve Media"| Media
    Apache -->|"Serve Docs"| Docs
    Apache --> modwsgi
    modwsgi -->|"WSGI Call"| Wsgi
    Wsgi --> Settings
    Settings --> Urls
    Urls --> Views
    Views -->|"ORM Query"| DB
    Views --> Resource
    Views --> Forms
    Views --> Filters
    Views --> Context
    ENV --> Settings

    %% Click Events for config
    click Settings "https://github.com/nicorenard/visiopompe/blob/master/src/config/settings.py"
    click Urls "https://github.com/nicorenard/visiopompe/blob/master/src/config/urls.py"
    click Wsgi "https://github.com/nicorenard/visiopompe/blob/master/src/config/wsgi.py"
    click Asgi "https://github.com/nicorenard/visiopompe/blob/master/src/config/asgi.py"
    click Manage "https://github.com/nicorenard/visiopompe/blob/master/src/manage.py"

    %% Click Events for main app
    click Models "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/models.py"
    click Views "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/views.py"
    click UrlsP "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/urls.py"
    click Admin "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/admin.py"
    click Apps "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/apps.py"
    click Context "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/context_processor.py"
    click Filters "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/filters.py"
    click Forms "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/forms.py"
    click Resource "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/resource.py"
    click Utils "https://github.com/nicorenard/visiopompe/blob/master/src/pompe/utils.py"
    click Migrations "https://github.com/nicorenard/visiopompe/tree/master/src/pompe/migrations/"

    %% Click Events for static, media, docs
    click Static "https://github.com/nicorenard/visiopompe/tree/master/src/pompe/static/pompe/"
    click Media "https://github.com/nicorenard/visiopompe/tree/master/src/media/"
    click Docs "https://github.com/nicorenard/visiopompe/tree/master/documentations/build/html/"

    %% Styles
    classDef client fill:#AEDFF7,stroke:#0288D1,color:#000
    classDef webserver fill:#FFE0B2,stroke:#FB8C00,color:#000
    classDef config fill:#E1BEE7,stroke:#8E24AA,color:#000
    classDef app fill:#C8E6C9,stroke:#388E3C,color:#000
    classDef database fill:#FFCDD2,stroke:#E53935,color:#000
    classDef static fill:#FFF9C4,stroke:#FBC02D,color:#000
    classDef media fill:#D7CCC8,stroke:#6D4C41,color:#000
    classDef doc fill:#BBDEFB,stroke:#1976D2,color:#000
    classDef env fill:#CFD8DC,stroke:#455A64,color:#000
```
