# madeofpendletonwool/pinepods architecture

> Architecture diagram of the GitHub repository madeofpendletonwool/pinepods, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/madeofpendletonwool/pinepods
- Repository: https://github.com/madeofpendletonwool/pinepods

## Overview

- REST API calls between clients and server
- WebSocket connections for real-time updates

- Database interactions
- External API calls
- Sync service connections

##### Key Components to Highlight

a. Authentication Flow
- User login/registration
- Session management
- MFA support

b. Podcast Management
- Subscription handling
- Episode tracking
- Download management

c. Search and Discovery
- Podcast search functionality
- Host/Person tracking
- Recommendations

##### Deployment Options (Use Container Symbols)

a. Docker Deployment
- Container relationships
- Volume mounts
- Network configuration

b. Kubernetes Deployment
- Helm chart structure
- Service relationships
- Persistent storage

##### Additional Elements

a. Security Layer (Red Border)
- API authentication
- Data encryption
- User permissions

b. Storage Management (Purple Rectangles)
- Download directories
- Backup locations
- Cache management

##### Multi-User Architecture
- How multiple users can access the system simultaneously
- User isolation and data separation

##### Sync Capabilities
- How the system syncs with external services
- Podcast state synchronization across devices

##### Scalability
- Which components can be scaled horizontally
- Load balancing possibilities

##### Mobile Support
- Demonstrate how mobile clients interact with the system
- Offline capabilities

Use these visual conventions:
- Double lines for data replication
- Clear labels for all components and connections
- Version indicators where relevant

Remember to include the project's unique features like PodPeople DB integration and the various deployment options, making it clear how they fit into the overall architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Frontend Layer"
        WC["Web Client (Rust/Yew)"]:::frontend
        subgraph "Native Clients"
            NC["Desktop (Tauri)"]:::frontend
            MC["Mobile (Android/iOS)"]:::frontend
        end
    end

    subgraph "Backend Services"
        MS["Main Server (Rust)"]:::backend
        SS["Search API Service"]:::backend
        PDB["PodPeople DB Service"]:::backend
        VS["Valkey Service (Redis)"]:::backend
    end

    subgraph "Database Layer"
        DB[(PostgreSQL/MariaDB)]:::database
        PDS[(Podcast Data Store)]:::database
        UMS[(User Management Store)]:::database
    end

    subgraph "External Services"
        PI["Podcast Index API"]:::external
        IA["iTunes API"]:::external
        NS["Nextcloud Sync"]:::external
        GS["GPodder Sync"]:::external
    end

    subgraph "Security Layer"
        Auth["Authentication"]:::security
        Enc["Data Encryption"]:::security
        Perm["User Permissions"]:::security
    end

    subgraph "Storage Management"
        DD["Download Directory"]:::storage
        BL["Backup Location"]:::storage
        CM["Cache Management"]:::storage
    end

    %% Connections
    WC --> MS
    NC --> MS
    MC --> MS
    MS --> Auth
    MS --> SS
    MS --> PDB
    MS --> VS
    MS --> DB
    DB --> PDS
    DB --> UMS
    SS --> PI
    SS --> IA
    MS --> NS
    MS --> GS
    Auth --> VS
    VS --> DB

    %% Click Events
    click WC "https://github.com/madeofpendletonwool/PinePods/tree/main/web/src/components/"
    click NC "https://github.com/madeofpendletonwool/PinePods/tree/main/web/src-tauri/"
    click MC "https://github.com/madeofpendletonwool/PinePods/tree/main/web/src-tauri/gen/android/"
    click MS "https://github.com/madeofpendletonwool/PinePods/tree/main/Backend/pinepods_backend/"
    click Auth "https://github.com/madeofpendletonwool/PinePods/blob/main/database_functions/auth_functions.py"
    click VS "https://github.com/madeofpendletonwool/PinePods/blob/main/database_functions/valkey_client.py"
    click DB "https://github.com/madeofpendletonwool/PinePods/tree/main/database_functions/"
    click SS "https://github.com/madeofpendletonwool/PinePods/blob/main/web/src/components/search.rs"
    click PDB "https://github.com/madeofpendletonwool/PinePods/blob/main/web/src/components/podcasts.rs"

    %% Styling
    classDef frontend fill:#a8d1f0
    classDef backend fill:#90EE90
    classDef database fill:#FFEB3B
    classDef external fill:#E0E0E0
    classDef security fill:#FFB6C1
    classDef storage fill:#DDA0DD

    %% Legend
    subgraph Legend
        F[Frontend]:::frontend
        B[Backend]:::backend
        D[(Database)]:::database
        E[External]:::external
        S[Security]:::security
        ST[Storage]:::storage
    end
```
