phibac developer docs

phibac developer docs

phibac is a backend for web apps where each user has one private database on the server, and the apps that user approves share it. You write only the front end, the part that runs in the user's browser: a web page that saves and reads the user's data through the phibac SDK, a JavaScript library you add to your page. You do not write server code or SQL, and you never handle passwords: users sign in on the server's own page, with a passkey (a key kept on their device) or with a password.

These docs are for developers who know basic web development (HTML and JavaScript or TypeScript), and for anyone building an app with an AI coding tool.

Choose where to start

  • Build it yourself. Build your first app takes you from an empty folder to a page that signs a user in, saves notes and shows them live, all on your own computer.
  • Build it with an AI coding tool. Build with an AI coding tool gives you two prompts to paste into the tool and shows how to give it your developer token safely and how to check its work. A tool that can read web pages can also be given the short prompt as plain text: /docs/prompts/short.txt.
  • Understand it first. One backend, many apps explains how users, apps and their data fit together, before you write any code.

Every page of these docs is listed below, in reading order.

Start here

  • Build your first app: run a local server, define your data and write a page that signs in, saves notes and shows them live.
  • Build with an AI coding tool: two prompts to paste into an AI coding tool, how to give it your developer token safely and how to check its work.
  • What you can build for: web apps and installable web apps work today; desktop and mobile wrappers are not yet tested, and native apps are not supported.

Concepts

Guides

Troubleshooting

Reference

  • SDK reference: every function, method, option and type of the SDK.
  • CLI reference: every command, flag and environment variable of the CLI, and its exit codes.
  • pb.config.ts reference: every helper and option in the config file, the naming rules and which changes are breaking.
  • Limits: every limit on this server and what happens when you go over it.
  • Developer API and agent tools: the routes and tools your developer token can use, and how to connect an AI coding tool.
  • How sign-in works: passkeys and passwords, the sign-in popup, tokens and what is kept in the browser.
  • Glossary: every word these docs use, with a short definition.

For AI coding tools

An AI coding tool can read the reference written for it: llms.txt (a short index) and llms-full.txt (the full reference). Give a tool llms-full.txt only through one of the two prompts on Build with an AI coding tool: on its own, the file builds straight on this server; the prompts tell the tool to try everything on a local server first. The two prompts are also served as plain text: /docs/prompts/short.txt and /docs/prompts/full.txt.