# jobo3208/feedn architecture

> Architecture diagram of the GitHub repository jobo3208/feedn, 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/jobo3208/feedn
- Repository: https://github.com/jobo3208/feedn

## Overview

##### Main Components Identification
The system should be represented with these key components:

a) Core System Components:
- Config Handler (config.clj)
- State Management (state.clj)
- Update Manager (updater.clj)
- Timeline Generator (timeline.clj)
- Web Frontend (frontend.clj)

b) Source Adapters Layer:
- Multiple source implementations (nitter, invidious, dumpor, etc.)
- Common source interface (source/interface.clj)

**[Web Frontend (Port 3000)]**

**[Config Manager] ←→ [State Atom] ←→ [Update Manager]**
- ↓               ↑              ↑
- [Timeline Generator] → [Filter System]

**[Source Interface]**
- ↓
**[Individual Source Implementations]**
- Nitter
- NBC Sports
- Invidious
- Dumpor
- Substack

##### Data Flow Indicators

Following flows:
- Config file → Config Manager
- Source Adapters → State Atom
- State Atom → Timeline Generator
- Timeline Generator → Web Frontend

##### Important Notes

- Stateless nature by highlighting the central atom storage
- Extensibility of the source adapter system
- Configuration-driven nature of the system
- Update limiting mechanism as a cross-cutting concern

##### Technical Details

- Port number (3000) for the web server
- EDN configuration file input
- Atom-based state management
- Source-specific configuration parameters

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef core fill:#b3d1ff,stroke:#4d88ff
    classDef frontend fill:#98fb98,stroke:#4caf50
    classDef source fill:#ffd280,stroke:#ffa726
    classDef interface fill:#ffb366,stroke:#ff8c00

    %% Client Layer
    subgraph ClientLayer
        WebFront["Web Frontend\n(Port 3000)"]:::frontend
    end

    %% Core Layer
    subgraph CoreLayer
        Config["Config Handler"]:::core
        StateAtom["State Management\n(Atom Storage)"]:::core
        UpdateMgr["Update Manager"]:::core
        Timeline["Timeline Generator"]:::core
        Filter["Filter System"]:::core
        LimitCtrl["Update Limit\nController"]:::core
    end

    %% Source Layer
    subgraph SourceLayer
        SourceInt["Source Interface"]:::interface
        subgraph Sources
            Nitter["Nitter"]:::source
            NBCSports["NBC Sports"]:::source
            Invidious["Invidious"]:::source
            Dumpor["Dumpor"]:::source
            Substack["Substack"]:::source
        end
    end

    %% Relationships
    Config <--> StateAtom
    StateAtom <--> UpdateMgr
    StateAtom --> Timeline
    Timeline --> Filter
    Filter --> WebFront
    LimitCtrl --> UpdateMgr

    SourceInt --> StateAtom
    Nitter & NBCSports & Invidious & Dumpor & Substack --> SourceInt

    %% Click Events
    click Config "https://github.com/jobo3208/feedn/blob/master/src/feedn/config.clj"
    click StateAtom "https://github.com/jobo3208/feedn/blob/master/src/feedn/state.clj"
    click UpdateMgr "https://github.com/jobo3208/feedn/blob/master/src/feedn/updater.clj"
    click Timeline "https://github.com/jobo3208/feedn/blob/master/src/feedn/timeline.clj"
    click WebFront "https://github.com/jobo3208/feedn/blob/master/src/feedn/frontend.clj"
    click Filter "https://github.com/jobo3208/feedn/blob/master/src/feedn/frontend/filter.clj"
    click SourceInt "https://github.com/jobo3208/feedn/blob/master/src/feedn/source/interface.clj"
    click LimitCtrl "https://github.com/jobo3208/feedn/blob/master/src/feedn/limit.clj"
    click Nitter "https://github.com/jobo3208/feedn/blob/master/src/feedn/source/nitter.clj"
    click NBCSports "https://github.com/jobo3208/feedn/blob/master/src/feedn/source/nbcsports.clj"
    click Invidious "https://github.com/jobo3208/feedn/blob/master/src/feedn/source/invidious.clj"
    click Dumpor "https://github.com/jobo3208/feedn/blob/master/src/feedn/source/dumpor.clj"
    click Substack "https://github.com/jobo3208/feedn/blob/master/src/feedn/source/substack.clj"

    %% Legend
    subgraph Legend
        L1["Core Component"]:::core
        L2["Frontend Component"]:::frontend
        L3["Source Adapter"]:::source
        L4["Interface"]:::interface
    end
```
