Docs / GET STARTED / Quickstart

Quickstart

Build the binary, start it and confirm it answers. No hosted account needed.

docs/quickstart.md · Built from commit 820e560 · 2026-10-26 · Edit on GitHub ↗

Build from source

You need Rust 1.89 or newer. PostgreSQL 15+ is the intended external database; the 501 gateway starts without it. The judge also needs Docker.

SHELL
git clone --recurse-submodules https://github.com/Zouhairmaj/megabase.git
cd megabase
cargo run --locked -p megabase

Or cargo build --release --locked -p megabase and run ./target/release/megabase. Environment variables are in Configuration. Set JWT_SECRET to the same HS256 secret that signed your ANON_KEY when you start wiring Auth or REST. A value you set must be at least 32 bytes. The 501 gateway starts if the variable is omitted. Without the compose stack, also set the mail, storage and functions variables in Running outside the Supabase stack.

Check it runs

Keep the binary running, then in another terminal:

SHELL
curl -s localhost:8000/_megabase/health
# {"name":"megabase","version":"0.0.0","status":"ok"}
curl -sS -w '\nHTTP %{http_code}\n' localhost:8000/rest/v1/todos
# {"code":"PGRST000","details":"DATABASE_URL is unset",...}
# HTTP 503

A 503 on /rest/v1/todos means the gateway is up and DATABASE_URL is unset. A 501 still means that unit is not implemented yet.

Container image

SHELL
docker build -t megabase .
docker run --rm -p 8000:8000 megabase

Builder and runtime base images are pinned by digest. After the Release workflow publishes an image, ghcr.io/zouhairmaj/megabase and how to verify it are in Install.

Use with supabase-js

Point supabase-js at your local base URL. An unimplemented unit returns

  1. GET /auth/v1/health answers the GoTrue health document. Level 1

targets REST and Auth email/password (see Roadmap and Configuration).

JAVASCRIPT
import { createClient } from '@supabase/supabase-js'
const supabase = createClient('http://localhost:8000', ANON_KEY)
const { data, error } = await supabase.from('todos').select()
// today: error.code === 'MEGABASE_NOT_IMPLEMENTED'

Run the judge

The judge starts the official Supabase reference stack with Docker Compose, creates a dedicated megabase database on that cluster, and compares HTTP plus database side-effects with Megabase. From the repository root:

SHELL
just judge-up
just judge
just judge-down

Recipes and ports are in judge/README.md.

Wrong or unfinished? Open an issue or edit docs/quickstart.md on GitHub.