Skip to main content
This walkthrough runs a Pylon server with a schema, one policy, and one server function. You then call the API with curl to see it work. For a realtime UI, point the React SDK, Swift SDK, or React Native SDK at the running server. You can also clone one of the example apps.
Start from a working app:
This scaffolds a full-stack Pylon app with a React 19 SSR frontend and API on one port. The Pylon CLI is a project dependency, so npm run dev needs no global install. Run npm create @pylonsync/pylon@latest without arguments to choose among the default (SaaS), todo, chat, shop, consumer, waitlist, ai-chat, and other templates. Each app includes a pylon test setup.Deploy with npm run deploy or pylon deploy; see Deploy.
The rest of this page builds a minimal backend by hand so you can see each piece. It uses a global pylon binary; if you’d rather start from the scaffold above, skip to Concepts.

1. Install the CLI

Downloads a prebuilt pylon binary to ~/.local/bin. Linux and macOS, x86_64 and arm64. No Rust toolchain required. (The npm create scaffold above doesn’t need this. It bundles the CLI. Install globally when you want pylon on your PATH for the from-scratch flow below.) Pylon needs Bun ≥ 1.0 at runtime. It runs your server functions and SSR on Bun. Verify:
Other ways to install:

2. Scaffold a new app

This scaffolds a Bun workspace with the API at apps/api/:
pylon init scaffolds the backend only, with no frontend framework, because Pylon renders React on the server natively. To also generate a separate frontend, pass --frontend react (Vite), --frontend tanstack, or --frontend nextjs, or pick interactively when stdin is a TTY. For a full-stack app with SSR pages, use npm create @pylonsync/pylon (above) instead. You’ll add a functions/ directory under apps/api/ by hand in step 4.

3. Define the schema

Replace apps/api/app.ts with:
The trailing console.log is required. pylon dev captures stdout as the manifest.

4. Add a server function

Create apps/api/functions/createNote.ts:
The filename becomes the RPC name. It is callable at POST /api/fn/createNote. pylon init already adds @pylonsync/sdk + @pylonsync/functions to apps/api/package.json. If you skipped init or removed the deps, install them manually:

5. Run the server

pylon dev does four things:
  • auto-discovers app.ts (and schema.ts for legacy projects).
  • watches app.ts and functions/*.ts.
  • auto-migrates the database (SQLite at .pylon/dev.db by default, Postgres if DATABASE_URL is set).
  • serves the API on http://localhost:4321.
Expected output:

6. Call the API

Create a guest session:
Call the mutation (replace TOKEN with the value from above):
List the rows:
You now have a working Pylon backend with a typed schema, row-level policy, RPC function, and HTTP API.

Next steps

Entities

All the field types and index options.

Policies

How row-level access rules work.

Functions

Queries, mutations, actions, validators.

Live queries

How db.useQuery stays in sync.

Testing

pylon test — pure logic, components, functions over HTTP.
Want a full UI? For all three, the same Pylon server backs the UI. The wire format is identical across platforms.

Hand the rest to a coding agent

Once your backend runs, the rest happens in the shell. Pylon Cloud has a one-paste handoff flow that signs your coding agent (Claude Code, Codex, OpenCode, Cursor, Aider, grok build) into your account, installs the Pylon skill, and asks what to build. No token enters the chat history. From there the agent can use the full CLI surface: pylon secrets, pylon logs tail, pylon deploy, pylon domains add, pylon db backup, pylon data list <Entity>, etc.