# duarteocarmo/governosombra architecture

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

- Interactive diagram: https://gitdiagram.com/duarteocarmo/governosombra
- Repository: https://github.com/duarteocarmo/governosombra

## Overview

##### Core Application Components
- Main Application Service (Rust-based)
- Transcript Processing Engine
- Template Rendering System
- Model Management System

##### Storage Components
- Episodes Directory Storage
- Transcripts Directory Storage
- GGML Model Storage (indicated by download-ggml-model.sh)

##### External Dependencies
- Docker Container Runtime
- GGML Model Source

##### Component Relationships
- Model Download Flow: GGML Source → Model Storage → Application
- Processing Flow: Episodes → Rust Core → Transcripts
- Template Rendering: Templates → Rust Core → Generated Output
- Container Architecture: Docker → Application Components

##### Specific Implementation Details
- Relationship between src/main.rs and src/process.rs
- Template processing for three HTML templates (index, books, episode)
- Containerized nature of the application

##### Technical Stack Indicators
- Rust Runtime
- GGML Model Integration
- HTML Template Engine
- Docker/Docker Compose Infrastructure

**[External Dependencies] → [Core Application] → [Storage]**
- ↑                      ↑                  ↑

- [Docker Infrastructure] [Templates]    [Processed Data]

##### Data processing pipeline
- Input: Episodes
- Processing: Rust Core (process.rs)
- Output: Transcripts

##### Containerization layer
- Docker container boundary
- Docker Compose service definition
- Volume mappings for persistent storage

##### Template Processing
- HTML template files
- Template engine integration
- Output generation flow

##### Model Management
- GGML model download process
- Model storage location
- Model integration with processing engine

- Application logic (src/)
- Data storage (episodes/, transcripts/)
- Presentation layer (templates/)
- Infrastructure (Docker)

This will provide a clear understanding of how the system processes transcripts, manages templates, and handles data flow while maintaining a containerized environment.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External
        GGML[GGML Model Source]
        Docker[Docker Runtime]:::infrastructure
    end

    subgraph Core["Core Application Layer"]
        Main["Main Service"]:::core
        Process["Processing Engine"]:::core
        ModelMgmt["Model Management"]:::core
        TemplateEngine["Template Engine"]:::core
    end

    subgraph Storage["Storage Layer"]
        Episodes["Episodes Storage"]:::storage
        Transcripts["Transcripts Storage"]:::storage
        Models["GGML Model Storage"]:::storage
    end

    subgraph Templates["Template Layer"]
        MainTemplate["Main Template"]:::template
        BooksTemplate["Books Template"]:::template
        EpisodeTemplate["Episode Template"]:::template
    end

    subgraph Infrastructure["Container Infrastructure"]
        Dockerfile["Docker Container"]:::infrastructure
        DockerCompose["Docker Compose"]:::infrastructure
        Build["Build System"]:::infrastructure
    end

    %% Relationships
    GGML --> ModelMgmt
    ModelMgmt --> Models
    Episodes --> Process
    Process --> Transcripts
    Main --> Process
    TemplateEngine --> MainTemplate
    TemplateEngine --> BooksTemplate
    TemplateEngine --> EpisodeTemplate
    Docker --> Dockerfile
    Dockerfile --> DockerCompose
    DockerCompose --> Build

    %% Click Events
    click Main "https://github.com/duarteocarmo/governosombra/blob/master/src/main.rs"
    click Process "https://github.com/duarteocarmo/governosombra/blob/master/src/process.rs"
    click TemplateEngine "https://github.com/duarteocarmo/governosombra/tree/master/templates/"
    click MainTemplate "https://github.com/duarteocarmo/governosombra/blob/master/templates/index.html"
    click BooksTemplate "https://github.com/duarteocarmo/governosombra/blob/master/templates/books.html"
    click EpisodeTemplate "https://github.com/duarteocarmo/governosombra/blob/master/templates/episode.html"
    click ModelMgmt "https://github.com/duarteocarmo/governosombra/blob/master/download-ggml-model.sh"
    click Episodes "https://github.com/duarteocarmo/governosombra/tree/master/episodes/"
    click Transcripts "https://github.com/duarteocarmo/governosombra/tree/master/transcripts/"
    click Dockerfile "https://github.com/duarteocarmo/governosombra/tree/master/Dockerfile"
    click DockerCompose "https://github.com/duarteocarmo/governosombra/blob/master/docker-compose.yml"
    click Build "https://github.com/duarteocarmo/governosombra/tree/master/Makefile"

    %% Styling
    classDef core fill:#2374ab
    classDef storage fill:#57a773
    classDef infrastructure fill:#484848
    classDef template fill:#7d4cdb
    classDef external fill:#ff7f50

    %% Legend
    subgraph Legend
        CoreL["Core Component"]:::core
        StorageL["Storage"]:::storage
        InfraL["Infrastructure"]:::infrastructure
        TemplateL["Template"]:::template
        ExternalL["External"]:::external
    end
```
