# nabokd/pockettube architecture

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

- Interactive diagram: https://gitdiagram.com/nabokd/pockettube
- Repository: https://github.com/nabokd/pockettube

## Overview

##### Project Type Analysis
This is a cross-platform browser extension/mobile application with multiple distribution channels and internationalization support.

##### Key Components

A. Browser Extensions Layer
- Chrome Extension
- Firefox Extension
- Safari Extension
- Edge Extension
- Opera Extension

B. Mobile Applications Layer
- iOS App
- Android App

C. Core Components
- YouTube API Integration
- Subscription Management System
- Management System

D. Internationalization System
- Translation Management (50+ languages identified in /translations)
- Language Selection Module

E. Backend Services (implied)
- API Server (pockettube.io)
- User Data Synchronization
- Authentication System

##### Specific Elements

a. Client Layer:
- [Browser Extensions] ─── [Mobile Apps]

- ┐   ┌────────┘
- ▼   ▼
- [Core Services]

b. Service Components:
- [Authentication] ── [Subscription Manager] ── [Group Manager]

- ┬────────┴──────────┬──────────┘
- ▼                    ▼
- [Data Sync]           [YouTube API]

c. I18n System:
- [Language Selector] ── [Translation Manager]

- ┘

##### Technical Details to Highlight

- API endpoints and interfaces
- Data synchronization mechanisms
- Platform-specific implementations
- Translation system integration
- YouTube API integration points

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Layers
    subgraph ClientLayer["Client Layer"]
        subgraph BrowserExtensions["Browser Extensions"]
            Chrome["Chrome Extension"]
            Firefox["Firefox Extension"]
            Safari["Safari Extension"]
            Edge["Edge Extension"]
            Opera["Opera Extension"]
        end
        
        subgraph MobileApps["Mobile Applications"]
            iOS["iOS App"]
            Android["Android App"]
        end
    end
    
    subgraph ServiceLayer["Service Layer"]
        Auth["Authentication System"]
        SubMgr["Subscription Manager"]
        GroupMgr["Group Manager"]
        DataSync["Data Synchronization"]
    end
    
    subgraph I18nLayer["Internationalization Layer"]
        LangSelect["Language Selector"]
        TransMgr["Translation Manager"]:::i18n
    end
    
    subgraph ExternalLayer["External Services"]
        YouTubeAPI["YouTube API"]
        PocketAPI["PocketTube API"]
    end
    
    %% Connections
    Chrome & Firefox & Safari & Edge & Opera --> Auth
    iOS & Android --> Auth
    
    Auth --> SubMgr
    Auth --> GroupMgr
    SubMgr --> DataSync
    GroupMgr --> DataSync
    
    SubMgr -.-> YouTubeAPI
    GroupMgr -.-> PocketAPI
    
    LangSelect --> TransMgr
    TransMgr --> ClientLayer
    
    %% Styling
    classDef browser fill:#a8d1ff
    classDef mobile fill:#90EE90
    classDef core fill:#DDA0DD
    classDef external fill:#FFA500
    classDef i18n fill:#FFD700
    
    class Chrome,Firefox,Safari,Edge,Opera browser
    class iOS,Android mobile
    class Auth,SubMgr,GroupMgr,DataSync core
    class YouTubeAPI,PocketAPI external
    class LangSelect,TransMgr i18n
    
    %% Click Events
    click TransMgr "https://github.com/NabokD/pockettube/tree/main/translations"
    
    %% Legend
    subgraph Legend
        Browser["Browser Extensions"]:::browser
        Mobile["Mobile Apps"]:::mobile
        Core["Core Services"]:::core
        External["External Services"]:::external
        I18N["I18n Components"]:::i18n
    end
```
