# alter-syno/the-lines-discord-bot architecture

> Architecture diagram of the GitHub repository alter-syno/the-lines-discord-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alter-syno/the-lines-discord-bot
- Repository: https://github.com/alter-syno/the-lines-discord-bot

## Overview

The Lines is a Discord community bot with a web dashboard. Its principal workflow is music submission: a member completes an interactive form, staff review it, and the submitter receives the decision. Other major branches cover verification and community management, moderation and channel administration, media features, and dashboard/status services. The README documents the user-facing flows; the index excerpt shows startup wiring. Some subsystem internals were not sampled, so undocumented implementation links are omitted.

Main entry points: [`index.js`](https://github.com/alter-syno/the-lines-discord-bot/blob/main/index.js) (Bot startup), [`chunks/submissions/chunks/SubmissionsReview.js`](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/submissions/chunks/SubmissionsReview.js) (Submission review), [`chunks/moderation/chunks/ModerationExecution.js`](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/moderation/chunks/ModerationExecution.js) (Moderation tools), [`chunks/server/routes/routes.js`](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/routes/routes.js) (Web routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_main["Bot startup<br/>[index.js]"]
  node_presence["Bot presence<br/>[presence.js]"]
  node_api["Community API helpers<br/>[api.js]"]
end

subgraph group_community["Community workflows"]
  node_submission["Song submissions"]
  node_submission_review["Submission review"]
  node_verification["Member verification<br/>[VerifyHandlers.js]"]
  node_roles["Reaction roles<br/>[RolesListeners.js]"]
  node_welcome["Welcome and leave<br/>[Welcome.js]"]
  node_rules["Rules acknowledgement<br/>[Rules.js]"]
end

subgraph group_admin["Administration"]
  node_moderation["Moderation tools"]
  node_moderation_ui["Moderation sessions"]
  node_ban["Ban notices<br/>[Ban.js]"]
  node_channel_config["Channel dashboard"]
  node_channel_routes["Channel protection"]
  node_route_menus["Route menus"]
end

subgraph group_media["Media features"]
  node_radio["Radio streaming<br/>[RadioPlayer.js]"]
  node_youtube["YouTube alerts<br/>[YouTubeLogic.js]"]
  node_worker["Background worker"]
  node_meme["Meme generation<br/>[MemeHandlers.js]"]
end

subgraph group_web["Web and persistence"]
  node_submission_store[("Submission records")]
  node_moderation_store[("Moderation records")]
  node_channel_data["Channel settings<br/>[channels.js]"]
  node_role_data["Role settings<br/>[roles.js]"]
  node_web_server["Web server<br/>[server.js]"]
  node_web_routes["Web routes<br/>[routes.js]"]
  node_health["Health status"]
  node_home["Status dashboard<br/>[HomeController.js]"]
  node_database[("MongoDB connection<br/>[database.js]")]
  node_submission_model[("Submission model<br/>[Submission.js]")]
  node_moderation_model[("Moderation case model<br/>[ModerationCase.js]")]
end

node_member(("Community member"))
node_staff(("Staff"))
node_discord{{"Discord"}}
node_youtube_service{{"YouTube service"}}

node_member -->|"uses"| node_discord
node_discord -->|"submits track"| node_submission
node_submission -->|"routes for review"| node_submission_review
node_staff -->|"reviews submission"| node_submission_review
node_submission_review -.->|"records decision"| node_submission_store
node_submission_review -->|"DMs decision"| node_member
node_discord -->|"starts verification"| node_verification
node_discord -->|"reacts for roles"| node_roles
node_discord -->|"member joins or leaves"| node_welcome
node_discord -->|"acknowledges rules"| node_rules
node_staff -->|"starts moderation"| node_moderation_ui
node_moderation_ui -->|"executes action"| node_moderation
node_moderation -->|"records cases"| node_moderation_store
node_moderation_store -->|"reads and writes"| node_moderation_model
node_moderation -->|"triggers notice"| node_ban
node_staff -->|"configures channels"| node_channel_config
node_staff -->|"manages protections"| node_channel_routes
node_channel_routes -->|"builds menus"| node_route_menus
node_route_menus -->|"checks protected IDs"| node_channel_data
node_member -->|"uses radio controls"| node_radio
node_youtube -->|"checks channels"| node_youtube_service
node_youtube -->|"posts upload alerts"| node_discord
node_worker -->|"runs task"| node_youtube
node_member -->|"requests meme"| node_meme
node_main -->|"starts server"| node_web_server
node_web_server -->|"creates routes"| node_web_routes
node_web_routes -->|"routes health requests"| node_health
node_web_routes -->|"routes home requests"| node_home
node_home -->|"gets health data"| node_health
node_health -->|"reads presence"| node_presence
node_main -->|"sets up presence"| node_presence
node_main -.->|"uses configuration"| node_channel_data
node_main -.->|"uses configuration"| node_role_data
node_submission_store -->|"reads and writes"| node_submission_model
node_database -->|"registers model"| node_submission_model
node_database -->|"registers model"| node_moderation_model
node_verification -->|"uses helper"| node_api

click node_main "https://github.com/alter-syno/the-lines-discord-bot/blob/main/index.js"
click node_submission "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/submissions/chunks/SubmissionsHandlers.js"
click node_submission_review "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/submissions/chunks/SubmissionsReview.js"
click node_submission_store "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/controllers/SubmissionController.js"
click node_verification "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/verify/chunks/VerifyHandlers.js"
click node_roles "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/roles/chunks/RolesListeners.js"
click node_welcome "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/welcome/Welcome.js"
click node_rules "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/rules/Rules.js"
click node_moderation "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/moderation/chunks/ModerationExecution.js"
click node_moderation_ui "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/moderation/chunks/ModerationButtonHandler.js"
click node_moderation_store "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/controllers/ModerationController.js"
click node_ban "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/welcome/Ban.js"
click node_channel_config "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/channels/chunks/InteractionHandler.js"
click node_channel_routes "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/routes/chunks/ChannelRoutesChannelActions.js"
click node_route_menus "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/routes/chunks/ChannelRoutesMenuBuilders.js"
click node_channel_data "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/data/channels.js"
click node_role_data "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/data/roles.js"
click node_radio "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/radio/chunks/RadioPlayer.js"
click node_youtube "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/youtube/chunks/YouTubeLogic.js"
click node_worker "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/worker/backgroundWorker.js"
click node_meme "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/meme/chunks/MemeHandlers.js"
click node_web_server "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/server.js"
click node_web_routes "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/routes/routes.js"
click node_health "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/controller/HealthController.js"
click node_home "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/controller/HomeController.js"
click node_presence "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/bot/presence.js"
click node_api "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/api/api.js"
click node_database "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/config/database.js"
click node_submission_model "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/models/Submission.js"
click node_moderation_model "https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/models/ModerationCase.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_presence,node_api toneBlue
class node_submission,node_submission_review,node_verification,node_roles,node_welcome,node_rules toneAmber
class node_moderation,node_moderation_ui,node_ban,node_channel_config,node_channel_routes,node_route_menus toneMint
class node_radio,node_youtube,node_worker,node_meme toneRose
class node_submission_store,node_moderation_store,node_channel_data,node_role_data,node_web_server,node_web_routes,node_health,node_home,node_database,node_submission_model,node_moderation_model,node_member,node_staff,node_discord,node_youtube_service toneIndigo
```

## Components

### Bot runtime

- [Bot startup](https://github.com/alter-syno/the-lines-discord-bot/blob/main/index.js): `index.js`
- [Bot presence](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/bot/presence.js): `chunks/bot/presence.js`
- [Community API helpers](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/api/api.js): `chunks/api/api.js`

### Community workflows

- [Song submissions](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/submissions/chunks/SubmissionsHandlers.js): `chunks/submissions/chunks/SubmissionsHandlers.js`
- [Submission review](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/submissions/chunks/SubmissionsReview.js): `chunks/submissions/chunks/SubmissionsReview.js`
- [Member verification](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/verify/chunks/VerifyHandlers.js): `chunks/verify/chunks/VerifyHandlers.js`
- [Reaction roles](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/roles/chunks/RolesListeners.js): `chunks/roles/chunks/RolesListeners.js`
- [Welcome and leave](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/welcome/Welcome.js): `chunks/welcome/Welcome.js`
- [Rules acknowledgement](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/rules/Rules.js): `chunks/rules/Rules.js`

### Administration

- [Moderation tools](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/moderation/chunks/ModerationExecution.js): `chunks/moderation/chunks/ModerationExecution.js`
- [Moderation sessions](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/moderation/chunks/ModerationButtonHandler.js): `chunks/moderation/chunks/ModerationButtonHandler.js`
- [Ban notices](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/welcome/Ban.js): `chunks/welcome/Ban.js`
- [Channel dashboard](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/channels/chunks/InteractionHandler.js): `chunks/channels/chunks/InteractionHandler.js`
- [Channel protection](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/routes/chunks/ChannelRoutesChannelActions.js): `chunks/routes/chunks/ChannelRoutesChannelActions.js`
- [Route menus](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/routes/chunks/ChannelRoutesMenuBuilders.js): `chunks/routes/chunks/ChannelRoutesMenuBuilders.js`

### Media features

- [Radio streaming](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/radio/chunks/RadioPlayer.js): `chunks/radio/chunks/RadioPlayer.js`
- [YouTube alerts](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/youtube/chunks/YouTubeLogic.js): `chunks/youtube/chunks/YouTubeLogic.js`
- [Background worker](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/worker/backgroundWorker.js): `chunks/worker/backgroundWorker.js`
- [Meme generation](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/meme/chunks/MemeHandlers.js): `chunks/meme/chunks/MemeHandlers.js`

### Web and persistence

- [Submission records](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/controllers/SubmissionController.js): `chunks/database/controllers/SubmissionController.js`
- [Moderation records](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/controllers/ModerationController.js): `chunks/database/controllers/ModerationController.js`
- [Channel settings](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/data/channels.js): `chunks/data/channels.js`
- [Role settings](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/data/roles.js): `chunks/data/roles.js`
- [Web server](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/server.js): `chunks/server/server.js`
- [Web routes](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/routes/routes.js): `chunks/server/routes/routes.js`
- [Health status](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/controller/HealthController.js): `chunks/server/controller/HealthController.js`
- [Status dashboard](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/server/controller/HomeController.js): `chunks/server/controller/HomeController.js`
- [MongoDB connection](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/config/database.js): `chunks/database/config/database.js`
- [Submission model](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/models/Submission.js): `chunks/database/models/Submission.js`
- [Moderation case model](https://github.com/alter-syno/the-lines-discord-bot/blob/main/chunks/database/models/ModerationCase.js): `chunks/database/models/ModerationCase.js`

### Other components

- **Community member**
- **Staff**
- **Discord**
- **YouTube service**

## Connections

- Community member → Discord: uses
- Discord → Song submissions: submits track
- Song submissions → Submission review: routes for review
- Staff → Submission review: reviews submission
- Submission review → Submission records: records decision
- Submission review → Community member: DMs decision
- Discord → Member verification: starts verification
- Discord → Reaction roles: reacts for roles
- Discord → Welcome and leave: member joins or leaves
- Discord → Rules acknowledgement: acknowledges rules
- Staff → Moderation sessions: starts moderation
- Moderation sessions → Moderation tools: executes action (evidence: `chunks/moderation/chunks/ModerationButtonHandler.js`)
- Moderation tools → Moderation records: records cases
- Moderation records → Moderation case model: reads and writes (evidence: `chunks/database/controllers/ModerationController.js`)
- Moderation tools → Ban notices: triggers notice (evidence: `chunks/moderation/chunks/ModerationExecution.js`)
- Staff → Channel dashboard: configures channels
- Staff → Channel protection: manages protections
- Channel protection → Route menus: builds menus (evidence: `chunks/routes/chunks/ChannelRoutesChannelActions.js`)
- Route menus → Channel settings: checks protected IDs
- Community member → Radio streaming: uses radio controls
- YouTube alerts → YouTube service: checks channels
- YouTube alerts → Discord: posts upload alerts
- Background worker → YouTube alerts: runs task (evidence: `chunks/worker/backgroundWorker.js`)
- Community member → Meme generation: requests meme
- Bot startup → Web server: starts server (evidence: `index.js`)
- Web server → Web routes: creates routes (evidence: `chunks/server/server.js`)
- Web routes → Health status: routes health requests (evidence: `chunks/server/routes/routes.js`)
- Web routes → Status dashboard: routes home requests (evidence: `chunks/server/routes/routes.js`)
- Status dashboard → Health status: gets health data (evidence: `chunks/server/controller/HomeController.js`)
- Health status → Bot presence: reads presence (evidence: `chunks/server/controller/HealthController.js`)
- Bot startup → Bot presence: sets up presence (evidence: `index.js`)
- Bot startup → Channel settings: uses configuration
- Bot startup → Role settings: uses configuration
- Submission records → Submission model: reads and writes (evidence: `chunks/database/controllers/SubmissionController.js`)
- MongoDB connection → Submission model: registers model (evidence: `chunks/database/config/database.js`)
- MongoDB connection → Moderation case model: registers model (evidence: `chunks/database/config/database.js`)
- Member verification → Community API helpers: uses helper (evidence: `chunks/verify/chunks/VerifyHandlers.js`)
