# tirthpatell/fia-f1-docs-bot architecture

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

- Interactive diagram: https://gitdiagram.com/tirthpatell/fia-f1-docs-bot
- Repository: https://github.com/tirthpatell/fia-f1-docs-bot

## Overview

##### Component Relationships

- [FIA Website] → [Scraper] → [Document Processor] → [Storage]
- ↓
- [AI Summarization (Gemini)]
- ↓
- [Image Conversion Service] → [Imgur]
- ↓
- [Threads API Client]

##### Key Components Details

- Rectangles: Core services (Scraper, Processor, Storage)
- Clouds: External services (FIA Website, Threads API, Gemini API)
- Hexagons: Processing units (Image Conversion, AI Summarization)

##### Specific Elements

a) Core Services (from pkg directory):
- Scraper Service (pkg/scraper)
- Poster Service (pkg/poster)
- Storage Service (pkg/storage)
- Summary Service (pkg/summary)
- Configuration Management (pkg/config)

b) External Integrations:
- Imgur API
- Threads API
- Google Gemini API
- FIA Website

c) Configuration Elements:
- Environment Variables
- Docker Container Boundary

##### Technical Details
- Go version requirement (1.22+)
- Docker container specifications
- Environment variable dependencies
- Storage volume mappings

- The automated nature of the system
- Clear separation of concerns between components
- External service dependencies
- Data flow through the system
- Configuration requirements

- Connection types (API calls, file operations, etc.)
- Container boundaries
- Environment configurations

Keep the abstraction level focused on the system architecture while including enough detail to understand the complete flow from document scraping to final posting on Threads.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef external fill:#B3E5FC,stroke:#0288D1
    classDef core fill:#C8E6C9,stroke:#388E3C
    classDef processing fill:#FFF9C4,stroke:#FBC02D
    classDef storage fill:#E0E0E0,stroke:#616161
    classDef config fill:#E1BEE7,stroke:#7B1FA2

    %% Main Components
    FIA["FIA Website"]:::external
    Scraper["Document Scraper"]:::core
    DocProc["Document Processor"]:::core
    Gemini["Google Gemini API"]:::external
    ImgConv["Image Conversion"]:::processing
    Imgur["Imgur API"]:::external
    LocalStore[("Local Storage")]:::storage
    ThreadsAPI["Threads API"]:::external
    PostMgmt["Post Management"]:::core
    Config["Configuration Manager"]:::config
    Utils["Utility Functions"]:::core

    %% Relationships
    FIA --> Scraper
    Scraper --> DocProc
    DocProc --> LocalStore
    DocProc --> Gemini
    Gemini --> ImgConv
    ImgConv --> Imgur
    Imgur --> PostMgmt
    PostMgmt --> ThreadsAPI
    Config --> Scraper
    Config --> DocProc
    Config --> PostMgmt
    Utils --> DocProc
    Utils --> ImgConv

    %% Container Boundary
    subgraph Docker["Docker Container"]
        Scraper
        DocProc
        ImgConv
        PostMgmt
        Config
        Utils
        LocalStore
    end

    %% Click Events
    click Scraper "https://github.com/tirthpatell/fia-f1-docs-bot/blob/main/bot/pkg/scraper/scraper.go"
    click DocProc "https://github.com/tirthpatell/fia-f1-docs-bot/blob/main/bot/pkg/utils/utils.go"
    click PostMgmt "https://github.com/tirthpatell/fia-f1-docs-bot/blob/main/bot/pkg/poster/poster.go"
    click Config "https://github.com/tirthpatell/fia-f1-docs-bot/blob/main/bot/pkg/config/config.go"
    click Utils "https://github.com/tirthpatell/fia-f1-docs-bot/blob/main/bot/pkg/utils/utils.go"
    click Docker "https://github.com/tirthpatell/fia-f1-docs-bot/tree/main/docker/DOCKERFILE"

    %% Legend
    subgraph Legend
        ExtSvc["External Services"]:::external
        CoreComp["Core Components"]:::core
        ProcComp["Processing"]:::processing
        StorageComp["Storage"]:::storage
        ConfigComp["Configuration"]:::config
    end
```
