StartOne docs
$249 · Commercial license

Developer — Web

The full AI SaaS boilerplate for the web. Streaming multi-model chat, a complete media studio with a job queue and gallery, authentication, a database, and storage — all wired and deploy-ready.

Requirements

Quickstart

npm install
cp .env.example .env.local
docker compose up -d      # local Postgres + Redis
npm run db:migrate        # create the tables
npm run dev

Open http://localhost:3000.

It boots with zero keys. With no Clerk keys set it runs in dev mode — a single implicit user, no login required — and shows a dev-mode banner. AI calls return labelled dry-run responses. Explore first, configure second.

Port conflicts

The included docker-compose.yml binds Postgres on 5432 and Redis on 6379. If you already run either locally, stop them first or change the ports in the compose file.

Configuration

AI providers (chat)

VariableEnables
OPENAI_API_KEYGPT models
ANTHROPIC_API_KEYClaude models
GOOGLE_GENERATIVE_AI_API_KEYGemini models
ZAI_API_KEYGLM models
DEEPSEEK_API_KEYDeepSeek models
DASHSCOPE_API_KEYQwen models

These are your platform keys — the fallback used when a user has not supplied their own. Users can also add their own keys in Settings (BYOK); those are encrypted at rest with APP_ENCRYPTION_KEY and take precedence over the platform key.

Media

VariablePurpose
FAL_KEYfal.ai — image, video, audio
REPLICATE_API_TOKENReplicate — the alternate provider
MEDIA_PROVIDERfal (default) or replicate

Auth, data, storage

VariablePurpose
CLERK_SECRET_KEYClerk auth. Leave blank for dev mode.
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYClerk, client side
DATABASE_URLPostgres. Defaults to the docker-compose service.
REDIS_URLRedis. Defaults to the docker-compose service.
BLOB_READ_WRITE_TOKENVercel Blob storage. Falls back to local disk if unset.
APP_ENCRYPTION_KEYEncrypts user-supplied API keys at rest. Required in production.
APP_URLPublic base URL. http://localhost:3000 in dev.
CHAT_SYSTEM_PROMPTOverride the default system prompt
Set APP_ENCRYPTION_KEY before you go live. Without it, user-supplied API keys cannot be encrypted at rest.

Architecture

Pages

RouteWhat it is
/Landing page
/chatStreaming chat with a model picker and persistent history
/studioMedia studio — image, video, audio generation
/galleryEvery generation, browsable and downloadable
/settingsBYOK key management
/designDesign-token reference page

API routes

RoutePurpose
POST /api/chatStreaming chat completions
POST /api/mediaEnqueue a generation job
GET /api/media/[id]Poll job status
GET /api/storage/[...key]Serve stored media

Database

Postgres via Drizzle ORM. Five tables:

TableHolds
usersUser records, keyed to the Clerk ID
user_api_keysBYOK keys, encrypted at rest
conversationsChat threads
messagesIndividual messages
media_jobsGeneration jobs and their results

Migrations live in lib/db/migrations/. Run npm run db:migrate to apply them, or npm run db:studio to browse the data.

The media pipeline

Generation is asynchronous. The client posts to /api/media, which writes a media_jobs row and returns an id; the client polls /api/media/[id] until the job completes. Providers (fal.ai, Replicate) sit behind a single contract in lib/media/providers.ts, so swapping providers means editing one module.

Scripts

CommandWhat it does
npm run devDev server
npm run buildProduction build
npm run db:migrateApply migrations
npm run db:generateGenerate a migration from schema changes
npm run db:studioBrowse the database
npm run gateLint + typecheck + test

Deploying

It is a standard Next.js app and deploys anywhere Next.js runs — Vercel, Fly, Railway, or your own host.

You will need, in production:

Run npm run db:migrate against the production database before first boot.

What this edition does not include

No billing. It is unmetered by design — no credits, no limits, no payment rails. Add your own, or upgrade to Business, which is this codebase plus the money layer.