portfolio

# πŸ›°οΈ NexusBot **A premium Discord bot platform with a real-time management dashboard.** Built as a full-stack showcase β€” a discord.js v14 bot and a polished React control center, wired together with OAuth2, WebSockets and a clean, layered architecture. `TypeScript` Β· `discord.js v14` Β· `Express` Β· `MongoDB` Β· `Socket.IO` Β· `React` Β· `Vite` Β· `TailwindCSS`

✨ Highlights

Β  Feature
πŸ” Discord OAuth2 login β†’ pick a server you manage β†’ open its dashboard
πŸ“Š Live dashboard β€” member counts, bot ping, uptime, CPU/RAM & DB status streamed over WebSockets
πŸ›‘οΈ Moderation β€” ban, kick, timeout, warn, unban, purge, slowmode, lock/unlock β€” every action stored as a numbered case
πŸ‘‹ Welcome system β€” channel picker, embed builder, variable support and a pixel-accurate live preview
πŸ“ˆ Analytics β€” command usage and moderation trends in interactive charts
βš™οΈ Settings β€” prefix, language and embed colour, persisted per guild
πŸ€– 14 slash commands β€” moderation + utility (serverinfo, userinfo, avatar, ping, help)
πŸ“š Auto-generated API docs (OpenAPI / Swagger UI)
🐳 Docker-first β€” docker compose up brings up Mongo + API + dashboard

🧱 Tech stack

Backend β€” Node.js 22, TypeScript, discord.js v14, Express, MongoDB + Mongoose, Passport (Discord OAuth2), JWT (httpOnly cookies), Socket.IO, Zod, Helmet, Winston, Swagger.

Frontend β€” React 18, Vite, TypeScript, TailwindCSS, Framer Motion, Recharts, React Router, TanStack Query, Lucide icons.

Tooling β€” npm workspaces, ESLint, Prettier, Husky + lint-staged, GitHub Actions CI, Docker.

πŸ“‚ Project structure

nexusbot/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ server/            # API + realtime gateway + Discord bot (TypeScript)
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ bot/        # client, command & event loaders, commands, events
β”‚   β”‚       β”œβ”€β”€ config/     # env validation (zod) + constants
β”‚   β”‚       β”œβ”€β”€ db/         # Mongoose connection + models
β”‚   β”‚       β”œβ”€β”€ repositories/  # data-access layer
β”‚   β”‚       β”œβ”€β”€ services/   # business logic (auth, guild, moderation, welcome, stats)
β”‚   β”‚       └── http/       # express app, middleware, controllers, routes, socket, swagger
β”‚   └── web/               # React dashboard (Vite)
β”‚       └── src/
β”‚           β”œβ”€β”€ components/ # ui/ layout/ charts/ common/
β”‚           β”œβ”€β”€ context/    # auth provider
β”‚           β”œβ”€β”€ hooks/      # data hooks (TanStack Query + realtime)
β”‚           β”œβ”€β”€ pages/      # landing, login, server picker, dashboard/*
β”‚           └── lib/        # api client, socket, utils
β”œβ”€β”€ docs/                  # SETUP Β· ARCHITECTURE Β· DEPLOYMENT
β”œβ”€β”€ docker-compose.yml
└── package.json           # npm workspaces root

πŸš€ Quick start

Prerequisites: Node.js β‰₯ 20, a MongoDB instance (local or Atlas), and a Discord application. The full walkthrough β€” including the Discord Developer Portal β€” is in docs/SETUP.md.

# 1. Install dependencies (npm workspaces)
npm install

# 2. Configure environment
cp apps/server/.env.example apps/server/.env   # fill in Discord + Mongo details
cp apps/web/.env.example    apps/web/.env

# 3. Register the bot's slash commands
npm run deploy:commands

# 4. Run the API + bot and the dashboard together
npm run dev

🐳 …or with Docker

cp .env.example .env        # fill in Discord credentials
docker compose up --build

Brings up MongoDB, the API/bot and the dashboard (served by nginx). See docs/DEPLOYMENT.md.

πŸ“œ Scripts

Command Description
npm run dev Run API/bot and dashboard concurrently
npm run build Type-check and build both apps
npm run deploy:commands Register slash commands with Discord
npm run lint / npm run format Lint / format the whole monorepo
npm run typecheck Type-check both apps

πŸ—ΊοΈ Roadmap

The codebase is structured so each feature is a vertical slice (model β†’ repository β†’ service β†’ controller β†’ route, plus a page and a bot command/event). Planned modules that follow the same pattern:

πŸ“„ License

MIT Β© 2026 Veer β€” see LICENSE.