Dashboard Stack
A comprehensive guide to building a modern, performant dashboard application using cutting-edge technologies optimized for edge computing and real-time data visualization.
Tech Stack Summary
Section titled βTech Stack SummaryβFrontend
Section titled βFrontendβ- Framework: React 19 + TypeScript
- Build Tool: Bun
- Routing: TanStack Router
- UI Library: shadcn/ui (Tailwind CSS + Radix UI + Lucide Icons)
- State Management: Zustand
- Data Fetching: TanStack Query (React Query)
- Forms: React Hook Form + Zod
- Tables: TanStack Table
- Charts: Recharts + Tremor
Backend
Section titled βBackendβ- API Framework: Hono (Cloudflare Workers)
- Database: Drizzle ORM + Neon PostgreSQL
- Storage: Cloudflare R2 (Object Storage)
- Analytics: ClickHouse
- Real-time: WebSocket (Durable Objects)
- Authentication: Better Auth
DevOps & Tools
Section titled βDevOps & Toolsβ- Deployment: Cloudflare Workers + Cloudflare Pages
- Monitoring: Sentry Edge SDK
- CI/CD: GitHub Actions
- Linting: ESLint + Prettier
- Testing: Bun + React Testing Library
Overview
Section titled βOverviewβThis tech stack is designed for building high-performance, real-time dashboards deployed on the edge with:
- Serverless-first architecture (Cloudflare Workers)
- Real-time data capabilities (WebSocket)
- Analytics processing (ClickHouse)
- Type-safe, modern DX (TypeScript, Bun)
Architecture Stack
Section titled βArchitecture StackβFramework: React 19 + TypeScript
Section titled βFramework: React 19 + TypeScriptβWhy React 19?
Section titled βWhy React 19?β- Latest features: React Server Components, improved Suspense, automatic batching
- Performance: Smaller bundle sizes, faster hydration
- Ecosystem: Largest component library ecosystem
- Type Safety: First-class TypeScript support
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | React 19 | Vue 3 | Svelte | Solid.js |
|---|---|---|---|---|
| Performance | ββββ | ββββ | βββββ | βββββ |
| Ecosystem | βββββ | ββββ | βββ | ββ |
| Learning Curve | βββ | ββββ | βββββ | βββ |
| Dashboard Libraries | βββββ | ββββ | βββ | ββ |
Installation
Section titled βInstallationβbun create vite my-dashboard --template react-tsnpm create vite@latest my-dashboard -- --template react-tsBuild Tool: Bun
Section titled βBuild Tool: BunβWhy Bun?
Section titled βWhy Bun?β- Speed: 4x faster than npm, 3x faster than pnpm
- All-in-one: Runtime + bundler + package manager + test runner
- Native TypeScript: No transpilation needed
- Node.js compatible: Drop-in replacement
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Tool | Install Speed | Build Speed | Runtime | Test Runner |
|---|---|---|---|---|
| Bun | π Fastest | π Fastest | β Yes | β Yes |
| pnpm | β‘ Fast | - | β No | β No |
| npm | π Slow | - | β No | β No |
| Vite | - | β‘ Fast | β No | β No |
Installation
Section titled βInstallationβ-
Install Bun
Terminal window curl -fsSL https://bun.sh/install | bash -
Verify installation
Terminal window bun --version -
Create new project
Terminal window bun create vite my-dashboardcd my-dashboardbun install
Routing: TanStack Router
Section titled βRouting: TanStack RouterβWhy TanStack Router?
Section titled βWhy TanStack Router?β- Type-safe: Fully typed routes, params, and search params
- Built-in data loading: Loader pattern with suspense
- Code splitting: Automatic route-based splitting
- Developer Experience: Best-in-class TypeScript DX
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | TanStack Router | React Router v6 | Next.js Router | Remix |
|---|---|---|---|---|
| Type Safety | βββββ | ββ | βββ | ββββ |
| Data Loading | βββββ | βββ | ββββ | βββββ |
| Bundle Size | ββββ | ββββ | βββ | ββ |
| Flexibility | βββββ | ββββ | ββ | βββ |
Installation
Section titled βInstallationβbun add @tanstack/react-routerbun add -D @tanstack/router-devtools @tanstack/router-vite-pluginData Layer: Drizzle ORM + Neon PostgreSQL
Section titled βData Layer: Drizzle ORM + Neon PostgreSQLβWhy Drizzle ORM?
Section titled βWhy Drizzle ORM?β- TypeScript-first: Fully type-safe queries
- Lightweight: 10kb bundle size (vs 80kb Prisma)
- Edge-compatible: Works with Cloudflare Workers
- SQL-like: Direct SQL mapping, no magic
Why Neon PostgreSQL?
Section titled βWhy Neon PostgreSQL?β- Serverless: Pay-per-use, auto-scaling
- HTTP driver: Works with edge runtimes (no TCP)
- Fast cold starts: Database branching for dev/staging
- PostgreSQL compatible: Full Postgres features
Alternatives Comparison
Section titled βAlternatives ComparisonβORM Comparison:
| Feature | Drizzle | Prisma | TypeORM | Kysely |
|---|---|---|---|---|
| Edge Support | β Yes | β No | β No | β Yes |
| Type Safety | βββββ | βββββ | βββ | βββββ |
| Bundle Size | 10kb | 80kb | 120kb | 15kb |
| SQL-like | βββββ | βββ | ββ | βββββ |
Database Comparison:
| Feature | Neon | Supabase | PlanetScale | Railway |
|---|---|---|---|---|
| Serverless | β Yes | β Yes | β Yes | β No |
| Edge Runtime | β HTTP | β HTTP | β HTTP | β TCP |
| Branching | β Yes | β No | β Yes | β No |
| Free Tier | ββββ | βββββ | βββ | βββ |
Installation
Section titled βInstallationβ-
Install Drizzle
Terminal window bun add drizzle-orm @neondatabase/serverlessbun add -D drizzle-kit -
Install Neon CLI optional
Terminal window bun add -D @neondatabase/cli -
Setup Drizzle config
drizzle.config.ts import type { Config } from 'drizzle-kit';export default {schema: './src/db/schema.ts',out: './drizzle',driver: 'pg',dbCredentials: {connectionString: process.env.DATABASE_URL!,},} satisfies Config;
Data Fetching: TanStack Query (React Query)
Section titled βData Fetching: TanStack Query (React Query)βWhy TanStack Query?
Section titled βWhy TanStack Query?β- Smart caching: Automatic background refetching
- Optimistic updates: UI updates before server response
- Devtools: Visual query debugging
- Edge-optimized: Works perfectly with serverless APIs
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | TanStack Query | SWR | Apollo Client | RTK Query |
|---|---|---|---|---|
| REST API | βββββ | βββββ | βββ | ββββ |
| GraphQL | ββββ | βββ | βββββ | ββ |
| Bundle Size | 13kb | 4kb | 32kb | 18kb |
| Features | βββββ | ββββ | βββββ | ββββ |
| DX | βββββ | ββββ | βββ | ββββ |
Installation
Section titled βInstallationβbun add @tanstack/react-querybun add -D @tanstack/react-query-devtoolsForms: React Hook Form + Zod
Section titled βForms: React Hook Form + ZodβWhy React Hook Form?
Section titled βWhy React Hook Form?β- Performance: Uncontrolled components, minimal re-renders
- Small bundle: 9kb gzipped
- Easy validation: Native HTML5 + custom validators
- Great DX: Simple API, TypeScript support
Why Zod?
Section titled βWhy Zod?β- Type inference: Schema creates TypeScript types automatically
- Runtime validation: Parse and validate at runtime
- Composable: Reusable schemas
- Error messages: Detailed, customizable errors
Alternatives Comparison
Section titled βAlternatives ComparisonβForm Libraries:
| Feature | React Hook Form | Formik | React Final Form |
|---|---|---|---|
| Performance | βββββ | βββ | ββββ |
| Bundle Size | 9kb | 13kb | 11kb |
| TypeScript | βββββ | ββββ | βββ |
| DX | βββββ | ββββ | βββ |
Validation Libraries:
| Feature | Zod | Yup | Joi | Ajv |
|---|---|---|---|---|
| TypeScript | βββββ | ββββ | βββ | ββ |
| Bundle Size | 10kb | 17kb | 146kb | 38kb |
| DX | βββββ | ββββ | βββ | ββ |
Installation
Section titled βInstallationβbun add react-hook-form zod @hookform/resolversUI Library: shadcn/ui (Tailwind + Radix + Lucide)
Section titled βUI Library: shadcn/ui (Tailwind + Radix + Lucide)βWhy shadcn/ui?
Section titled βWhy shadcn/ui?β- Copy-paste components: Own your code, no npm bloat
- Radix primitives: Accessible, unstyled components
- Tailwind styling: Utility-first, customizable
- Lucide icons: Beautiful, consistent icon set
Component Breakdown:
Section titled βComponent Breakdown:β- shadcn/ui: Component patterns
- Radix UI: Accessible primitives (Dialog, Dropdown, etc.)
- Tailwind CSS: Styling system
- Lucide React: Icon library
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | shadcn/ui | Material UI | Chakra UI | Mantine |
|---|---|---|---|---|
| Customization | βββββ | βββ | ββββ | ββββ |
| Bundle Control | βββββ | ββ | βββ | βββ |
| Accessibility | βββββ | ββββ | ββββ | ββββ |
| Dashboard Ready | βββββ | βββββ | ββββ | ββββ |
| No Runtime Deps | βββββ | ββ | ββ | ββ |
Installation
Section titled βInstallationβ-
Install dependencies
Terminal window bun add tailwindcss autoprefixer postcssbun add tailwindcss-animate class-variance-authority clsx tailwind-mergebun add @radix-ui/react-* lucide-react -
Initialize shadcn/ui
Terminal window bunx shadcn-ui@latest init -
Add components as needed
Terminal window bunx shadcn-ui@latest add buttonbunx shadcn-ui@latest add cardbunx shadcn-ui@latest add table
State Management: Zustand
Section titled βState Management: ZustandβWhy Zustand?
Section titled βWhy Zustand?β- Minimal: 1kb bundle size
- Simple API: No boilerplate
- No Context: Avoids re-render issues
- DevTools: Redux DevTools integration
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | Zustand | Redux Toolkit | Jotai | Recoil |
|---|---|---|---|---|
| Bundle Size | 1kb | 11kb | 3kb | 14kb |
| Learning Curve | βββββ | βββ | ββββ | βββ |
| Boilerplate | βββββ | βββ | ββββ | βββ |
| DevTools | β Yes | β Yes | β Yes | β Yes |
| TypeScript | βββββ | βββββ | βββββ | ββββ |
Installation
Section titled βInstallationβbun add zustandTables: TanStack Table
Section titled βTables: TanStack TableβWhy TanStack Table?
Section titled βWhy TanStack Table?β- Headless: Bring your own UI
- Feature-rich: Sorting, filtering, pagination, virtualization
- TypeScript-first: Fully typed
- Framework agnostic: Works with React, Vue, Solid, Svelte
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | TanStack Table | AG Grid | React Table v7 | MUI DataGrid |
|---|---|---|---|---|
| Free Features | βββββ | βββ | ββββ | βββ |
| Performance | βββββ | βββββ | ββββ | ββββ |
| Customization | βββββ | βββ | βββββ | βββ |
| Bundle Size | 15kb | 150kb+ | 14kb | 80kb |
| License | MIT | Commercial | MIT | Commercial |
Installation
Section titled βInstallationβbun add @tanstack/react-tableCharts: Recharts + Tremor
Section titled βCharts: Recharts + TremorβWhy Recharts?
Section titled βWhy Recharts?β- React-native: Built for React
- Composable: Component-based API
- Responsive: Mobile-friendly
- D3 powered: Built on D3.js
Why Tremor?
Section titled βWhy Tremor?β- Dashboard-focused: Pre-built dashboard components
- Modern design: Beautiful out-of-the-box
- Tailwind-based: Easy customization
- Analytics optimized: KPI cards, metric charts, etc.
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | Recharts | Chart.js | Victory | Tremor |
|---|---|---|---|---|
| React Native | βββββ | βββ | βββββ | βββββ |
| Customization | ββββ | βββ | βββββ | βββ |
| Performance | ββββ | βββββ | βββ | ββββ |
| Dashboard Ready | βββ | ββ | βββ | βββββ |
| Bundle Size | 96kb | 60kb | 200kb | 120kb |
Installation
Section titled βInstallationβbun add rechartsbun add @tremor/reactAPI Framework: Hono
Section titled βAPI Framework: HonoβWhy Hono?
Section titled βWhy Hono?β- Ultrafast: Faster than Express, Fastify
- Edge-first: Built for Cloudflare Workers
- Small: 12kb bundle size
- Type-safe: RPC client with full type inference
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | Hono | Express | Fastify | tRPC |
|---|---|---|---|---|
| Edge Support | βββββ | β No | β No | ββββ |
| Performance | βββββ | βββ | ββββ | ββββ |
| Type Safety | βββββ | ββ | ββββ | βββββ |
| Bundle Size | 12kb | 40kb | 35kb | 30kb |
| Learning Curve | βββββ | βββββ | ββββ | βββ |
Installation
Section titled βInstallationβbun create hono my-apicd my-apibun add honoAuthentication: Better Auth
Section titled βAuthentication: Better AuthβWhy Better Auth?
Section titled βWhy Better Auth?β- Framework agnostic: Works with any framework
- Edge compatible: Runs on Cloudflare Workers
- Type-safe: Full TypeScript support
- Modern: Built for modern web standards
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | Better Auth | Auth.js | Clerk | Supabase Auth |
|---|---|---|---|---|
| Edge Support | βββββ | ββββ | βββββ | ββββ |
| Self-hosted | β Yes | β Yes | β No | βββ |
| Free Tier | βββββ | βββββ | βββ | ββββ |
| Customization | βββββ | ββββ | βββ | ββββ |
| DX | βββββ | ββββ | βββββ | ββββ |
Installation
Section titled βInstallationβbun add better-authReal-time: WebSocket
Section titled βReal-time: WebSocketβWhy WebSocket?
Section titled βWhy WebSocket?β- Full-duplex: Bi-directional communication
- Low latency: Real-time updates
- Efficient: Less overhead than polling
- Standard: Native browser support
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | WebSocket | Server-Sent Events | Polling | Socket.io |
|---|---|---|---|---|
| Bi-directional | β Yes | β No | β Yes | β Yes |
| Low Latency | βββββ | ββββ | ββ | βββββ |
| Browser Support | βββββ | ββββ | βββββ | βββββ |
| Edge Support | βββββ | βββββ | βββββ | βββ |
| Overhead | Low | Low | High | Medium |
Installation (Cloudflare Workers)
Section titled βInstallation (Cloudflare Workers)β[[durable_objects.bindings]]name = "WEBSOCKET"class_name = "WebSocketDurableObject"Analytics: ClickHouse
Section titled βAnalytics: ClickHouseβWhy ClickHouse?
Section titled βWhy ClickHouse?β- OLAP optimized: Column-oriented for analytics
- Fast queries: 100-1000x faster than PostgreSQL for analytics
- Real-time: Streaming inserts
- SQL compatible: Standard SQL syntax
Use Cases:
Section titled βUse Cases:β- Real-time analytics dashboards
- Time-series data (metrics, logs)
- Event tracking and user behavior
- Business intelligence queries
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | ClickHouse | PostgreSQL | TimescaleDB | Druid |
|---|---|---|---|---|
| Analytics Speed | βββββ | ββ | ββββ | βββββ |
| Real-time | βββββ | βββ | ββββ | ββββ |
| SQL Support | βββββ | βββββ | βββββ | βββ |
| Scalability | βββββ | βββ | ββββ | βββββ |
| Ease of Use | ββββ | βββββ | ββββ | βββ |
Installation
Section titled βInstallationβSign up at: https://clickhouse.com/cloud
Then install client:
bun add @clickhouse/clientdocker run -d --name clickhouse-server \ -p 8123:8123 -p 9000:9000 \ clickhouse/clickhouse-serverDeployment: Cloudflare Workers + Pages
Section titled βDeployment: Cloudflare Workers + PagesβWhy Cloudflare?
Section titled βWhy Cloudflare?β- Edge network: Deploy to 300+ cities worldwide
- Fast cold starts: <1ms initialization
- Free tier: 100k requests/day
- Integrated: KV, R2, D1, Durable Objects, Analytics
Cloudflare Products:
Section titled βCloudflare Products:β- Workers: Serverless functions (API)
- Pages: Static site hosting (Frontend)
- Durable Objects: Stateful coordination (WebSocket)
- R2: Object storage
- D1: SQLite edge database
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | Cloudflare | Vercel | Netlify | AWS Lambda |
|---|---|---|---|---|
| Edge Network | βββββ | βββββ | ββββ | βββ |
| Cold Start | <1ms | ~50ms | ~100ms | ~200ms |
| Free Tier | βββββ | ββββ | ββββ | βββ |
| WebSocket | βββββ | β No | β No | ββββ |
| Pricing | βββββ | ββββ | ββββ | βββ |
Installation
Section titled βInstallationβ-
Install Wrangler CLI
Terminal window bun add -g wrangler -
Login
Terminal window wrangler login -
Create Workers project
Terminal window wrangler init my-api -
Create Pages project
Terminal window wrangler pages create my-dashboard -
Deploy
Terminal window wrangler deploy
Monitoring: Sentry Edge SDK
Section titled βMonitoring: Sentry Edge SDKβWhy Sentry?
Section titled βWhy Sentry?β- Error tracking: Automatic error capture
- Performance monitoring: APM for edge functions
- Release tracking: Track deployments
- Edge compatible: Works with Cloudflare Workers
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | Sentry | LogRocket | Datadog | Rollbar |
|---|---|---|---|---|
| Edge Support | βββββ | βββ | ββββ | ββββ |
| Error Tracking | βββββ | βββββ | ββββ | βββββ |
| Performance | βββββ | ββββ | βββββ | βββ |
| Free Tier | ββββ | ββ | ββ | βββ |
| DX | βββββ | ββββ | ββββ | ββββ |
Installation
Section titled βInstallationβbun add @sentry/react @sentry/browserbun add @sentry/cloudflareStorage: Cloudflare R2
Section titled βStorage: Cloudflare R2βWhy Cloudflare R2?
Section titled βWhy Cloudflare R2?β- S3-compatible: Drop-in replacement for AWS S3
- Zero egress fees: No charges for data transfer out
- Edge optimization: Global distribution
- Cost-effective: $0.015/GB storage vs $0.023/GB S3
Use Cases:
Section titled βUse Cases:β- User uploads (images, documents)
- Static asset storage
- Backups and archives
- Media files for dashboards
Alternatives Comparison
Section titled βAlternatives Comparisonβ| Feature | Cloudflare R2 | AWS S3 | Backblaze B2 | Wasabi |
|---|---|---|---|---|
| Storage Cost | $0.015/GB | $0.023/GB | $0.006/GB | $0.0059/GB |
| Egress Cost | $0 (Free) | $0.09/GB | $0.01/GB | $0 (Free) |
| Free Tier | 10 GB storage | 5 GB (12 months) | 10 GB | None |
| API Calls (Write) | $4.50/1M | $5/1M | $0.01/1K | Included |
| API Calls (Read) | $0.36/1M | $0.40/1M | Free | Included |
| Global CDN | β Built-in | β οΈ Via CloudFront | β No | β No |
| S3 Compatible | β Yes | β Native | β Yes | β Yes |
| Min Storage Duration | None | 30 days | None | 90 days |
| Edge Network | β 300+ cities | β οΈ CloudFront | β Limited | β Limited |
Installation
Section titled βInstallationβ-
Create R2 Bucket
Terminal window # Using Wranglernpx wrangler r2 bucket create my-bucket -
Configure in wrangler.toml
[[r2_buckets]]binding = "MY_BUCKET"bucket_name = "my-bucket" -
Use in Workers
export default {async fetch(request, env) {// Upload fileawait env.MY_BUCKET.put('file.txt', 'content')// Get fileconst object = await env.MY_BUCKET.get('file.txt')return new Response(await object.text())}}
Quick Start: Complete Setup
Section titled βQuick Start: Complete Setupβ-
Initialize Project
Terminal window bun create vite my-dashboard --template react-tscd my-dashboard -
Install Core Dependencies
Terminal window # Routing & Data Fetchingbun add @tanstack/react-router @tanstack/react-querybun add @tanstack/router-vite-plugin @tanstack/react-query-devtools# Forms & Validationbun add react-hook-form zod @hookform/resolvers# UI Componentsbun add tailwindcss autoprefixer postcssbun add @radix-ui/react-dialog @radix-ui/react-dropdown-menubun add lucide-react class-variance-authority clsx tailwind-merge# State Managementbun add zustand# Tables & Chartsbun add @tanstack/react-table recharts @tremor/react# Databasebun add drizzle-orm @neondatabase/serverlessbun add -D drizzle-kit -
Setup Cloudflare Workers API
Terminal window # Create API projectbun create hono my-apicd my-api# Install dependenciesbun add hono better-auth @clickhouse/clientbun add -D wrangler -
Initialize shadcn/ui
Terminal window bunx shadcn-ui@latest initbunx shadcn-ui@latest add button card table dialog -
Setup Database
Terminal window # Add to .envecho "DATABASE_URL=postgresql://..." > .env# Generate migrationsbun drizzle-kit generate:pgbun drizzle-kit push:pg -
Deploy
Terminal window wrangler pages publish distTerminal window wrangler deploy
Architecture Diagram
Section titled βArchitecture Diagramβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ User Browser ββ βββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β React 19 + TypeScript + TanStack Router β ββ β shadcn/ui + Tailwind + Recharts + Tremor β ββ ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ ββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ β β HTTPS / WebSocket ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ Cloudflare Edge Network ββ ββββββββββββββββ ββββββββββββββββββββββββββββ ββ β Pages (SPA) β β Workers (Hono API) β ββ β - Static βββββββββΊβ - Better Auth β ββ β - React App β β - Real-time WebSocket β ββ ββββββββββββββββ ββββββββ¬ββββββββββββββββββββ ββ β ββ ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββ ββ β Durable Objects β β ββ β - WebSocket state management β β ββ ββββββββββββββββββββββββββββββββ β ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ β βββββββββββββββΌββββββββββββββ β β β βΌ βΌ βΌβββββββββββββ ββββββββββββ βββββββββββββββββ Neon β βClickHouseβ β Sentry ββPostgreSQL β βAnalytics β β Monitoring ββ(Drizzle) β β β β ββββββββββββββ ββββββββββββ ββββββββββββββββPerformance Characteristics
Section titled βPerformance Characteristicsβ| Metric | Target | Actual |
|---|---|---|
| First Contentful Paint | <1.0s | ~0.8s |
| Time to Interactive | <2.5s | ~2.1s |
| API Response (edge) | <50ms | ~30ms |
| Database Query (Neon) | <100ms | ~80ms |
| Analytics Query (ClickHouse) | <500ms | ~300ms |
| WebSocket Latency | <50ms | ~20ms |
| Bundle Size (initial) | <200kb | ~180kb |
Best Practices
Section titled βBest PracticesβResources
Section titled βResourcesβOfficial Documentation
Section titled βOfficial DocumentationβCommunity Resources
Section titled βCommunity Resourcesβπ° Pricing Overview
Section titled βπ° Pricing OverviewβTech Stack Pricing Summary
Section titled βTech Stack Pricing SummaryβQuick overview of costs for each service in the stack:
| Service | Category | Free Tier | Paid Plan Starts | Best For |
|---|---|---|---|---|
| Cloudflare Workers | Hosting | 100k req/day | $5/mo (10M req) | Edge computing |
| Cloudflare Pages | Frontend | Unlimited builds | $20/mo (5k builds) | Static hosting |
| Cloudflare R2 | Storage | 10 GB/month | $0.015/GB | Object storage |
| Neon PostgreSQL | Database | 10 GB storage | $19/mo (Unlimited) | Serverless DB |
| ClickHouse Cloud | Analytics | 30-day trial | $51/mo (100 GB) | Time-series data |
| Sentry | Monitoring | 5k errors/mo | $26/mo (50k errors) | Error tracking |
| Better Auth | Authentication | Self-hosted (Free) | N/A | Open source |
Detailed Platform Pricing Comparison
Section titled βDetailed Platform Pricing ComparisonβHosting & Edge Computing
Section titled βHosting & Edge Computingβ| Feature | Cloudflare Workers | Vercel | Netlify | AWS Lambda |
|---|---|---|---|---|
| Free Tier Requests | 100,000/day | 100 GB bandwidth | 100 GB bandwidth | 1M requests/mo |
| Free Tier Build Time | Unlimited | 6,000 min/mo | 300 min/mo | N/A |
| Paid Tier Price | $5/mo | $20/mo | $19/mo | Pay-per-use |
| Included Requests | 10M requests | Unlimited | Unlimited | N/A |
| Overage Cost | $0.50/1M req | $40/100 GB | $55/100 GB | $0.20/1M req |
| Edge Locations | 300+ cities | 100+ cities | 100+ cities | 30+ regions |
| Cold Start | <1ms | ~50ms | ~100ms | ~200ms |
| Max Request Time | 30s (free), 15min (paid) | 10s (hobby), 60s (pro) | 10s (free), 26s (paid) | 15min |
| WebSocket Support | β Yes (Durable Objects) | β No | β No | β Yes |
| Custom Domains | Unlimited | 1 (hobby), Unlimited (pro) | 1 (free), Unlimited (paid) | Manual setup |
| Best For | Edge APIs, real-time | Full-stack apps | Static sites | AWS ecosystem |
Database Services
Section titled βDatabase Servicesβ| Feature | Neon PostgreSQL | Supabase | PlanetScale | Railway |
|---|---|---|---|---|
| Free Tier Storage | 10 GB | 500 MB | 5 GB | 5 GB |
| Free Tier Compute | 100 hrs/mo | Unlimited | Unlimited | 500 hrs/mo |
| Paid Tier Price | $19/mo | $25/mo | $39/mo | $5/mo |
| Included Storage | Unlimited | 8 GB | 25 GB | 10 GB |
| Overage Cost | Included | $0.125/GB | $1.50/GB | $0.25/GB |
| Branching | β Yes | β No | β Yes | β No |
| Edge Support | β HTTP driver | β HTTP/WebSocket | β HTTP | β TCP only |
| Auto-scaling | β Yes | β οΈ Limited | β Yes | β No |
| Backup Retention | 7 days | 7 days | 30 days | 7 days |
| Max Connections | Unlimited (pooler) | 60 (free), 200 (paid) | 10k (pooler) | 100 |
| Database Type | PostgreSQL 16 | PostgreSQL 15 | MySQL 8 | PostgreSQL/MySQL |
| Best For | Serverless apps | All-in-one platform | MySQL at scale | Quick deployments |
Analytics & Monitoring
Section titled βAnalytics & Monitoringβ| Feature | ClickHouse Cloud | Sentry | Datadog | LogRocket |
|---|---|---|---|---|
| Free Tier | 30-day trial | 5k errors/mo | 14-day trial | 1k sessions/mo |
| Starter Price | $51/mo | $26/mo | $15/host/mo | $99/mo |
| Included Volume | 100 GB storage | 50k errors | 5 hosts | 10k sessions |
| Overage Cost | $0.51/GB | $0.000533/error | Custom | $0.01/session |
| Data Retention | 30 days | 90 days | 15 days | 30 days |
| Query Performance | βββββ | N/A | ββββ | N/A |
| Real-time Updates | β Yes | β Yes | β Yes | β Yes |
| API Access | β Yes | β Yes | β Yes | β Yes |
| Edge Compatible | β Yes | β Yes | β Yes | β οΈ Limited |
| Self-hosted Option | β Yes (OSS) | β Yes (OSS) | β No | β No |
| Best For | OLAP queries | Error tracking | Infrastructure | User sessions |
Authentication Services
Section titled βAuthentication Servicesβ| Feature | Better Auth | Clerk | Auth0 | Supabase Auth |
|---|---|---|---|---|
| Free Tier | Unlimited (self-hosted) | 10k MAU | 7.5k MAU | 50k MAU |
| Paid Tier Price | $0 (OSS) | $25/mo | $23/mo | Included in DB |
| Included Users | Unlimited | 25k MAU | 25k MAU | Unlimited |
| Overage Cost | N/A | $0.02/MAU | $0.0175/MAU | N/A |
| Social OAuth | β Yes | β Yes | β Yes | β Yes |
| MFA/2FA | β Yes | β Yes | β Yes | β Yes |
| Passwordless | β Yes | β Yes | β Yes | β Yes |
| Custom UI | β Full control | β οΈ Limited | β οΈ Limited | β Full control |
| Edge Compatible | β Yes | β Yes | β Yes | β Yes |
| Self-hosted | β Yes | β No | β No | β Yes |
| Session Management | β Yes | β Yes | β Yes | β Yes |
| Best For | Full control | Quick setup | Enterprise | Supabase users |
Cost Optimization Tips
Section titled βCost Optimization TipsβMonthly Cost Examples
Section titled βMonthly Cost ExamplesβScenario 1: Side Project / MVP
Section titled βScenario 1: Side Project / MVPβ- Traffic: 10k requests/day (~300k/month)
- Database: 2 GB storage, 20 hrs compute/mo
- Storage: 2 GB files in R2
- Errors: 1k errors/month
- Total Cost: $0/month (100% free tier)
- Cloudflare Workers: $0 (under 100k req/day)
- Cloudflare Pages: $0 (unlimited)
- Cloudflare R2: $0 (under 10 GB free tier)
- Neon PostgreSQL: $0 (under 10 GB + 100 hrs)
- ClickHouse: $0 (not needed yet)
- Sentry: $0 (under 5k errors)
Scenario 2: Growing Startup
Section titled βScenario 2: Growing Startupβ- Traffic: 500k requests/day (~15M/month)
- Database: 25 GB storage, 200 hrs compute/mo
- Storage: 50 GB files in R2
- Analytics: 50 GB ClickHouse data
- Errors: 15k errors/month
- Total Cost: ~$130/month
- Cloudflare Workers: $5 (10M req included) + $2.50 (5M overage) = $7.50
- Cloudflare Pages: $0
- Cloudflare R2: $0.60 (40 GB Γ $0.015) = $0.60
- Neon PostgreSQL: $19 (Launch plan)
- ClickHouse: $51 (Development tier, 100 GB)
- Sentry: $0 (under 5k errors) or $26 if >5k = $26
- Better Auth: $0 (self-hosted)
Scenario 3: Production App (High Volume)
Section titled βScenario 3: Production App (High Volume)β- Traffic: 5M requests/day (~150M/month)
- Database: 100 GB storage, unlimited compute
- Storage: 200 GB files in R2
- Analytics: 500 GB ClickHouse data
- Errors: 200k errors/month
- Total Cost: ~$491/month
- Cloudflare Workers: $5 + $70 (140M overage Γ $0.50/1M) = $75
- Cloudflare Pages: $0
- Cloudflare R2: $2.85 (190 GB Γ $0.015) = $2.85
- Neon PostgreSQL: $69 (Scale plan)
- ClickHouse: $306 (500 GB Γ $0.51 + $51 base) = $306
- Sentry: $26 (Team plan, 50k errors) + overage = $38
- Better Auth: $0 (self-hosted)
Scenario 4: Enterprise Scale
Section titled βScenario 4: Enterprise Scaleβ- Traffic: 50M requests/day (~1.5B/month)
- Database: 500 GB storage, unlimited compute
- Storage: 1 TB files in R2
- Analytics: 2 TB ClickHouse data
- Errors: 1M errors/month
- Total Cost: ~$2,200/month
- Cloudflare Workers: $5 + $745 (1,490M overage Γ $0.50/1M) = $750
- Cloudflare Pages: $0
- Cloudflare R2: $14.85 (990 GB Γ $0.015) = $14.85
- Neon PostgreSQL: $299 (Business plan)
- ClickHouse: $1,071 (2 TB storage + compute)
- Sentry: $99 (Business plan) + overage = $150
- Better Auth: $0 (self-hosted)
Summary
Section titled βSummaryβThis tech stack is optimized for:
Perfect for building modern dashboards that need to handle real-time data, complex analytics, and scale globally on a budget.