README
ΒΆ
Discord Enterprise App
Complete Full-Stack Enterprise Orchestration Platform β Discord Bot, Web Dashboard, CLI Console, Email Suite, and Infrastructure Management
A next-generation enterprise management platform featuring a Discord bot for guild administration, a Next.js web dashboard, a Go Gin REST API, a PostgreSQL-backed email suite (IMAP/SMTP/POP3), an OPNsense-style CLI console (vaultctl), and a comprehensive infrastructure stack β all unified in a pnpm monorepo.
π Quick Start β’ π What's New β’ π Current Status β’ π οΈ Tech Stack β’ π Architecture β’ π€ Contributing
π What is Discord Enterprise?
Discord Enterprise is a full-stack, multi-platform orchestration platform built by Sky Genesis Enterprise. It unifies Discord guild management, web administration, API services, email infrastructure, CLI system administration, and enterprise deployment β all within a single monorepo.
π― Vision
- π€ Discord Bot β Slash-command driven guild management with discord.js v14
- π Web Dashboard β Next.js 16 + React 19 with shadcn/ui, i18n, and Fumadocs documentation
- βοΈ Go REST API β High-performance Gin framework backend with GORM + PostgreSQL
- π§ Email Suite β Complete IMAP/SMTP/POP3 stack with OAuth (Google, Microsoft, Proton)
- π₯οΈ CLI Console (vaultctl) β OPNsense-style interactive system management for Linux appliances
- ποΈ Enterprise Infrastructure β Docker, Kubernetes, Terraform, Redis, Prometheus/Grafana
- π Enterprise Security β JWT auth, OAuth, RBAC, rate limiting, audit logging, MFA
- π Comprehensive Docs β Fumadocs MDX documentation with OpenAPI specs and i18n
π What's New
π― Major Features
π€ Discord Bot (NEW)
- β Slash commands: about, help, ping, rules, serverinfo, status, userinfo
- β Event handling: ready, interactionCreate
- β Automatic guild command deployment
- β ESM JavaScript architecture with discord.js v14
π₯οΈ vaultctl CLI Console (NEW)
- β OPNsense-style interactive menu system
- β System management: status, shutdown, reboot, info
- β Service management with systemd integration
- β Network management: interfaces, IP config, ping diagnostics
- β Security: user management, SSH keys, audit logs
- β Maintenance: backup, update, cleanup, integrity checks
- β Vault integration: status, tokens, seal/unseal
- β PAM authentication and SSH integration
π§ Email Suite (NEW)
- β Full IMAP (993), SMTP (587), POP3 (995) implementation
- β Stalwart mail server integration
- β OAuth providers: Google, Microsoft, Proton
- β Complete email database schema: MailAccounts, Mailboxes, Threads, Emails, Recipients, Attachments
ποΈ Enhanced Architecture (IMPROVED)
- β pnpm monorepo with 11 workspace packages
- β Go 1.25 + Gin 1.11 backend with GORM + PostgreSQL
- β Next.js 16 + React 19 with App Router and TypeScript 6
- β Prisma 7 schema as source of truth (45+ models, 1267 lines)
- β Docker Compose with 4 services (postgres, api, bot, web)
- β 17 GitHub Actions CI/CD workflows
- β Multi-stage Docker builds + Kubernetes manifests + Terraform
π Current Status
β Active Development: From foundation to full enterprise orchestration platform.
β Currently Implemented
π€ Discord Bot
- β Slash command framework with deployment scripts
- β Guild information and moderation commands
- β Event-driven architecture
- β Docker container support
π Web Dashboard
- β Next.js 16 with App Router and TypeScript strict mode
- β shadcn/ui component library with 30+ Radix primitives
- β Multi-language i18n support (next-intl)
- β Authentication flow: login, register, MFA, OAuth callbacks
- β Fumadocs documentation system with MDX and OpenAPI
- β Theme system (dark/light with next-themes)
- β Responsive layout with mobile support
- β Route-based auth protection (AuthGuard, ProtectedRoute)
βοΈ Go REST API
- β
Full REST API at
/api/v1/with 20+ resource endpoints - β CRUD for: categories, media, pages, dossiers, services, users, API keys, webhooks, newsletters
- β Status/incident/maintenance management
- β Public endpoints: contact, newsletter, status, pages
- β JWT authentication with OAuth (Google, Microsoft, Proton)
- β Rate limiting, CORS, security headers, CSRF protection
- β Analytics, audit logging, notifications, scheduling
- β Full-text search and file attachments
- β Calendar, meetings, todos services
π₯οΈ vaultctl CLI Console
- β Interactive menu system with ASCII banners
- β System, service, network, security, maintenance actions
- β PAM authentication and session management
- β Systemd integration and MOTD replacement
- β Multi-stage Docker build
ποΈ Database
- β Prisma schema with 45+ models (users, orgs, email, CMS, calendar, etc.)
- β GORM integration for Go runtime
- β User roles: USER, EDITOR, ADMIN, OWNER
- β Subscription tiers: FREE, ESSENTIAL, PREMIUM, ENTERPRISE
ποΈ Infrastructure
- β Docker Compose (dev + cloud profiles)
- β Kubernetes manifests (deployment, service, configmap, ingress)
- β Redis caching (dev, test, prod)
- β Prometheus + Grafana + Loki monitoring stack
- β Terraform for cloud deployment
- β 17 GitHub Actions workflows
- β Dependabot, CodeQL, semantic release (Changesets)
π In Development
- Advanced RBAC β Fine-grained role-based access control
- Plugin System β External action loading for vaultctl
- Real-Time Monitoring β Live metrics and logs dashboard
- Advanced Network Tools β Firewall and route configuration
- Web-Based Management Console β GUI for vaultctl operations
- Cluster Management β Multi-node orchestration
π Planned Features
- Mobile Companion App β React Native / Capacitor mobile client
- Advanced Email Security β Spam filtering, virus scanning, encryption
- Full Calendar & Contacts Sync β CalDAV/CardDAV support
- E2E Testing Suite β Comprehensive Playwright and Go tests
- Performance Optimization β Caching, CDN, edge deployment
π Quick Start
π Prerequisites
- Go 1.25.0 or higher (for backend + CLI)
- Node.js 20.0.0 or higher (for frontend + bot)
- pnpm 9.0.0 or higher (recommended package manager)
- PostgreSQL 16.0 or higher (for database)
- Docker & Docker Compose (optional, for containerized deployment)
- Make (for command shortcuts)
π§ Installation & Setup
-
Clone the repository
git clone https://github.com/skygenesisenterprise/discord-enterprise.git cd discord-enterprise -
Install dependencies
# Install all workspace dependencies pnpm install # Generate Prisma client pnpm db:generate -
Environment setup
cp .env.example .env # Edit .env with your database credentials and API keys -
Database initialization
pnpm db:migrate pnpm db:seed # Optional: seed development data -
Start development servers
# Start all services (frontend + backend) pnpm dev # Or start individually: pnpm dev:frontend # Next.js on port 3000 pnpm dev:backend # Go API on port 8080 pnpm dev:cli # vaultctl CLI
π Access Points
Once running, you can access:
- Web Dashboard: http://localhost:3000
- API Server: http://localhost:8080
- Health Check: http://localhost:8080/api/v1/health
- API Documentation: http://localhost:3000/docs
- Discord Bot: Configure via
.envwith your bot token - Discord Staff Panel: Set
DISCORD_PANEL_CHANNEL_ID, then run/panel setup. The bot keeps one persistent staff control message in that channel and repairs it automatically on startup. - Discord Welcome Messages: Set
DISCORD_RULES_CHANNEL_ID,DISCORD_WELCOME_CHANNEL_ID,DISCORD_ROLE_MEMBER_ID, andDISCORD_ROLE_AGENTS_ID./welcome panelpublishes the human verification panel in the rules channel./welcome setupenables arrival embeds in the welcome channel; humans receive the selected member role and bots receive the agents role. - vaultctl CLI:
pnpm cliorgo run ./cmd
π³ Docker Quick Start
# Development environment
docker compose -f docker-compose.dev.yml up -d
# Production environment
docker compose -f docker-compose.cloud.yml up -d
π― Available Commands
# π Development
pnpm dev # Start all services (frontend + backend)
pnpm dev:frontend # Frontend only (port 3000)
pnpm dev:backend # Backend only (port 8080)
pnpm dev:cli # vaultctl CLI development
# ποΈ Building
pnpm build # Build all workspaces
pnpm start # Start production servers
# ποΈ Database
pnpm db:generate # Generate Prisma client
pnpm db:migrate # Run migrations
pnpm db:studio # Open Prisma Studio
pnpm db:seed # Seed development data
# π§ Code Quality
pnpm lint # Lint all packages
pnpm typecheck # TypeScript type checking
pnpm format # Format code with Prettier
pnpm test # Run all tests
# π³ Docker
pnpm docker:build # Build Docker image
pnpm docker:run # Start Docker Compose
# π οΈ CLI
pnpm cli # Run vaultctl CLI tool
# π¦ Release
pnpm changeset # Manage changesets
pnpm clean # Clean build artifacts
π οΈ Tech Stack
π Frontend Layer
Next.js 16 + React 19.2.6 + TypeScript 6
βββ π¨ Tailwind CSS v4 + shadcn/ui (30+ Radix primitives)
βββ π next-intl (Internationalization)
βββ π Fumadocs (MDX Documentation + OpenAPI)
βββ π JWT + OAuth Authentication (Complete Implementation)
βββ π£οΈ Next.js App Router (Routing)
βββ π Framer Motion (Animations)
βββ π Recharts (Charts & Visualization)
βββ ποΈ Zustand 5 (State Management)
βββ π React Hook Form + Zod 4 (Forms & Validation)
βββ π§ ESLint + Prettier + Stylelint (Code Quality)
βοΈ Backend Layer
Go 1.25.5 + Gin Framework 1.11
βββ ποΈ GORM 1.31 + PostgreSQL 16 (Database Layer)
βββ π JWT + OAuth Authentication
βββ π§ IMAP/SMTP/POP3 Services (Stalwart Integration)
βββ π‘οΈ Middleware (CORS, Rate Limit, Security, CSRF)
βββ π Prometheus Metrics
βββ π REST API Routes (/api/v1/)
βββ π Full-Text Search
βββ π Structured Logging
π€ Discord Bot Layer
discord.js 14.25.1 (ESM)
βββ π¬ Slash Commands (about, help, ping, rules, serverinfo, status, userinfo)
βββ π Event Handlers (ready, interactionCreate)
βββ π Auto Command Deployment
βββ π³ Docker Ready
π₯οΈ CLI Console Layer (vaultctl)
Go + Cobra CLI Framework
βββ π― Interactive OPNsense-Style Menu System
βββ βοΈ System Management (status, shutdown, reboot)
βββ π§ Service Management (systemd)
βββ π Network Management (interfaces, IP, ping)
βββ π Security Management (users, SSH keys, audit)
βββ π‘οΈ Maintenance (backup, update, cleanup)
βββ ποΈ Vault Integration (status, tokens, seal/unseal)
βββ π PAM Authentication
βββ π³ Multi-Stage Docker Support
ποΈ Data Layer
PostgreSQL 16 + Prisma 7 + GORM 1.31
βββ ποΈ Prisma Schema (45+ Models, Source of Truth)
βββ π GORM Query Builder (Go Runtime ORM)
βββ π Auto-Migrations (Prisma + GORM)
βββ π₯ User Models (Roles: USER, EDITOR, ADMIN, OWNER)
βββ π§ Email Stack (MailAccounts, Mailboxes, Threads, Emails)
βββ π
Calendar & Events
βββ β
Todos & Todo Lists
βββ π° CMS (Categories, Articles, Media, Comments)
βββ π Analytics & Audit Logging
ποΈ Monorepo Infrastructure
pnpm Workspaces + Go Modules + Docker Compose
βββ π¦ app/ (Next.js Frontend - TypeScript)
βββ βοΈ server/ (Go Gin API)
βββ π€ bot/ (Discord Bot - JavaScript/ESM)
βββ π₯οΈ cmd/ (vaultctl CLI - Go)
βββ ποΈ prisma/ (Database Schema & Migrations)
βββ π οΈ tools/ (Development Utilities)
βββ π§ services/ (Core Services - TypeScript)
βββ πΊοΈ routers/ (API Routing)
βββ π§ͺ tests/ (Test Suite)
βββ π³ docker/ (Docker Configuration)
βββ π¦ infrastructure/ (K8s, Terraform, Redis, Monitoring)
βββ π assets/ (Static Assets)
βββ π example/ (Example Content)
π Architecture
ποΈ Monorepo Structure
discord-enterprise/
βββ app/ # Next.js 16 Frontend (TypeScript)
β βββ app/ # App Router pages
β β βββ (auth)/ # Authentication pages
β β βββ (docs)/ # Fumadocs documentation
β β βββ (platform)/ # Dashboard & platform UI
β β βββ api/ # API route handlers
β βββ components/ # React components
β β βββ ui/ # shadcn/ui primitives
β β βββ ... # Feature components
β βββ contexts/ # React contexts (auth, locale, consent)
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility functions
β βββ styles/ # Tailwind CSS styles
βββ server/ # Go Gin API Backend
β βββ api/
β β βββ v1/ # API route handlers
β β βββ categories/ # CRUD resources
β β βββ users/ # User management
β β βββ media/ # Media management
β β βββ ... # 20+ resource handlers
β βββ middleware/ # Gin middleware
β βββ models/ # GORM models & interfaces
β βββ services/ # Business logic
β β βββ imap/ # IMAP service
β β βββ smtp/ # SMTP service
β β βββ pop3/ # POP3 service
β β βββ oauth/ # OAuth providers
β β βββ calendar/ # Calendar service
β β βββ ... # Other services
β βββ routes/ # Route definitions
βββ bot/ # Discord Bot (JavaScript/ESM)
β βββ commands/ # Slash command definitions
β βββ events/ # Event handlers
β βββ deploy-commands.js # Command deployment script
βββ cmd/ # vaultctl CLI Console (Go)
β βββ actions/ # Command actions
β βββ banners/ # ASCII art banners
β βββ menus/ # Interactive menu system
β βββ main.go # Entry point
βββ prisma/ # Database Schema
β βββ schema.prisma # 45+ models, 1267 lines
βββ infrastructure/ # Infrastructure-as-Code
β βββ docker/ # Docker Compose configs
β βββ k8s/ # Kubernetes manifests
β βββ redis/ # Redis configuration
β βββ monitoring/ # Prometheus/Grafana/Loki
β βββ terraform/ # Terraform scripts
βββ docker/ # Docker support
βββ .github/ # GitHub configuration
β βββ workflows/ # 17 CI/CD pipelines
βββ package.json # pnpm workspace root
π Data Flow Architecture
ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Next.js App β β Go Gin API β β PostgreSQL 16 β
β (Frontend) ββββββΊβ (Backend) ββββββΊβ (Database) β
β Port 3000 β β Port 8080 β β Port 5432 β
β TypeScript 6 β β Go 1.25 β β β
ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
shadcn/ui UI REST API /api/v1/ Prisma Schema
i18n (next-intl) JWT Auth + OAuth 45+ Models
Fumadocs Docs IMAP/SMTP/POP3 GORM ORM
Zustand State Calendar/Todos Auto-migrations
β β
βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ
β Discord Bot β β vaultctl CLI β
β discord.js 14 β β Go + Cobra β
β Slash Commands β β System Console β
β Guild Admin β β OPNsense-Style β
ββββββββββββββββββββ ββββββββββββββββββββ
πΊοΈ Development Roadmap
π― Phase 1: Foundation (β Complete)
- β Monorepo Setup β pnpm workspaces + Go modules
- β Next.js Frontend β App Router, shadcn/ui, i18n
- β Go Gin API β Full REST framework with middleware
- β Database Schema β Prisma + GORM, 45+ models
- β Authentication β JWT + OAuth (Google, Microsoft, Proton)
- β Docker Setup β Multi-container orchestration
- β CI/CD Pipeline β 17 GitHub Actions workflows
π Phase 2: Core Features (β Complete)
- β Discord Bot β Slash commands, events, guild management
- β vaultctl CLI β OPNsense-style interactive system console
- β Email Suite β IMAP/SMTP/POP3 with Stalwart integration
- β Documentation β Fumadocs MDX with OpenAPI specs
- β Infrastructure β K8s, Terraform, Redis, Monitoring
- β API Resource CRUD β 20+ endpoints with full admin
βοΈ Phase 3: Enhancement (π In Progress)
- π Advanced RBAC β Fine-grained permission system
- π Plugin System β Extensible action loading for vaultctl
- π Real-Time Monitoring β Live metrics dashboard
- π Web Console β GUI for vaultctl system management
- π Testing Suite β Comprehensive Playwright + Go tests
π Phase 4: Enterprise (π Planned)
- π Mobile App β React Native / Capacitor companion
- π Email Security β Spam filtering, virus scanning, encryption
- π CalDAV/CardDAV β Calendar and contacts sync
- π Cluster Management β Multi-node orchestration
- π Performance Optimization β CDN, edge, caching
π» Development
π Development Workflow
# New developer setup
pnpm install && pnpm db:generate && pnpm db:migrate
# Daily development
pnpm dev # Start working on both frontend + backend
pnpm dev:frontend # Frontend-only development
pnpm dev:backend # Backend-only development
pnpm dev:cli # CLI development
# Code quality
pnpm lint # Check code quality
pnpm lint:fix # Auto-fix linting issues
pnpm typecheck # Verify TypeScript types
pnpm format # Format code with Prettier
# Database changes
pnpm db:generate # Generate Prisma client after schema changes
pnpm db:migrate # Apply new migrations
pnpm db:studio # Browse database in Prisma Studio
# Before committing
pnpm format && pnpm lint && pnpm typecheck
# Testing
pnpm test # Run all tests
pnpm test:e2e # Run Playwright E2E tests
π― Docker Commands
# Development environment
docker compose -f docker-compose.dev.yml up -d
# Production environment
docker compose -f docker-compose.cloud.yml up -d
# View logs
docker compose logs -f
# Rebuild specific service
docker compose build api
π Development Guidelines
- pnpm Workspaces β Use workspace-specific dependencies
- TypeScript Strict Mode β All frontend code must pass strict checks
- Go Conventions β Follow standard Go project layout
- Conventional Commits β Standardized commit messages
- Prisma Source of Truth β Schema changes start in Prisma
- API Design β RESTful endpoints with
/api/v1/prefix - Component Patterns β shadcn/ui conventions for React components
- Security First β Validate all inputs, implement proper auth
- Error Handling β Comprehensive error handling and logging
π€ Contributing
We're looking for contributors to help build this comprehensive enterprise orchestration platform! Whether you're experienced with Go, TypeScript, Discord bots, CLI tools, email protocols, or DevOps, there's a place for you.
π― How to Get Started
- Fork the repository and create a feature branch
- Check the issues for tasks that need help
- Join discussions about architecture and features
- Start small β Documentation, tests, or minor features
- Follow our code standards and commit guidelines
ποΈ Areas Needing Help
- Go Backend β API endpoints, email services, middleware, security
- TypeScript Frontend β React components, UI/UX, dashboard, docs
- Discord Bot β New commands, moderation features, event handling
- vaultctl CLI β System actions, plugins, network tools
- Email Protocols β IMAP, SMTP, POP3 implementation
- Database β Schema design, migrations, optimization
- DevOps β Docker, K8s, Terraform, CI/CD
- Security β Authentication, encryption, penetration testing
- Documentation β API docs, user guides, tutorials
π Support & Community
π¬ Get Help
- π Documentation β Comprehensive guides and API docs
- π GitHub Issues β Bug reports and feature requests
- π‘ GitHub Discussions β General questions and ideas
- π§ Email β support@skygenesisenterprise.com
π Reporting Issues
When reporting bugs, please include:
- Clear description of the problem
- Steps to reproduce
- Environment information (Go version, Node.js version, OS)
- Error logs or screenshots
- Expected vs actual behavior
π Project Status
| Component | Status | Technology | Notes |
|---|---|---|---|
| Web Dashboard | β Working | Next.js 16 + React 19 + TypeScript 6 | shadcn/ui, i18n, Fumadocs |
| Go REST API | β Working | Gin 1.11 + GORM 1.31 | 20+ resource endpoints |
| Discord Bot | β Working | discord.js 14 | Slash commands, guild admin |
| vaultctl CLI | β Working | Go + Cobra | OPNsense-style console |
| Database Schema | β Working | Prisma 7 + PostgreSQL 16 | 45+ models, 1267 lines |
| Email Suite | β Working | IMAP/SMTP/POP3 + Stalwart | OAuth: Google, Microsoft, Proton |
| Authentication | β Working | JWT + OAuth | Login, register, MFA |
| Docker Deployment | β Working | Multi-stage + Compose | Dev + cloud profiles |
| Kubernetes | β Working | Manifests + Terraform | Deployment, service, ingress |
| Monitoring | β Working | Prometheus + Grafana + Loki | Full observability stack |
| CI/CD | β Working | GitHub Actions | 17 workflows |
| Calendar & Todos | β Working | Server services | Full CRUD |
| CMS | β Working | Categories, Articles, Media | Full content management |
| Webhooks & API Keys | β Working | CRUD + admin | Rate limited |
| Advanced RBAC | π In Progress | Go/TS | Fine-grained permissions |
| Plugin System | π In Progress | Go | External action loading |
| Real-Time Monitoring | π In Progress | WebSocket | Live metrics dashboard |
| Mobile App | π Planned | Capacitor | iOS/Android companion |
| Testing Suite | π Planned | Playwright + Go | E2E + unit tests |
π Sponsors & Partners
Development led by Sky Genesis Enterprise
We're looking for sponsors and partners to help accelerate development of this open-source enterprise orchestration platform.
π License
This project is licensed under the MIT License β see the LICENSE file for details.
MIT License
Copyright (c) 2025 Sky Genesis Enterprise
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
π Acknowledgments
- Sky Genesis Enterprise β Project leadership and vision
- Go Community β High-performance programming language and ecosystem
- Gin Framework β Lightweight HTTP web framework
- GORM Team β Modern Go database library
- Next.js Team β Excellent React framework
- React Team β Modern UI library
- shadcn/ui β Beautiful component library
- Prisma Team β Next-generation ORM
- discord.js Team β Powerful Discord API framework
- Cobra CLI β Go framework for CLI applications
- Tailwind CSS β Utility-first CSS framework
- Radix UI β Accessible UI primitives
- Fumadocs β Documentation framework
- PostgreSQL Team β World's most advanced open-source database
- Docker Team β Container platform and tools
- Kubernetes Community β Container orchestration
- Prometheus & Grafana Teams β Monitoring and observability
- Terraform Team β Infrastructure as code
- pnpm β Fast, disk space efficient package manager
- Open Source Community β Tools, libraries, and inspiration
π Join Us in Building the Future of Enterprise Infrastructure Management!
β Star This Repo β’ π Report Issues β’ π‘ Start a Discussion
π§ Full-Stack Enterprise Orchestration β Discord Bot, Web Dashboard, CLI Console, Email Suite, and Infrastructure Management
Made with β€οΈ by the Sky Genesis Enterprise team
Building an enterprise-grade orchestration platform with complete tooling for modern infrastructure management