Skip to content
GitHub

Applications Overview

Orion Kit is organized as a monorepo with multiple applications, each serving a specific purpose in the SaaS ecosystem.

ApplicationPurposePortDescription
APIBackend API3002REST API with authentication, database, payments
AppMain Application3001User dashboard, tasks, billing, settings
WebLanding Page3000Marketing site, documentation links
DocsDocumentation3004This documentation site
StudioDatabase Studio3003Drizzle Studio for database management
┌─────────────────────────────────────────────────────────────────┐
│                        ORION KIT APPS                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐         │
│  │     WEB     │    │     APP     │    │     API     │         │
│  │  (Port 3000)│    │  (Port 3001)│    │  (Port 3002)│         │
│  │             │    │             │    │             │         │
│  │ • Landing   │    │ • Dashboard │    │ • Auth      │         │
│  │ • Marketing │    │ • Tasks     │    │ • Tasks     │         │
│  │ • Features  │    │ • Billing   │    │ • Billing   │         │
│  │ • Pricing   │    │ • Settings  │    │ • Webhooks  │         │
│  └─────────────┘    └─────────────┘    └─────────────┘         │
│         │                   │                   │              │
│         └───────────────────┼───────────────────┘              │
│                             │                                  │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │                    SHARED PACKAGES                         ││
│  │                                                             ││
│  │  @workspace/auth    @workspace/database  @workspace/email  ││
│  │  @workspace/types   @workspace/ui       @workspace/payment ││
│  │  @workspace/analytics @workspace/observability @workspace/jobs││
│  └─────────────────────────────────────────────────────────────┘│
│                             │                                  │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │                    EXTERNAL SERVICES                       ││
│  │                                                             ││
│  │  🗄️ Neon DB    💳 Stripe    📧 Resend    📊 PostHog       ││
│  │  📈 Axiom      ⚡ Trigger   🎨 Vercel    🧪 Playwright    ││
│  └─────────────────────────────────────────────────────────────┘│
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Data Flow:
User → Web/App → API → Database

   Auth (JWT) → Protected Routes → TanStack Query → UI Updates

   Email (Resend) → Welcome Emails → Database Tracking

   Payments (Stripe) → Webhooks → Subscription Updates
# Start all applications
pnpm dev

# Or start individually
pnpm --filter web dev      # Landing page
pnpm --filter app dev      # Main app
pnpm --filter api dev      # API server
pnpm --filter docs dev     # Documentation
# Open Drizzle Studio
pnpm db:studio

# Run migrations
pnpm db:migrate

# Generate types
pnpm db:generate
# Build all applications
pnpm build

# Deploy to Vercel
vercel --prod

Each application has its own:

  • Package.json - Dependencies and scripts
  • Next.js config - Framework configuration
  • TypeScript config - Type checking
  • Environment variables - Service configuration
  • Deployment config - Vercel/production setup

All applications share:

  • Packages - @workspace/* packages for common functionality
  • Types - Shared TypeScript definitions
  • Database - Same Drizzle schema and migrations
  • Authentication - Custom JWT integration across apps
  • Styling - Tailwind CSS and shadcn/ui components
AppDevelopmentProduction
Weblocalhost:3000orion-kit.dev
Applocalhost:3001app.orion-kit.dev
APIlocalhost:3002api.orion-kit.dev
Docslocalhost:3004docs.orion-kit.dev
Studiohttps://local.drizzle.studio?port=3003Local only

Each application has its own .env.local:

# apps/web/.env.local - Landing page
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...

# apps/app/.env.local - Main app
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
NEXT_PUBLIC_API_URL=http://localhost:3002
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...

# apps/api/.env.local - API server
CLERK_SECRET_KEY=sk_test_...
DATABASE_URL=postgresql://...
STRIPE_SECRET_KEY=sk_test_...
// apps/app calls apps/api
const response = await fetch("http://localhost:3002/api/tasks");

// Use environment variables for URLs
const apiUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3002";

Import UI components from @workspace/ui:

import { Button } from "@workspace/ui/components/button";
import { Card } from "@workspace/ui/components/card";

Import types from @workspace/types:

import type { Task, CreateTaskInput } from "@workspace/types";

If ports are already in use:

# Kill processes on specific ports
lsof -ti:3000 | xargs kill -9
lsof -ti:3001 | xargs kill -9
lsof -ti:3002 | xargs kill -9

Ensure all required env vars are set:

# Check if env vars are loaded
console.log(process.env.NEXT_PUBLIC_API_URL);

Verify database connection:

# Test connection
pnpm db:studio