DevHub is a modern, full-stack monorepo built with Turborepo and Bun. The stack combines a Next.js web application, an Elysia API backend, a Sanity CMS, a custom Discord bot, and a background queue worker for processing heavy tasks.
- Monorepo / Tooling: Turborepo, Bun, Biome, Husky, lint-staged
- Web App (
apps/web): Next.js 16, React 19, Tailwind CSS v4, shadcn/ui - API Server (
apps/server): Elysia, TypeScript - CMS (
apps/cms): Sanity Studio - Bot (
apps/bot): Discord.js custom bot - Background Worker (
apps/queue-worker): RabbitMQ consumer processing jobs with Puppeteer & Sharp - Database / ORM: PostgreSQL, Drizzle ORM (
@devhub/db) - Authentication: Better-Auth (
@devhub/auth) - Caching & Queues: Redis (
@devhub/redis), RabbitMQ (@devhub/queue)
devhub/
├── apps/
│ ├── bot/ # Discord bot application
│ ├── cms/ # Sanity Studio CMS
│ ├── queue-worker/ # Background job processor
│ ├── server/ # Backend API (Elysia)
│ └── web/ # Frontend application (Next.js)
│
├── packages/
│ ├── auth/ # Better-Auth configuration & logic
│ ├── config/ # Shared configuration (TypeScript, Biome, Tailwind)
│ ├── db/ # Database schema & Drizzle configuration
│ ├── env/ # Environment variable validation using Zod
│ ├── queue/ # RabbitMQ integration logic
│ ├── redis/ # Redis client and helpers
│ └── ui/ # Shared UI components (shadcn/ui)
- Bun (v1.3+ recommended)
- Docker & Docker Compose (for infrastructure)
- Clone the repository and install dependencies:
bun installEnsure you have your environment variables set up. Look for .env.example files in the respective applications and packages, or create your own .env files based on the project requirements.
The project includes a docker-compose.yml that provides PostgreSQL, Redis, and RabbitMQ.
Start the infrastructure:
bun run dev:infraNote: Running bun run dev:infra starts the services defined in docker-compose.yml.
Apply the database schema using Drizzle ORM:
bun run db:push(Optional) Seed or generate additional database logic:
bun run db:generate
bun run db:migrateStart all applications in development mode:
bun run devAlternatively, you can start individual applications:
bun run dev:web # Start only the Next.js web application (Port: 3001)
bun run dev:server # Start only the Elysia backend API (Port: 3000)Other services run on default ports:
- CMS is available via
cd apps/cms && bun run dev(Port: 3333) - Services APIs: Redis (6379), RabbitMQ (5672/15672), PostgreSQL (5432)
We use Drizzle ORM for strong typed database queries. Some handy commands:
bun run db:studio- Open Drizzle Studio UI to inspect and manage your database.bun run db:push- Sync your schema with the database directly.bun run db:generate- Generate migrations based on schema changes.bun run db:migrate- Apply pending migrations to the database.