deltabase dev
Start local development environment
Start a local DeltaBase development environment with hot reloading.
deltabase dev [options]Or without global installation:
pnpx @delta-base/cli devWhat It Starts
Section titled “What It Starts”Running deltabase dev starts two services:
| Service | URL | Description |
|---|---|---|
| API Server | http://localhost:8787 | DeltaBase event store API |
| Studio UI | http://localhost:3000 | Visual management interface |
Output
Section titled “Output”┌────────────────────────────────────────────────────────────────────────────┐│ ││ ┌──────────────────────────────────────────────────────────────────────┐ ││ │██████╗ ███████╗██╗ ████████╗ █████╗ ██████╗ █████╗ ███████╗███████╗│ ││ │██╔══██╗██╔════╝██║ ╚══██╔══╝██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔════╝│ ││ │██║ ██║█████╗ ██║ ██║ ███████║██████╔╝███████║███████╗█████╗ │ ││ │██║ ██║██╔══╝ ██║ ██║ ██╔══██║██╔══██╗██╔══██║╚════██║██╔══╝ │ ││ │██████╔╝███████╗███████╗██║ ██║ ██║██████╔╝██║ ██║███████║███████╗│ ││ │╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝│ ││ └──────────────────────────────────────────────────────────────────────┘ ││ ││ Deltabase development environment is ready! ││ ││ API Server: http://localhost:8787 ││ Studio UI: http://localhost:3000 ││ │└────────────────────────────────────────────────────────────────────────────┘Features
Section titled “Features”Local Event Store
Section titled “Local Event Store”The local environment provides a fully functional event store:
- Create and manage event stores
- Append and read events
- WebSocket subscriptions
- All API endpoints
Studio UI
Section titled “Studio UI”Visual interface for development:
- Browse event stores
- View streams and events
- Inspect event payloads
- Monitor subscriptions
Hot Reloading
Section titled “Hot Reloading”Changes to your code are automatically detected and the server reloads.
SQLite Storage
Section titled “SQLite Storage”Events are stored in a local SQLite database. Data persists between restarts.
Using with Your Application
Section titled “Using with Your Application”Connect Your App
Section titled “Connect Your App”Point your application to the local API:
import { DeltaBase } from '@delta-base/server';
const deltabase = new DeltaBase({ baseUrl: 'http://localhost:8787', // Local development // No API key needed for local dev});
const eventStore = deltabase.getEventStore('my-events');Create Event Stores
Section titled “Create Event Stores”Create event stores via the SDK:
const management = deltabase.getManagementClient();
await management.createEventStore({ name: 'my-events', description: 'Development event store',});Or via the Studio UI at http://localhost:3000.
Development Workflow
Section titled “Development Workflow”-
Start DeltaBase:
Terminal window pnpx @delta-base/cli dev -
Create an event store via Studio or SDK
-
Run your application pointing to
localhost:8787 -
View events in Studio at
localhost:3000 -
Iterate - changes auto-reload
Differences from Production
Section titled “Differences from Production”| Feature | Local Dev | Production |
|---|---|---|
| Authentication | None required | API key required |
| Storage | SQLite | Cloudflare Durable Objects |
| URL | localhost:8787 | api.delta-base.com |
| Webhooks | Local only | Public URLs required |
Troubleshooting
Section titled “Troubleshooting”Port Already in Use
Section titled “Port Already in Use”If port 8787 or 3000 is in use:
# Find and kill the process using the portlsof -i :8787kill -9 <PID>Connection Refused
Section titled “Connection Refused”Ensure DeltaBase is running:
pnpx @delta-base/cli devCheck that your app is pointing to http://localhost:8787.
What’s Next?
Section titled “What’s Next?”- Local Development Guide - Full walkthrough
- deploy command - Deploy to production
- Studio - Studio UI details