SUPERFUNCTION — AI-NATIVE FULL-STACK ARCHITECTURE

Prototype
to production.

Scaffold a working Next.js product with backend, auth, i18n, and an operations CLI in one command. Give your agent a structure it can understand, extend, deploy, and operate.

Follow the guide Read the docs $ pnpm dlx spfn@beta create my-app --mode full
01
Start with the product

Build the business.
Not the plumbing.

01

One scaffold

Next.js, the SPFN backend, database wiring, auth, i18n, and ops commands arrive as one working full-stack foundation.

02

Connect the keys

Add the OAuth, storage, and infrastructure credentials your product needs. Spend the first session on the idea, not login plumbing.

03

Agent-legible

Entity, Repository, Route, Router — the same vertical slice for every feature. Your agent knows where to read and where to write.

04

Production guardrails

Runtime validation, generated migrations, explicit boundaries, and end-to-end types keep fast changes reviewable.

02
The build loop

One path from first prompt
to live operations.

idea
scaffold
vertical slices
deploy
terminal operations
01 — scaffold
$ pnpm dlx spfn@beta create my-app --mode full # core · auth · i18n · ops $ cd my-app && docker compose up -d $ pnpm spfn:dev
02 — give the agent a path
src/server/ ├── entities/idea.ts ├── repositories/idea.ts ├── routes/ideas.ts └── router.ts # same slice, every feature
03 — operate what shipped
$ spfn ops list --app <url> /_ops/ ├── listCustomers ├── refundOrder └── publishContent # your commands · your policy
FIG 01 — ONE APP · ONE REPEATABLE PATTERN · ONE AGENT-ACCESSIBLE OPERATING SURFACE
03
Choose your starting line

Full when speed matters.
Bare when you want the kernel.

Bare modeMINIMAL

The smallest SPFN architecture.

Start with the core full-stack pattern and choose every additional function yourself.

  • @spfn/core
  • Next.js + SPFN server
  • Database + route codegen
  • Add functions as needed
FULL IS THE INTERACTIVE RECOMMENDATION · AUTOMATION SHOULD PASS --MODE EXPLICITLY
04
Operate from the terminal

Deploy the product.
Keep the agent on the team.

Write the operations you allow as routes under /_ops and run them with spfn ops, in the same terminal your coding agent already works in. Each command has its own input schema and authorization rule. No admin dashboard to build first. When operators work outside a terminal, write the same operations as MCP tools with @spfn/mcp, over the same services.

Read the full guide
01 / BUILD

Domain operations stay in the app

Ops routes call the same repositories and services as the product instead of duplicating business rules.

02 / SECURE

Identity and policy remain explicit

Every command answers only to a scoped, revocable ops token from @spfn/auth. A command the app marks destructive needs --yes.

03 / RUN

Discovered from the running app

spfn ops list reads what the deployed app exposes, and --describe prints each command's usage from the app's own schemas.

05
Functions

Add capability.
Keep the architecture.

Take the prototype all the way.