This repository contains a small full-stack project for experimenting with an x402-style paid API flow.
At a high level:
api/is the backend (Elysia + Bun + Drizzle + Postgres)dashboard/is the frontend (Next.js App Router + shadcn/ui)
The dashboard is where you create/manage agents and keys, and the API provides auth, billing-ish flows, API key issuance, and x402-related endpoints.
x402/
βββ api/ # Elysia server, DB schema/migrations, auth, x402 modules
βββ dashboard/ # Next.js dashboard UI
docker run --name actumx-postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=x402 -p 5432:5432 -d postgres:latestThis creates a database x402 accessible at postgres://postgres:postgres@localhost:5432/x402.
Update your api/.env accordingly (see .env.example).
cd api
cp .env.example .env
bun install
bun run db:migrate
bun run devBy default the API runs on http://localhost:3001.
Set BETTER_AUTH_URL to include the mounted auth prefix in this repo:
BETTER_AUTH_URL=http://localhost:3001/auth/api/auth
Required GitHub OAuth env vars (for social sign-in):
GITHUB_CLIENT_IDGITHUB_CLIENT_SECRET
Useful API scripts:
bun run dev- run with watch modebun run start- run oncebun run check- type-checkbun run db:generate- generate Drizzle migrationsbun run db:migrate- run migrationsbun run db:reset- reset and re-run migrations
cd dashboard
cp .env.example .env.local
pnpm install
pnpm devBy default the dashboard runs on http://localhost:3000.