In-browser Postgres sandbox with AI assistance.
With database.build, you can instantly spin up an unlimited number of Postgres databases that run directly in your browser (and soon, deploy them to S3).
Each database is paired with a large language model (LLM) which opens the door to some interesting use cases:
All queries in database.build run directly in your browser. There’s no remote Postgres container or WebSocket proxy.
How is this possible? PGlite, a WASM version of Postgres that can run directly in your browser. Every database that you create spins up a new instance of PGlite that exposes a fully-functional Postgres database. Data is stored in IndexedDB so that changes persist after refresh.
This is a monorepo split into the following projects:
From the monorepo root:
shell
npm i
shell
npx supabase start./apps/web/.env.local:
shell
npx supabase status -o env \
--override-name api.url=NEXT_PUBLIC_SUPABASE_URL \
--override-name auth.anon_key=NEXT_PUBLIC_SUPABASE_ANON_KEY |
grep NEXT_PUBLIC >> ./apps/web/.env.local./apps/web/.env.local:
shell
echo 'OPENAI_API_KEY="<openai-api-key>"' >> ./apps/web/.env.localshell
echo 'KV_REST_API_URL="http://localhost:8080"' >> ./apps/web/.env.local
echo 'KV_REST_API_TOKEN="local_token"' >> ./apps/web/.env.local
shell
docker compose -f ./apps/web/docker-compose.yml up -d
Fill in the remaining variables for each app as seen in:
./apps/web/.env.example
./apps/browser-proxy/.env.example./apps/deploy-worker/.env.exampleFrom the monorepo root:
npm run dev
Important: This command uses turbo under the hood which understands the relationship between dependencies in the monorepo and automatically builds them accordingly (ie. ./packages/*). If you by-pass turbo, you will have to manually build each ./packages/* before each ./app/* can use them.
This project is not an official Postgres project and we don’t want to mislead anyone! We’re renaming to database.build because, well, that’s what this does. This will still be 100% Postgres-focused, just with a different URL.
Apache 2.0
$ claude mcp add database-build \
-- python -m otcore.mcp_server <graph>