Overview
The monorepo is organized into two main directories:apps/- Deployable applications (API, web panel, docs, etc.)packages/- Shared libraries and configurations
Directory Structure
Apps
API (apps/api/)
The backend API server built with Hono and Prisma.
Structure:
- Hono (web framework)
- Prisma (ORM)
- Better Auth (authentication)
- WebSocket (real-time updates)
Web (apps/web/)
The frontend panel built with Next.js 15.
Structure:
- Next.js 15 (React framework)
- React 19 (UI library)
- Tailwind CSS (styling)
- shadcn/ui (component library)
- TanStack Query (data fetching)
Home (apps/home/)
The marketing landing page built with Next.js.
Purpose:
- Public-facing website
- Product information
- Marketing content
Docs (apps/docs/)
The documentation site you’re reading right now, built with Mintlify.
Structure:
Desktop (apps/desktop/)
A desktop application built with Tauri for native desktop experience.
Daemon (apps/daemon/)
The Rust daemon that runs on each node to manage Docker containers.
Key Responsibilities:
- Container lifecycle management
- Resource monitoring
- Console streaming
- File system operations
Storybook (apps/storybook/)
Component playground for developing and testing UI components in isolation.
Packages
UI (packages/ui/)
Shared UI components used across web, home, and docs applications.
Structure:
ESLint Config (packages/eslint-config/)
Shared ESLint configurations for consistent code style.
Configurations:
- Base config for all TypeScript projects
- React-specific config for Next.js apps
- Library config for packages
TypeScript Config (packages/typescript-config/)
Shared TypeScript configurations for type safety.
Configurations:
- Base config with strict mode
- Next.js config for App Router
- Library config for packages
Plugin SDK (packages/plugin-sdk/)
SDK for developing custom game server plugins.
Workspace Configuration
pnpm Workspaces
Thepnpm-workspace.yaml file defines workspace packages:
- Shared
node_modulesfor common dependencies - Cross-package dependencies using
workspace:*protocol - Single
pnpm installfor entire monorepo
Turborepo Configuration
Theturbo.json file defines build pipelines:
- Dependency Graph: Builds packages in correct order
- Caching: Skips unchanged tasks for faster builds
- Parallel Execution: Runs independent tasks concurrently
- TUI: Terminal UI for monitoring tasks
Package Scripts
The rootpackage.json defines workspace-wide commands:
Build Commands
Development Commands
Quality Commands
Production Commands
Dependency Management
Adding Dependencies
Add to specific workspace:Workspace Dependencies
To use a package from the monorepo:workspace:* protocol ensures:
- Always uses local version during development
- Resolves to published version in production
- Type definitions stay in sync
Build Optimization
Turborepo Caching
Turborepo caches task outputs based on:- Input files (source code)
- Dependencies (package.json, lockfile)
- Environment variables (.env files)
- Task configuration (turbo.json)
Parallel Execution
Turborepo automatically:- Builds independent packages in parallel
- Respects dependency order (
dependsOn) - Maximizes CPU utilization
- Shows progress in TUI
Best Practices
Code Sharing
Versioning
The monorepo uses a single version for all packages:- Version defined in root
package.json - Updated automatically by release-please
- All packages released together