# adollaapp/adolla architecture

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

- Interactive diagram: https://gitdiagram.com/adollaapp/adolla
- Repository: https://github.com/adollaapp/adolla

## Overview

##### Main Components

a. Frontend Layer:
- Progressive Web App (PWA) interface
- Views (Handlebars templates)
- Client-side JavaScript modules
- CSS styling components

b. Backend Layer:
- Node.js web server
- Router system
- Scraper modules
- Database and caching system
- Notification services

c. External Services:
- Multiple manga source providers
- Discord webhook integration
- Telegram bot integration
- Image proxy service

**[Client Layer]**
- PWA Container
- Views (Handlebars)
- CSS Modules
- JavaScript Components

**[Server Layer]**
- Web Server (Express.js)
- Router System
- Scraper Engine
- Utility Services

**[External Services Layer]**
- Manga Sources
- Notification Services
- Image Proxy

##### Component Relationships

- Data flow between frontend and backend (REST API)
- Scraper interactions with external manga sources
- Notification flow to Discord/Telegram
- Cache and database interactions

##### Technical Details to Highlight

a. Frontend Components:
- Separation between raw JS (/public/js) and compiled JS (/public/js_compiled)
- PWA capabilities
- Responsive design elements

b. Backend Components:
- Scraper architecture (/src/scrapers)
- Router organization (/src/routers)
- Utility services (/src/util)

##### Data Flow Indicators

- User request flows
- Manga data retrieval paths
- Notification dispatch routes
- Backup process flow
- Progress tracking updates

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        PWA["PWA Container"]
        Views["Views Layer"]
        JS["JavaScript Modules"]
        CSS["CSS Styling"]
        Reader["Reader Components"]
        ListsUI["List Management UI"]
        NotifsUI["Notifications UI"]
        BackupUI["Backup UI"]
    end

    subgraph Server
        WebServer["Web Server"]
        Router["Router System"]
        ScraperEngine["Scraper Engine"]
        DB[(Database)]
        Cache[(Cache System)]
        Progress["Progress Tracking"]
        Lists["List Management"]
        Backup["Backup System"]
        Notifs["Notification Services"]
        Bot["Bot Integration"]
    end

    subgraph External
        MangaSources["Manga Sources"]
        Discord["Discord Webhook"]
        Telegram["Telegram Bot"]
        ImageProxy["Image Proxy"]
    end

    %% Client Layer Connections
    PWA --> Views
    PWA --> JS
    PWA --> CSS
    JS --> Reader
    JS --> ListsUI
    JS --> NotifsUI
    JS --> BackupUI

    %% Server Layer Connections
    WebServer --> Router
    Router --> ScraperEngine
    Router --> DB
    Router --> Cache
    Router --> Progress
    Router --> Lists
    Router --> Backup
    Router --> Notifs
    Notifs --> Bot

    %% External Connections
    ScraperEngine --> MangaSources
    Bot --> Discord
    Bot --> Telegram
    ScraperEngine --> ImageProxy

    %% Click Events
    click PWA "https://github.com/adollaapp/adolla/blob/master/public/sw.js"
    click Views "https://github.com/adollaapp/adolla/tree/master/views"
    click JS "https://github.com/adollaapp/adolla/tree/master/public/js"
    click CSS "https://github.com/adollaapp/adolla/tree/master/public/css"
    click Reader "https://github.com/adollaapp/adolla/blob/master/public/js/pages/reader.js"
    click ListsUI "https://github.com/adollaapp/adolla/blob/master/public/js/reusable/lists.js"
    click NotifsUI "https://github.com/adollaapp/adolla/blob/master/public/js/notifs.js"
    click BackupUI "https://github.com/adollaapp/adolla/blob/master/public/js/pages/backups.js"
    click WebServer "https://github.com/adollaapp/adolla/blob/master/src/web.ts"
    click Router "https://github.com/adollaapp/adolla/tree/master/src/routers"
    click ScraperEngine "https://github.com/adollaapp/adolla/tree/master/src/scrapers"
    click DB "https://github.com/adollaapp/adolla/blob/master/src/db.ts"
    click Cache "https://github.com/adollaapp/adolla/blob/master/src/util/cache.ts"
    click Progress "https://github.com/adollaapp/adolla/blob/master/src/util/getMangaProgress.ts"
    click Lists "https://github.com/adollaapp/adolla/blob/master/src/util/lists.ts"
    click Backup "https://github.com/adollaapp/adolla/blob/master/src/backup.ts"
    click Notifs "https://github.com/adollaapp/adolla/blob/master/src/send-notification.ts"
    click Bot "https://github.com/adollaapp/adolla/blob/master/src/util/bot.ts"

    %% Styling
    classDef client fill:#a8d1ff
    classDef server fill:#ffb366
    classDef external fill:#90EE90
    classDef storage fill:#DDA0DD
    classDef notification fill:#FFA07A

    class PWA,Views,JS,CSS,Reader,ListsUI,NotifsUI,BackupUI client
    class WebServer,Router,ScraperEngine,Progress,Lists,Backup server
    class MangaSources,Discord,Telegram,ImageProxy external
    class DB,Cache storage
    class Notifs,Bot notification

    %% Legend
    subgraph Legend
        ClientComp["Client Component"]:::client
        ServerComp["Server Component"]:::server
        ExtComp["External Service"]:::external
        StorageComp["Storage System"]:::storage
        NotifComp["Notification System"]:::notification
    end
```
