Developer Guide

Getting Started

Set up OpenStory for local development

OpenStory is an open-source AI video production platform. This guide walks you through setting up a local development environment.

Prerequisites

No external database is required for local development — bun setup configures a local SQLite file (local.db) automatically.

Quick Start

# Clone the repository
git clone https://github.com/openstory-so/openstory.git
cd openstory

# Install dependencies
bun install

# Interactive setup — checks prerequisites, generates BETTER_AUTH_SECRET,
# and configures local SQLite + QStash defaults in .env.local
bun setup

Running the Dev Server

bun dev

This single command runs everything in parallel: database migration and seeding, the dev server, the QStash workflow emulator (Docker), and the Stripe listener.

The app will be available at http://localhost:3000.

Environment Variables

bun setup writes a working .env.local for you. See .env.example for the full list of available environment variables, including optional services like AI keys, storage, and OAuth providers.

Database

Local development uses a Cloudflare D1 database (Miniflare-backed SQLite) via Drizzle ORM — no account or remote service required. bun dev migrates and seeds it automatically.

# Generate migrations from schema changes
bun db:generate

# Apply migrations to the local D1 database
bun db:migrate:local

# Open Drizzle Studio against the local D1 database
bun db:studio:local

Production deployments use Cloudflare D1. See the Cloudflare deployment guide for details.

Next Steps