# nventiveux/docker-ttrss architecture

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

- Interactive diagram: https://gitdiagram.com/nventiveux/docker-ttrss
- Repository: https://github.com/nventiveux/docker-ttrss

## Overview

##### Main Components

a. Container Layer:
- TT-RSS Application Container
- Database Container (showing both PostgreSQL and MySQL options)
- Nginx Web Server (front-facing)
- PHP-FPM Service
- Supervisord Process Manager

b. Networking Layer:
- Custom Docker Network (ttrss_net)
- Port Mappings (8000:80)

c. Storage Layer:
- Database Volume (ttrss_db_vol)
- Application Files

##### External Access Layer
- It to port 8000 on the host

- Main TT-RSS container (blue):
- Nginx (web server)
- PHP-FPM 8.2
- Supervisord
- Database container (green):
- Both PostgreSQL and MySQL options as alternatives
- To volume storage

- Nginx configuration (/nginx/conf.d)
- PHP configuration (/php82/conf.d)
- TT-RSS configuration (ttrss/config.php)

##### Use these specific connection types
- → for HTTP/HTTPS traffic
- ⇢ for internal container communication
- ⇆ for persistent storage connections

Important Elements to Highlight:

##### Multi-architecture Support
- A note showing support for amd64, arm64, and arm

##### Container Orchestration
- How Supervisord manages processes
- Docker network isolation

##### Plugin Architecture
- Feedly theme integration
- Mercury Fulltext plugin connection

Specific Guidelines:

##### Use standardized symbols
- Rectangles for containers
- Hexagons for load balancers/reverse proxies
- Clouds for external services

##### Labels
- Container names
- Port numbers
- Volume names
- Environment variables (key ones from configuration)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "External Access"
        Browser["🌐 Browser/User"]
    end

    subgraph "Container Layer"
        subgraph "Main TT-RSS Container"
            Nginx["Nginx Web Server"]:::web
            PHPFPM["PHP-FPM 8.2"]:::app
            Supervisor["Supervisord"]:::process
            TTRSSApp["TT-RSS Application"]:::app
        end

        subgraph "Database Options"
            direction TB
            PostgreSQL[(PostgreSQL)]:::db
            MySQL[(MySQL)]:::db
        end
    end

    subgraph "Configuration"
        direction TB
        NginxConf["Nginx Config"]:::config
        PHPConf["PHP Config"]:::config
        TTRSSConf["TT-RSS Config"]:::config
        SupervisorConf["Supervisor Config"]:::config
        EmailConf["Email Config"]:::config
    end

    subgraph "Storage"
        DBVolume[("Database Volume<br/>ttrss_db_vol")]:::storage
    end

    subgraph "Plugins"
        FeedlyTheme["Feedly Theme"]:::plugin
        Mercury["Mercury Fulltext"]:::plugin
    end

    %% Connections
    Browser -->|"Port 8000"| Nginx
    Nginx -->|"FastCGI"| PHPFPM
    PHPFPM --> TTRSSApp
    Supervisor -.->|"Manages"| PHPFPM
    TTRSSApp -->|"Database Connection"| PostgreSQL
    TTRSSApp -->|"Database Connection"| MySQL
    PostgreSQL <==>|"Persistent Storage"| DBVolume
    MySQL <==>|"Persistent Storage"| DBVolume
    
    %% Configuration Connections
    NginxConf -.->|"Configures"| Nginx
    PHPConf -.->|"Configures"| PHPFPM
    TTRSSConf -.->|"Configures"| TTRSSApp
    SupervisorConf -.->|"Configures"| Supervisor
    EmailConf -.->|"Configures"| TTRSSApp
    
    %% Plugin Connections
    FeedlyTheme -.->|"Themes"| TTRSSApp
    Mercury -.->|"Enhances"| TTRSSApp

    %% Click Events
    click Nginx "https://github.com/nventiveux/docker-ttrss/blob/master/nginx/conf.d/ttrss.conf"
    click PHPFPM "https://github.com/nventiveux/docker-ttrss/blob/master/php82/php-fpm.d/www.conf"
    click PHPConf "https://github.com/nventiveux/docker-ttrss/blob/master/php82/conf.d/90_ttrss.ini"
    click TTRSSConf "https://github.com/nventiveux/docker-ttrss/blob/master/ttrss/config.php"
    click Supervisor "https://github.com/nventiveux/docker-ttrss/blob/master/supervisord.conf"
    click EmailConf "https://github.com/nventiveux/docker-ttrss/blob/master/ttrss/msmtprc.tpl"
    click PostgreSQL "https://github.com/nventiveux/docker-ttrss/blob/master/tests/ttrss-pgsql/docker-compose.yml"
    click MySQL "https://github.com/nventiveux/docker-ttrss/blob/master/tests/ttrss-mysql/docker-compose.yml"

    %% Styles
    classDef web fill:#6C8EBF,stroke:#2C5AA0
    classDef app fill:#9BC2E6,stroke:#2C5AA0
    classDef process fill:#B4C7E7,stroke:#2C5AA0
    classDef db fill:#70AD47,stroke:#507E32
    classDef config fill:#FFE699,stroke:#BF9000
    classDef storage fill:#D9D9D9,stroke:#666666
    classDef plugin fill:#C5E0B4,stroke:#70AD47

    %% Legend
    subgraph Legend
        L1["Web Component"]:::web
        L2["Application Component"]:::app
        L3["Process Manager"]:::process
        L4["Database"]:::db
        L5["Configuration"]:::config
        L6["Storage"]:::storage
        L7["Plugin"]:::plugin
    end
```
