# santoshpoudelx/dexbotx architecture

> Architecture diagram of the GitHub repository santoshpoudelx/dexbotx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/santoshpoudelx/dexbotx
- Repository: https://github.com/santoshpoudelx/dexbotx

## Overview

DexBotX combines a Discord community bot with a web dashboard. A server administrator signs in through Discord, configures guild features in the dashboard, and the backend persists settings; bot shards and workers handle Discord events and message work. The README documents PostgreSQL, Redis, live WebSocket updates, and optional Supabase background storage. Anti-spam, social notifications, AI auto chat, auto roles, economy, and welcome/goodbye are documented capabilities; music is explicitly not yet available. Some feature internals were not sampled, so those links reflect README-level architecture only.

Main entry points: [`frontend/src/app/api/[[...path]]/route.ts`](https://github.com/santoshpoudelx/dexbotx/blob/main/frontend/src/app/api/%5B%5B...path%5D%5D/route.ts) (API proxy), [`backend/src/bot`](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/bot) (Bot shards and guild sync), [`backend/src/worker`](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/worker) (Queue worker), [`backend/src/guilds`](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/guilds) (Guild dashboard API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web dashboard"]
  node_frontend["Dashboard pages"]
  node_proxy["API proxy<br/>[route.ts]"]
end

subgraph group_api["Backend API"]
  node_auth["Discord login and sessions"]
  node_guildapi["Guild dashboard API"]
  node_welcome["Welcome and goodbye"]
  node_economy["Economy configuration"]
  node_adminapi["Admin operations"]
  node_realtime["Live updates"]
end

subgraph group_bot["Discord bot"]
  node_shards["Bot shards and guild sync"]
  node_community["Community features"]
  node_moderation["Moderation commands"]
end

subgraph group_jobs["Background work"]
  node_queue["Member event queue"]
  node_worker["Queue worker"]
  node_render["Message rendering"]
end

subgraph group_state["Data and integrations"]
  node_postgres[("PostgreSQL")]
  node_redis[("Redis")]
end

node_admin(("Server administrator"))
node_browser(("Browser dashboard"))
node_gateway(("Discord Gateway"))
node_discordrest["Discord REST API"]
node_storage[("Supabase Storage")]

node_admin -->|"configures servers"| node_browser
node_browser -->|"uses dashboard"| node_frontend
node_frontend -->|"sends API requests"| node_proxy
node_proxy -->|"proxies requests"| node_auth
node_proxy -->|"proxies requests"| node_guildapi
node_proxy -->|"proxies requests"| node_welcome
node_proxy -->|"proxies requests"| node_economy
node_proxy -->|"proxies requests"| node_adminapi
node_admin -->|"signs in"| node_auth
node_guildapi -->|"persists settings"| node_postgres
node_welcome -->|"persists settings"| node_postgres
node_economy -->|"persists economy data"| node_postgres
node_auth -->|"stores sessions"| node_redis
node_realtime -->|"uses pub/sub"| node_redis
node_browser -->|"receives live updates"| node_realtime
node_gateway -->|"delivers gateway events"| node_shards
node_shards -.->|"handles community features"| node_community
node_shards -.->|"dispatches commands"| node_moderation
node_shards -->|"enqueues member jobs"| node_queue
node_queue -->|"dispatches jobs"| node_worker
node_worker -->|"renders messages"| node_render
node_worker -->|"reads latest data"| node_postgres
node_shards -->|"writes sync and settings"| node_postgres
node_worker -->|"sends REST requests"| node_discordrest
node_guildapi -.->|"uploads backgrounds"| node_storage
node_worker -->|"posts rendered messages"| node_discordrest

click node_frontend "https://github.com/santoshpoudelx/dexbotx/tree/main/frontend/src/app"
click node_proxy "https://github.com/santoshpoudelx/dexbotx/blob/main/frontend/src/app/api/%5B%5B...path%5D%5D/route.ts"
click node_auth "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/auth"
click node_guildapi "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/guilds"
click node_welcome "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/welcome"
click node_economy "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/economy"
click node_adminapi "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/admin"
click node_realtime "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/realtime"
click node_shards "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/bot"
click node_community "https://github.com/santoshpoudelx/dexbotx/blob/main/backend/src/bot/guild-sync.service.ts"
click node_moderation "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/bot/commands"
click node_queue "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/queue"
click node_worker "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/worker"
click node_render "https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/render"

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_frontend,node_proxy,node_browser toneBlue
class node_auth,node_guildapi,node_welcome,node_economy,node_adminapi,node_realtime,node_storage toneAmber
class node_shards,node_community,node_moderation,node_admin,node_discordrest toneMint
class node_queue,node_worker,node_render toneRose
class node_postgres,node_redis,node_gateway toneIndigo
```

## Components

### Web dashboard

- [Dashboard pages](https://github.com/santoshpoudelx/dexbotx/tree/main/frontend/src/app): `frontend/src/app`
- [API proxy](https://github.com/santoshpoudelx/dexbotx/blob/main/frontend/src/app/api/%5B%5B...path%5D%5D/route.ts): `frontend/src/app/api/[[...path]]/route.ts`

### Backend API

- [Discord login and sessions](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/auth): `backend/src/auth`
- [Guild dashboard API](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/guilds): `backend/src/guilds`
- [Welcome and goodbye](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/welcome): `backend/src/welcome`
- [Economy configuration](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/economy): `backend/src/economy`
- [Admin operations](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/admin): `backend/src/admin`
- [Live updates](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/realtime): `backend/src/realtime`

### Discord bot

- [Bot shards and guild sync](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/bot): `backend/src/bot`
- [Community features](https://github.com/santoshpoudelx/dexbotx/blob/main/backend/src/bot/guild-sync.service.ts): `backend/src/bot/guild-sync.service.ts`
- [Moderation commands](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/bot/commands): `backend/src/bot/commands`

### Background work

- [Member event queue](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/queue): `backend/src/queue`
- [Queue worker](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/worker): `backend/src/worker`
- [Message rendering](https://github.com/santoshpoudelx/dexbotx/tree/main/backend/src/render): `backend/src/render`

### Data and integrations

- **PostgreSQL**
- **Redis**

### Other components

- **Server administrator**
- **Browser dashboard**
- **Discord Gateway**
- **Discord REST API**
- **Supabase Storage**

## Connections

- Server administrator → Browser dashboard: configures servers
- Browser dashboard → Dashboard pages: uses dashboard
- Dashboard pages → API proxy: sends API requests
- API proxy → Discord login and sessions: proxies requests
- API proxy → Guild dashboard API: proxies requests
- API proxy → Welcome and goodbye: proxies requests
- API proxy → Economy configuration: proxies requests
- API proxy → Admin operations: proxies requests
- Server administrator → Discord login and sessions: signs in
- Guild dashboard API → PostgreSQL: persists settings
- Welcome and goodbye → PostgreSQL: persists settings
- Economy configuration → PostgreSQL: persists economy data
- Discord login and sessions → Redis: stores sessions
- Live updates → Redis: uses pub/sub
- Browser dashboard → Live updates: receives live updates
- Discord Gateway → Bot shards and guild sync: delivers gateway events
- Bot shards and guild sync → Community features: handles community features
- Bot shards and guild sync → Moderation commands: dispatches commands
- Bot shards and guild sync → Member event queue: enqueues member jobs
- Member event queue → Queue worker: dispatches jobs
- Queue worker → Message rendering: renders messages
- Queue worker → PostgreSQL: reads latest data
- Bot shards and guild sync → PostgreSQL: writes sync and settings
- Queue worker → Discord REST API: sends REST requests
- Guild dashboard API → Supabase Storage: uploads backgrounds
- Queue worker → Discord REST API: posts rendered messages
