# bmtymrak/allup-blower architecture

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

- Interactive diagram: https://gitdiagram.com/bmtymrak/allup-blower
- Repository: https://github.com/bmtymrak/allup-blower

## Overview

##### Main System Components

a) Web Application Layer
- Django Framework (Core)
- Three main Django apps:
- Accounts (User Management)
- Customers (Core Business Logic)
- Pages (Static Content)

b) Data Layer
- Database (PostgreSQL/SQLite)
- AWS S3 for media storage

c) Frontend Layer
- Django Templates
- Static Assets (CSS/JS)
- Responsive UI (mobile/desktop views)

##### Component Relationships

a) User Flow:
- Authentication Flow (django-allauth)
- Route Management Flow
- Customer Management Flow

b) Data Flow:
- Media Upload Pipeline (local → AWS S3)
- CSV Import/Export Pipeline
- Route Navigation Flow

##### Detailed Component Breakdown

a) Authentication Layer:
**[User] → [django-allauth] → [CustomUser Model]**

b) Customer Management:
**[Customer Model] ← → [Route Model]**
- ↓
- [Session Model]
- ↓
- [SessionVisit Model]

c) Storage Systems:
**[Media Files] → [AWS S3]**
**[Static Files] → [Local Storage]**

##### Key Architectural Patterns to Highlight

- MVT (Model-View-Template) Pattern
- Service-oriented media storage
- Responsive design architecture
- Route optimization system

##### Storage Layer (Database + S3)

- Component types
- Interaction patterns

Remember to include:
- Authentication flows
- Route optimization paths
- Media handling pipelines
- Customer data management
- Session tracking system
- Mobile vs desktop interfaces

This will provide a comprehensive view of the system while maintaining clarity on its core purpose of managing snow removal routes and customer information.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface"
        UI_Mobile["Mobile Interface"]
        UI_Desktop["Desktop Interface"]
        Templates[/"Django Templates"/]
        click Templates "https://github.com/bmtymrak/allup-blower/blob/main/templates/_base.html"
    end

    subgraph "Application Layer"
        Django["Django Core"]
        click Django "https://github.com/bmtymrak/allup-blower/blob/main/project/settings.py"

        subgraph "Django Apps"
            Accounts["Accounts App"]
            click Accounts "https://github.com/bmtymrak/allup-blower/tree/main/accounts/"
            Customers["Customers App"]
            click Customers "https://github.com/bmtymrak/allup-blower/tree/main/customers/"
            Pages["Pages App"]
            click Pages "https://github.com/bmtymrak/allup-blower/tree/main/pages/"
        end

        subgraph "Authentication"
            Auth["django-allauth"]
            UserModel["Custom User Model"]
            click UserModel "https://github.com/bmtymrak/allup-blower/blob/main/accounts/models.py"
            UserForms["User Forms"]
            click UserForms "https://github.com/bmtymrak/allup-blower/blob/main/accounts/forms.py"
        end

        subgraph "Customer Management"
            CustomerModel["Customer Model"]
            click CustomerModel "https://github.com/bmtymrak/allup-blower/blob/main/customers/models.py"
            RouteModel["Route Model"]
            SessionModel["Session Model"]
            SessionVisit["SessionVisit Model"]
            CustomerViews["Customer Views"]
            click CustomerViews "https://github.com/bmtymrak/allup-blower/blob/main/customers/views.py"
            CustomerForms["Customer Forms"]
            click CustomerForms "https://github.com/bmtymrak/allup-blower/blob/main/customers/forms.py"
        end
    end

    subgraph "Storage Layer"
        Database[(Database)]
        S3["AWS S3"]
        click S3 "https://github.com/bmtymrak/allup-blower/blob/main/project/storages_backends.py"
        StaticFiles["Static Files"]
        click StaticFiles "https://github.com/bmtymrak/allup-blower/tree/main/static/"
        MediaFiles["Media Files"]
    end

    %% Relationships
    UI_Mobile --> Templates
    UI_Desktop --> Templates
    Templates --> Django

    Django --> Accounts
    Django --> Customers
    Django --> Pages

    Auth --> UserModel
    UserModel --> UserForms

    CustomerModel --> RouteModel
    RouteModel --> SessionModel
    SessionModel --> SessionVisit
    CustomerModel --> CustomerViews
    CustomerModel --> CustomerForms

    Customers --> Database
    Accounts --> Database
    MediaFiles --> S3
    StaticFiles --> Templates

    %% Styling
    classDef interface fill:#f9f,stroke:#333
    classDef app fill:#aaf,stroke:#333
    classDef model fill:#ff9,stroke:#333
    classDef storage fill:#9f9,stroke:#333
    classDef auth fill:#f99,stroke:#333

    class UI_Mobile,UI_Desktop interface
    class Accounts,Customers,Pages app
    class CustomerModel,RouteModel,SessionModel,SessionVisit model
    class Database,S3,StaticFiles,MediaFiles storage
    class Auth,UserModel,UserForms auth

    %% Legend
    subgraph Legend
        L1["Interface Components"]:::interface
        L2["Django Apps"]:::app
        L3["Data Models"]:::model
        L4["Storage Systems"]:::storage
        L5["Authentication"]:::auth
    end
```
