将 AI 编写的代码转换为真实的应用程序。Nubase 是一个开源的 AI 原生后端平台,用于 AI 编码、代理应用程序和现代产品团队:
English · 简体中文
Official website: https://nubase.ai ⭐ If Nubase is useful to you, please give us a star — every star helps more people discover the project and keeps us motivated. Thank you!
Turn AI-written code into real apps. Nubase is an open-source, AI-native backend and deploy layer that a coding agent drives directly — so a generated app goes live in minutes. Eight capability modules in one self-hostable service: Database, Auth, Storage, Assets, Functions, AI Gateway, Memory, and cron.
An agent can model the data (Database + Auth), deploy backend logic (Functions), publish the generated frontend to a public CDN (Assets), and schedule recurring work (cron) — all through MCP tools, with no separate hosting account. Supabase-style where it makes sense (Postgres, REST, JWTs, RLS, object storage, a Studio dashboard), plus first-class Memory and an MCP surface built for AI coding agents.
From your project folder, run:
npx -y nubase_cli@latest install-skills
That single command:
Then:
/mcp, and confirm nubase is connected.~/.codex/config.toml; just start Codex.This connects your agent to a Nubase instance (a hosted one, or your own — spin one up in step 2). Point the CLI at any instance with:
npx -y nubase_cli@latest install-skills \ --studio-url https://studio.example.com \ --nubase-url https://api.example.com
The all-in-one Docker image bundles PostgreSQL + Redis + the backend + Studio:
docker run -d --name nubase \
-p 9999:9999 -p 5432:5432 \
-v nubase_data:/data \
/nubase:latest
First-boot secrets are generated into the
/datavolume; keep the volume to retain your projects. For a real deployment with stable secrets, see Self-host with Docker.
Your agent can now operate Nubase directly through MCP tools — inspect schema, create tables, run SQL, manage auth & storage, deploy edge functions, publish a frontend to the public CDN, schedule cron jobs, and read/write durable memory. Try asking:
"Create a
todostable with RLS, deploy an edge function that returns the open count, publish a one-page UI to Assets that calls it, and remember the deployment."
See Deploy an AI-generated app for the full generate → live walkthrough.
The single all-in-one image is everything you need to run Nubase on your own box — one line, no compose file, no external services.
Try it (auto-generated secrets, kept in the volume):
docker run -d --name nubase -p 9999:9999 -p 5432:5432 \
-v nubase_data:/data /nubase:latest
Production (pin stable secrets so encrypted project credentials survive restarts):
docker run -d --name nubase -p 9999:9999 -p 5432:5432 \
-v nubase_data:/data \
-e PGRST_ENCRYPTION_MASTER_KEY="$(openssl rand -base64 32)" \
-e METADATA_SERVICE_ROLE_KEY="$(openssl rand -base64 48)" \
/nubase:latest
Everything else is configured via environment variables — Postgres, Redis, S3/R2 storage, SMTP, OAuth, and LLM providers. See docs/docker-all-in-one.md for the full list and a multi-architecture (amd64 + arm64) note.
Replace `` with the Docker Hub namespace the image is published under.
AI-native applications need more than CRUD. They need user memory, retrieval, auth, storage, database APIs, and project isolation from day one. Without that backend layer, every AI coding session produces another demo that still needs weeks of infrastructure work.
Supabase is excellent, but its open-source self-hosted stack is designed around a single project. Nubase is built for AI teams and self-hosters who want one Studio, one backend service, and many isolated AI projects on their own infrastructure — with three opinionated additions:
/rest/v1 API (select/filter/order/paginate/insert/update/upsert/delete); per-project JWT secrets, roles, and schema cache; Row Level Security with JWT claims.anon / authenticated / service_role tokens./assets/v1/** with Cache-Control/ETag/304 semantics; per-project default cache policy and custom CDN domain; agents publish directly over MCP (assets_upload)./functions/v1/**; per-function secrets, invocation logs, rate limits, verify_jwt; local executor or Cloudflare Workers for Platforms; agents scaffold/deploy/invoke over MCP (functions_deploy).cron_create).nubase_cli) for schema inspection, SQL execution, RLS export, project init, and memory; one consistent project-token model across Auth, REST, Storage, and Memory.Full comparison as a table (including Supabase Cloud)
| Area | Supabase Cloud | Supabase self-hosted | Nubase |
|---|---|---|---|
| Multi-project dashboard | Yes | No (mimics one project) | Yes |
| Project isolation | Dedicated instance | One local project | Dedicated Postgres DB per project |
| Database API | PostgREST | PostgREST | PostgREST-compatible (Java) |
| Auth | Yes | Yes | Supabase-style Auth |
| Storage | Yes | Yes | S3/R2-compatible |
| AI memory | Not a core primitive | Not a core primitive | Built-in Memory pillar |
| AI coding backend target | General primitives | General primitives | Memory + REST + MCP + Studio |
| Deploy a generated app | App + separate hosting/Functions/cron | Self-managed stack | Frontend (Assets) + backend (Functions) + cron, one platform |
| Edge Functions | Yes | Available in stack | Gateway + executor (local / Cloudflare WfP) |
| Realtime | Yes | Available in stack | Not yet |
Nubase has two database layers:
Requests use a two-token model: apikey identifies the project + role (anon / authenticated / service_role), and Authorization: Bearer identifies the end user for RLS and memory ownership. A request filter resolves the project from the apikey, routes JDBC to the correct project database, and sets the request context.
Requirements: Java 17, Maven, Docker, Node.js + pnpm.
# 1. Start Postgres (15 + pgvector)
docker compose -f pg-docker-compose.yml up -d
# 2. Required secrets
export PGRST_ENCRYPTION_MASTER_KEY="$(openssl rand -base64 32)"
export METADATA_SERVICE_ROLE_KEY="replace-with-a-long-random-admin-token"
export OPENAI_API_KEY="sk-..." # optional, only for LLM-powered Memory
# 3. Backend → http://localhost:9999
mvn spring-boot:run
# 4. Studio → http://localhost:3000
cd frontend && pnpm install && pnpm dev:studio
To build the all-in-one image yourself: docker build -f Dockerfile.all-in-one -t nubase:local .
Write and search memory:
curl -X POST http://localhost:9999/mem/v1/memories \
-H "apikey: $NUBASE_SERVICE_KEY" -H "Content-Type: application/json" \
-d '{"userId":"user-42","messages":[{"role":"user","content":"I prefer steak over sushi and my dog is named Mochi."}]}'
curl -X POST http://localhost:9999/mem/v1/search \
-H "apikey: $NUBASE_SERVICE_KEY" -H "Content-Type: application/json" \
-d '{"userId":"user-42","query":"what food do they like?"}'
Use the REST API (after creating a todos table):
curl "http://localhost:9999/rest/v1/todos?select=*" -H "apikey: $NUBASE_ANON_KEY"
curl -X POST "http://localhost:9999/rest/v1/todos" \
-H "apikey: $NUBASE_SERVICE_KEY" -H "Content-Type: application/json" \
-d '{"text":"Ship the first open-source release"}'
Nubase is early-stage but all eight modules (Database, Auth, Storage, Assets, Functions, AI Gateway, Memory, cron) plus Studio and the MCP bridge are in place. Not yet implemented: Realtime and operational extras like backups/PITR, HA, and enterprise SSO/SCIM. Review the admin/management endpoints before exposing a server to the public internet.
A huge thank-you to everyone who has starred Nubase! See the full list on the stargazers page »
Contributions and issues are welcome — see CONTRIBUTING.md and SECURITY.md. This is an early public release, so feedback shapes what comes next.
暂无开放 Issues,或尚未同步最近议题。