SandboxDB is a CLI-first SaaS for extracting safe, minimal, and shareable database slices.
- Node.js 18+
- npm or yarn
# Quick setup - installs dependencies and builds all packages
npm run setup
# Start development servers (both web app and API server)
npm run dev
# Web app: http://localhost:3000
# API server: http://localhost:3001
# Test CLI
npm run test-cli
# Use the CLI directly
npm run cli -- --help
npm run cli -- source add prod --url "postgres://readonly@db.prod"
npm run cli -- extract --source prod --tables users,orders --limit-per-table 100
npm run cli -- share slice.duckdb --ttl 24h --mode writable
# Start web dashboard only
npm run dev:web
# Open http://localhost:3000
# Start API server only
npm run dev:server
# Server runs on http://localhost:3001
# Build all packages
npm run build
# Type check all packages
npm run type-check
sandboxdb/
βββ packages/
β βββ cli/ # Commander.js CLI tool
β βββ web/ # Next.js dashboard with shadcn/ui
β βββ core/ # Business logic (extraction, masking, etc.)
β βββ types/ # Shared TypeScript definitions
βββ apps/
β βββ server/ # Fastify API server
βββ docs/ # Documentation
- Turborepo for monorepo management
- TypeScript for type safety
- tsup for CLI bundling
- Next.js for web app
- Fastify for API server
- Commander.js - Command framework
- enquirer - Interactive prompts
- keytar - Secure credential storage
- chalk + ora - Beautiful output
- Next.js 14 with App Router
- shadcn/ui components
- Tailwind CSS styling
- Zustand state management
- Monaco Editor for SQL
- Fastify web framework
- Drizzle ORM + PostgreSQL
- Bull job queues
- JWT authentication
- β Multi-database support (Postgres, MySQL, SQLite)
- β Schema discovery with relationship mapping
- β Referential integrity preservation
- β Configurable row limits and filtering
- β PII masking with configurable profiles
- β Read-only source connections
- β Data transformation pipeline
- β Portable file exports (DuckDB, SQLite)
- β Ephemeral hosted Postgres sandboxes
- β TTL-based cleanup
- β Role-based access control
- β Sandbox snapshots
- β Diff visualization
- β Rollback capabilities
- β Promotion to reusable slices
{
"apiUrl": "https://api.sandboxdb.com",
"defaultMaskingProfile": "pii-defaults",
"defaultOutputFormat": "duckdb"
}
{
"defaultSource": "production",
"defaultTables": ["users", "orders"],
"maskingProfile": "demo-friendly"
}
sandboxdb source add/list/remove/test
- Manage database sourcessandboxdb plan
- Preview extraction plansandboxdb extract
- Extract database slicesandboxdb share
- Create shareable sandbox
sandboxdb connect
- Get connection detailssandboxdb sql
- Execute SQL queriessandboxdb seed
- Generate synthetic datasandboxdb import
- Import CSV data
sandboxdb snapshot
- Create snapshotsandboxdb diff
- Compare changessandboxdb reset
- Rollback to snapshotsandboxdb promote
- Create reusable slice
sandboxdb extract \\
--source prod \\
--tables users,orders,payments \\
--where "users.created_at > '2025-01-01'" \\
--limit-per-table 100 \\
--include-related \\
--mask pii-defaults
sandboxdb share debug.duckdb --ttl 12h --name "checkout-bug-repro"
sandboxdb extract --source staging --tables products,categories
sandboxdb share products.duckdb --mode writable --ttl 72h
sandboxdb seed sbx_demo --table products --rows 50 --profile photogenic
sandboxdb snapshot sbx_demo --note "Demo ready state"
sandboxdb promote sbx_demo --as "sales-demo-v2"
- Read-only sources strongly recommended
- PII masking before upload
- TTL enforcement for sandboxes
- Access control with user roles
- Audit logging for all operations
- Rate limiting and quotas
- β PostgreSQL
- β MySQL
- π§ SQLite
- π§ SQL Server
- π§ Oracle
- β DuckDB (default)
- β SQLite
- π§ Parquet
- π§ CSV
npm run build
npm publish @sandboxdb/cli
cd packages/web
vercel deploy
cd apps/server
docker build -t sandboxdb-server .
docker run -p 3001:3001 sandboxdb-server
- v0.2: Snowflake/BigQuery sources, MongoDB support
- v0.3: On-premise gateway, advanced synthetic data
- v1.0: Query parity checks, data refresh streams
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.
SandboxDB - Making database slices first-class citizens! π―