# vnt87/textpod-toc architecture

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

- Interactive diagram: https://gitdiagram.com/vnt87/textpod-toc
- Repository: https://github.com/vnt87/textpod-toc

## Overview

##### Main Components Identification
The system consists of these primary components:

a) Frontend Layer:
- Static assets (in /public and /src/css, /src/js)
- HTML entry point (src/index.html)
- Progressive Web App components (manifest.json, service-worker.js)

b) Backend Layer:
- Rust-based server (src/main.rs)
- Local storage system

**[Client Browser] → [Progressive Web App Layer] → [Rust Backend Server] → [Local Storage]**

##### Client-Server Communication
- Browser ←→ Rust Server (Port 3000)
##### Data Persistence Flow
- Rust Server ←→ Local Storage
##### PWA Features
- Service Worker ←→ Browser Cache

- Docker Container (Primary deployment)
- Local Development
- Vercel Deployment

##### Additional Elements

- Component type indicators
- Version/environment indicators

Remember to include both development and production deployment paths, as the application supports multiple deployment options (Docker, local build, and Vercel).

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
        PWA["Progressive Web App"]
        SW["Service Worker"]:::pwa
        Manifest["Web Manifest"]:::pwa
        UI["UI Components"]:::frontend
        JS["JavaScript"]:::frontend
        CSS["CSS Styles"]:::frontend
    end

    subgraph Server
        RustServer["Rust Backend Server"]:::backend
        FileSystem["File System Interface"]:::backend
    end

    subgraph Storage
        LocalStorage[(Local Storage)]:::storage
        DockerVol[(Docker Volume)]:::storage
    end

    subgraph Deployment
        Docker["Docker Container"]:::deploy
        Local["Local Development"]:::deploy
        Vercel["Vercel Platform"]:::deploy
    end

    %% Relationships
    Browser --> PWA
    PWA --> SW
    PWA --> Manifest
    PWA --> UI
    UI --> JS
    UI --> CSS
    Browser <--> RustServer
    RustServer <--> FileSystem
    FileSystem <--> LocalStorage
    FileSystem <--> DockerVol
    RustServer --> Docker
    RustServer --> Local
    RustServer --> Vercel

    %% Click Events
    click JS "https://github.com/vnt87/textpod-toc/blob/main/src/js/main.js"
    click CSS "https://github.com/vnt87/textpod-toc/blob/main/src/css/main.css"
    click SW "https://github.com/vnt87/textpod-toc/blob/main/public/service-worker.js"
    click Manifest "https://github.com/vnt87/textpod-toc/blob/main/public/manifest.json"
    click RustServer "https://github.com/vnt87/textpod-toc/blob/main/src/main.rs"
    click Docker "https://github.com/vnt87/textpod-toc/tree/main/Dockerfile"

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef pwa fill:#2ecc71,stroke:#27ae60,color:white
    classDef backend fill:#e67e22,stroke:#d35400,color:white
    classDef storage fill:#9b59b6,stroke:#8e44ad,color:white
    classDef deploy fill:#34495e,stroke:#2c3e50,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        PWAComp["PWA Component"]:::pwa
        BackendComp["Backend Component"]:::backend
        StorageComp["Storage Component"]:::storage
        DeployComp["Deployment Platform"]:::deploy
    end
```
