Overview
Better Uptime is organized as a Turborepo monorepo using pnpm workspaces. This structure enables code sharing, consistent tooling, and efficient builds across multiple applications and packages.Root Structure
Apps Directory
Theapps/ directory contains the main applications:
apps/client
Next.js 16 frontend application- React 19 with Next.js App Router
- tRPC client with React Query
- Tailwind CSS + HeroUI components
- MDX support for content
dev- Next.js development serverbuild- Production buildstart- Start production serverlint- Run ESLint
apps/server
Bun + tRPC API server- Bun runtime for performance
- tRPC API with type safety
- CORS enabled
- Hot reload in development
dev- Bun with hot reloadstart- Production server
apps/worker
Background job processor- Website uptime checks
- Alert notifications
- Data aggregation
apps/publisher
Event publishing servicePackages Directory
Shared packages used across applications:@repo/api
tRPC router definitions and business logic@repo/validators
Zod schema validators@repo/store
Prisma database client@repo/clickhouse
ClickHouse client for time-series data@repo/streams
Redis streams for real-time data@repo/config
Shared configuration@repo/ui
Shared React componentsTooling Directory
Development tooling packages:Workspace Configuration
pnpm-workspace.yaml
Package References
Internal packages use workspace protocol:workspace:*- Use current workspace versionworkspace:^- Use compatible workspace version
Turborepo Configuration
turbo.json
Defines task dependencies and caching:- Task pipelines with dependencies
- Output caching for builds
- Global environment variables
- TUI mode for better visibility
Global Environment Variables
Tech Stack Summary
| Layer | Technology |
|---|---|
| Monorepo | Turborepo + pnpm workspaces |
| Frontend | Next.js 16 + React 19 |
| API | tRPC + Zod validation |
| Runtime | Bun (server) + Node.js (client) |
| Database | PostgreSQL (Prisma) |
| Time-Series | ClickHouse |
| Streams | Redis |
| Testing | Vitest + Bun Test |
| Styling | Tailwind CSS + HeroUI |
| Type Safety | TypeScript 5.9 |
Navigation
For local navigation between packages, use TypeScript’s path mapping:package.json exports field.