# wezlem/fansub-yonetim-sistemi architecture

> Architecture diagram of the GitHub repository wezlem/fansub-yonetim-sistemi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wezlem/fansub-yonetim-sistemi
- Repository: https://github.com/wezlem/fansub-yonetim-sistemi

## Overview

Fansub Yönetim Sistemi is a Discord bot for assigning anime crews and coordinating each episode’s translation, editing, encoding, and completion. Administrators configure crews; the release poller opens deduplicated jobs and notifies translators. Staff submit .ass files in stage channels, where the message handler parses episode metadata, checks the responsible person and stage, advances the job, and alerts the next worker. Completion announcements or manual episode reporting archive jobs; users can also inspect active work and completion-time statistics. The graph reflects README-documented capabilities, with implementation detail limited to sampled files.

Main entry points: [`utils/gorevInstanceStorage.js`](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/gorevInstanceStorage.js) (Jobs and archive), [`events/messageCreate.js`](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/events/messageCreate.js) (Message handler), [`services/bolumTakip.js`](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/services/bolumTakip.js) (Release polling), [`commands`](https://github.com/wezlem/fansub-yonetim-sistemi/tree/main/commands) (Slash commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discord_runtime["Discord runtime"]
  node_runtime["Bot runtime<br/>[index.js]"]
  node_interactions["Interaction dispatcher"]
  node_messages["Message handler<br/>[messageCreate.js]"]
  node_commands["Slash commands"]
  node_ready["Ready event<br/>[ready.js]"]
end

subgraph group_workflow["Episode workflow"]
  node_crew["Crew assignment<br/>[gorevekle.js]"]
  node_release_poll["Release polling<br/>[bolumTakip.js]"]
  node_ass_parser["ASS metadata parser<br/>[assParser.js]"]
  node_stage_rules["Stage configuration"]
  node_auto_complete["Announcement completion"]
  node_active_notice["Active task notices"]
end

subgraph group_state["Workflow state"]
  node_crew_store[("Crew records<br/>[gorevStorage.js]")]
  node_job_store[("Jobs and archive")]
end

subgraph group_reporting["Reporting and help"]
  node_active_command["Active task list<br/>[aktifgorevler.js]"]
  node_stats_command["Task statistics<br/>[istatistik.js]"]
  node_stats_calc["Statistics calculation"]
  node_episode_command["Episode announcement<br/>[episode.js]"]
  node_anime_info["Anime metadata<br/>[mal.js]"]
  node_help_commands["Help and task controls"]
end

node_staff(("Staff and admins"))
node_discord(("Discord"))
node_subsplease(("SubsPlease"))

node_staff -->|"submits commands and files"| node_discord
node_discord -->|"delivers events"| node_runtime
node_runtime -->|"dispatches interactions"| node_interactions
node_runtime -->|"dispatches messages"| node_messages
node_interactions -->|"invokes command"| node_commands
node_commands -->|"runs crew setup"| node_crew
node_crew -->|"saves crew"| node_crew_store
node_crew -.->|"checks current releases"| node_release_poll
node_ready -->|"starts polling"| node_release_poll
node_release_poll -->|"fetches releases"| node_subsplease
node_release_poll -->|"looks up crew"| node_crew_store
node_release_poll -->|"checks and opens jobs"| node_job_store
node_release_poll -->|"announces new episode"| node_discord
node_messages -->|"checks announcement"| node_auto_complete
node_auto_complete -->|"matches and archives job"| node_job_store
node_messages -->|"selects channel stage"| node_stage_rules
node_messages -->|"reads attached file"| node_ass_parser
node_ass_parser -->|"returns episode metadata"| node_messages
node_messages -->|"matches and advances job"| node_job_store
node_messages -->|"alerts next worker"| node_discord
node_interactions -->|"handles task selection and completion"| node_job_store
node_commands -->|"reads and manages jobs"| node_job_store
node_active_command -->|"reads active jobs"| node_job_store
node_ready -->|"starts notices"| node_active_notice
node_active_notice -->|"reads active jobs"| node_job_store
node_active_notice -->|"posts periodic list"| node_discord
node_stats_command -->|"reads archive"| node_job_store
node_stats_command -->|"calculates durations"| node_stats_calc
node_episode_command -->|"fetches anime details"| node_anime_info
node_episode_command -->|"matches and archives completed job"| node_job_store
node_episode_command -->|"posts episode announcement"| node_discord
node_commands -->|"replies with help and controls"| node_discord

click node_runtime "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/index.js"
click node_interactions "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/events/interactionCreate.js"
click node_messages "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/events/messageCreate.js"
click node_commands "https://github.com/wezlem/fansub-yonetim-sistemi/tree/main/commands"
click node_ready "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/events/ready.js"
click node_crew "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/commands/gorevekle.js"
click node_release_poll "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/services/bolumTakip.js"
click node_ass_parser "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/assParser.js"
click node_stage_rules "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/gorevAsamaYapilandirmasi.js"
click node_auto_complete "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/services/otomatikGorevTamamlama.js"
click node_active_notice "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/services/aktifGorevBildirim.js"
click node_crew_store "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/gorevStorage.js"
click node_job_store "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/gorevInstanceStorage.js"
click node_active_command "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/commands/aktifgorevler.js"
click node_stats_command "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/commands/istatistik.js"
click node_stats_calc "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/istatistikHesapla.js"
click node_episode_command "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/commands/episode.js"
click node_anime_info "https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/mal.js"
click node_help_commands "https://github.com/wezlem/fansub-yonetim-sistemi/tree/main/commands"

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_runtime,node_interactions,node_messages,node_commands,node_ready toneBlue
class node_crew,node_release_poll,node_ass_parser,node_stage_rules,node_auto_complete,node_active_notice toneAmber
class node_crew_store,node_job_store toneMint
class node_active_command,node_stats_command,node_stats_calc,node_episode_command,node_anime_info,node_help_commands toneRose
class node_staff,node_discord,node_subsplease toneIndigo
```

## Components

### Discord runtime

- [Bot runtime](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/index.js): `index.js`
- [Interaction dispatcher](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/events/interactionCreate.js): `events/interactionCreate.js`
- [Message handler](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/events/messageCreate.js): `events/messageCreate.js`
- [Slash commands](https://github.com/wezlem/fansub-yonetim-sistemi/tree/main/commands): `commands`
- [Ready event](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/events/ready.js): `events/ready.js`

### Episode workflow

- [Crew assignment](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/commands/gorevekle.js): `commands/gorevekle.js`
- [Release polling](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/services/bolumTakip.js): `services/bolumTakip.js`
- [ASS metadata parser](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/assParser.js): `utils/assParser.js`
- [Stage configuration](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/gorevAsamaYapilandirmasi.js): `utils/gorevAsamaYapilandirmasi.js`
- [Announcement completion](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/services/otomatikGorevTamamlama.js): `services/otomatikGorevTamamlama.js`
- [Active task notices](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/services/aktifGorevBildirim.js): `services/aktifGorevBildirim.js`

### Workflow state

- [Crew records](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/gorevStorage.js): `utils/gorevStorage.js`
- [Jobs and archive](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/gorevInstanceStorage.js): `utils/gorevInstanceStorage.js`

### Reporting and help

- [Active task list](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/commands/aktifgorevler.js): `commands/aktifgorevler.js`
- [Task statistics](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/commands/istatistik.js): `commands/istatistik.js`
- [Statistics calculation](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/istatistikHesapla.js): `utils/istatistikHesapla.js`
- [Episode announcement](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/commands/episode.js): `commands/episode.js`
- [Anime metadata](https://github.com/wezlem/fansub-yonetim-sistemi/blob/main/utils/mal.js): `utils/mal.js`
- [Help and task controls](https://github.com/wezlem/fansub-yonetim-sistemi/tree/main/commands): `commands`

### Other components

- **Staff and admins**
- **Discord**
- **SubsPlease**

## Connections

- Staff and admins → Discord: submits commands and files
- Discord → Bot runtime: delivers events
- Bot runtime → Interaction dispatcher: dispatches interactions
- Bot runtime → Message handler: dispatches messages
- Interaction dispatcher → Slash commands: invokes command
- Slash commands → Crew assignment: runs crew setup
- Crew assignment → Crew records: saves crew
- Crew assignment → Release polling: checks current releases
- Ready event → Release polling: starts polling
- Release polling → SubsPlease: fetches releases
- Release polling → Crew records: looks up crew
- Release polling → Jobs and archive: checks and opens jobs
- Release polling → Discord: announces new episode
- Message handler → Announcement completion: checks announcement
- Announcement completion → Jobs and archive: matches and archives job
- Message handler → Stage configuration: selects channel stage
- Message handler → ASS metadata parser: reads attached file
- ASS metadata parser → Message handler: returns episode metadata
- Message handler → Jobs and archive: matches and advances job
- Message handler → Discord: alerts next worker
- Interaction dispatcher → Jobs and archive: handles task selection and completion
- Slash commands → Jobs and archive: reads and manages jobs
- Active task list → Jobs and archive: reads active jobs
- Ready event → Active task notices: starts notices
- Active task notices → Jobs and archive: reads active jobs
- Active task notices → Discord: posts periodic list
- Task statistics → Jobs and archive: reads archive
- Task statistics → Statistics calculation: calculates durations
- Episode announcement → Anime metadata: fetches anime details
- Episode announcement → Jobs and archive: matches and archives completed job
- Episode announcement → Discord: posts episode announcement
- Slash commands → Discord: replies with help and controls
