# nuskooler/enigma-bbs architecture

> Architecture diagram of the GitHub repository nuskooler/enigma-bbs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nuskooler/enigma-bbs
- Repository: https://github.com/nuskooler/enigma-bbs

## Overview

##### Main Components Identification
The system should be divided into these primary components:

a) Core Services Layer:
- Login Servers (SSH, Telnet, WebSocket)
- Content Servers (Web, Gopher, NNTP)
- Message Network Services (FTN/BSO)
- File Transfer Services
- Database (SQLite)

b) Core System Layer:
- User Management
- Authentication (including 2FA)
- Menu System
- Event System
- Configuration Management
- Logging System

c) Content Management Layer:
- Message Areas
- File Areas
- Door System
- Art System
- Achievement System

**[Client Layer]**
- Terminal Clients (SyncTERM, VTX, etc.)
- Web Browsers
- SSH Clients

**[Access Layer]**
- SSH Server
- Telnet Server
- WebSocket Server
- Web Server
- Gopher Server
- NNTP Server

**[Core Services Layer]**
- User Management
- Authentication
- Menu System
- Event Scheduler
- Configuration
- Logging

**[Content Layer]**
- Message Areas
- File Areas
- Door System
- Art System
- Achievements

**[Storage Layer]**
- SQLite Database
- File System Storage

##### Integration Points

External integrations:
- Door Party
- BBSLink
- Exodus
- FidoNet
- File Network Support

##### Technical Details

- Node.js as the runtime environment
- HJSON configuration system
- MCI support for UI elements
- CP437 and UTF-8 encoding support
- ANSI/ASCII art rendering system
- Message network protocols
- File transfer protocols

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Clients
        TC[Terminal Clients]:::client
        WB[Web Browsers]:::client
        SC[SSH Clients]:::client
    end

    subgraph Access
        SSH[SSH Server]:::server
        TEL[Telnet Server]:::server
        WS[WebSocket Server]:::server
        WEB[Web Server]:::server
        GOP[Gopher Server]:::server
        NNTP[NNTP Server]:::server
    end

    subgraph Core
        UM[User Management]:::core
        AUTH[Authentication]:::core
        MENU[Menu System]:::core
        EVENT[Event System]:::core
        CONFIG[Configuration]:::core
        LOG[Logging]:::core
        CLIENT[Client Management]:::core
        THEME[Theme System]:::core
    end

    subgraph Content
        MA[Message Areas]:::content
        FA[File Areas]:::content
        DOOR[Door System]:::content
        ART[Art System]:::content
        ACH[Achievements]:::content
    end

    subgraph Storage
        DB[(SQLite Database)]:::storage
        FS[(File System)]:::storage
    end

    subgraph External
        DP[Door Party]:::external
        BBSL[BBSLink]:::external
        EX[Exodus]:::external
        FN[FidoNet]:::external
    end

    TC & WB & SC --> SSH & TEL & WS & WEB & GOP & NNTP
    SSH & TEL & WS & WEB & GOP & NNTP --> AUTH
    AUTH --> UM
    UM --> MENU
    MENU --> MA & FA & DOOR & ART & ACH
    EVENT --> DOOR & MA & FA
    CONFIG --> UM & MENU & EVENT
    LOG --> DB
    CLIENT --> UM & MENU
    THEME --> ART
    MA & FA --> DB & FS
    DOOR --> DP & BBSL
    MA --> FN & EX

    classDef client fill:#a8d1f0
    classDef server fill:#90EE90
    classDef core fill:#ffeb99
    classDef content fill:#ffb366
    classDef storage fill:#d9b3ff
    classDef external fill:#c0c0c0

    click SSH "https://github.com/NuSkooler/enigma-bbs/blob/master/core/servers/login/ssh.js"
    click TEL "https://github.com/NuSkooler/enigma-bbs/blob/master/core/servers/login/telnet.js"
    click WS "https://github.com/NuSkooler/enigma-bbs/blob/master/core/servers/login/websocket.js"
    click WEB "https://github.com/NuSkooler/enigma-bbs/blob/master/core/servers/content/web.js"
    click GOP "https://github.com/NuSkooler/enigma-bbs/blob/master/core/servers/content/gopher.js"
    click NNTP "https://github.com/NuSkooler/enigma-bbs/blob/master/core/servers/content/nntp.js"
    click UM "https://github.com/NuSkooler/enigma-bbs/blob/master/core/user.js"
    click AUTH "https://github.com/NuSkooler/enigma-bbs/blob/master/core/user_login.js"
    click MENU "https://github.com/NuSkooler/enigma-bbs/blob/master/core/menu_module.js"
    click EVENT "https://github.com/NuSkooler/enigma-bbs/blob/master/core/events.js"
    click CONFIG "https://github.com/NuSkooler/enigma-bbs/blob/master/core/config.js"
    click LOG "https://github.com/NuSkooler/enigma-bbs/blob/master/core/logger.js"
    click MA "https://github.com/NuSkooler/enigma-bbs/blob/master/core/message_area.js"
    click FA "https://github.com/NuSkooler/enigma-bbs/blob/master/core/file_base_area.js"
    click DOOR "https://github.com/NuSkooler/enigma-bbs/blob/master/core/door.js"
    click ART "https://github.com/NuSkooler/enigma-bbs/blob/master/core/art.js"
    click ACH "https://github.com/NuSkooler/enigma-bbs/blob/master/core/achievement.js"
    click DB "https://github.com/NuSkooler/enigma-bbs/blob/master/core/database.js"
    click FS "https://github.com/NuSkooler/enigma-bbs/blob/master/core/file_util.js"
    click CLIENT "https://github.com/NuSkooler/enigma-bbs/blob/master/core/client.js"
    click THEME "https://github.com/NuSkooler/enigma-bbs/blob/master/core/theme.js"
```
