# phibac > phibac is a personal backend: each user has one private database on this server (https://phibac.com), shared by the apps they approve. You build a static web app; it stores the user's data through the phibac SDK, with sign-in by a passkey or a password in a popup, an offline write queue and live updates. Developer tokens and agent tools manage apps and schemas only and can never read, write, export or delete user data. Full reference (read it before writing code): https://phibac.com/llms-full.txt MCP endpoint: https://phibac.com/mcp (Authorization: Bearer pbd_..., a developer token from https://phibac.com/account/developer) ## Steps 1. Create the app with the origins it is served from: create_app, or `phibac init --name --origin ` (install the SDK and the CLI in the project first: `npm install @phibac/sdk` and `npm install --save-dev phibac`; run the CLI as `npx phibac`). The CLI needs PB_TOKEN, except on the local server (`npx phibac dev`), where it uses the server's own key in ./.pb/developer-token. 2. Define collections in pb.config.ts and publish them: preview_schema then publish_schema, or `phibac deploy`. 3. Generate TypeScript types: generate_types, or `phibac generate`. 4. In the app: `const backend = await connect({ app, baseUrl: "https://phibac.com", schemaMajors: SCHEMA_MAJORS })` from a click handler (it may open a popup), then `backend.collection(name).create(data)`, `.where(field, op, value).orderBy(field, "desc").subscribe(cb)`. ## Rules to remember - Collection names are reverse-domain (com.example.journal.entry), first come first served; core.* and sandbox.* are reserved. sandbox. needs no schema and stays private to the app. - Every collection and field needs a description. Types: string, number, integer, boolean, datetime, enum, json, fileRef, recordRef. - Within a major version only additive changes are allowed (add optional fields); anything else is breaking (schema_incompatible with reasons) and must be published as the next major. Nothing is ever deleted. - Cross-app access is read-only and needs the user's consent: collection.requestAccess() from a click, or open consentUrl from a consent_required error. - Queries are limited: filters combine with AND only, results sort by one field, and there is no text search, no counts or totals, and linked records are not fetched for you. "Query limits and workarounds" in the sdk section of https://phibac.com/llms-full.txt (get_docs topic sdk) shows how to work around each; read it before designing screens. - Errors are {"error": {"code", "message", "hint", ...}}; the hint says how to fix the call. Codes: invalid_request, unauthorized, trial_ended, forbidden, consent_required, app_suspended, not_found, schema_incompatible, record_deleted, payload_too_large, schema_violation, version_unsupported, rate_limited (wait Retry-After), internal, storage_full. - Limits: 256 KB per record, 100 MB per file, 500 records per query page, 100 operations per batch. ## Docs sections Each is a topic of the get_docs tool and a section of https://phibac.com/llms-full.txt: - quickstart: a working app end to end - config: the pb.config.ts format - schemas: naming, field types, versions and what is breaking - errors: every error code and what to do about it - consent: how consent between apps works - limits: sizes, page sizes, token lifetimes, plans - sdk: the SDK interface - cli: the command-line tool - tools: the MCP tools and the developer API