pocketbase
БесплатноБез исполняемых скриптовНе проверенAssists with building backends using PocketBase, a single-binary backend with embedded SQLite, real-time subscriptions, file storage, and authentication. Use…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
PocketBase
Overview
PocketBase is an open-source backend packaged as a single binary (or a Go framework), providing an embedded SQLite database, real-time subscriptions over SSE, file storage, built-in authentication, and a dashboard. It auto-generates a REST-ish API for every collection. The project is still pre-1.0 (v0.40.x at the time of writing): backward compatibility is not guaranteed between releases, so read the changelog before upgrading and pin the version you deploy.
Instructions
Run it
- Download the zip for your platform from the GitHub Releases page, check it against
checksums.txtfrom the same release (sha256sum -c --ignore-missing checksums.txt), unzip it, and run./pocketbase serve. It listens onhttp://127.0.0.1:8090: the API is under/api/, the dashboard under/_/, and files inpb_public/are served as static content. - Create the first superuser from the installer link printed on first start, or with
./pocketbase superuser create [email protected] 'a-long-password'. (Older material says "admin"; since v0.23 the term is superuser.) - The binary manages
pb_data/(database, uploads, backups; keep it out of git),pb_migrations/(collection changes as JS files; commit them) and, if you create it,pb_hooks/.
Collections and API rules
- Collection types: base (standard CRUD), auth (users with password, OAuth2, OTP, MFA), view (read-only, backed by a SQL query).
- Every collection has five rules:
listRule,viewRule,createRule,updateRule,deleteRule. A rule that isnull("locked") means superusers only; an empty string means anyone, including guests; a non-empty string is a filter expression the request must satisfy, e.g.@request.auth.id != "" && author = @request.auth.id. - Rules double as filters on list requests, so a list returns only the rows that match, not a 403.
JavaScript SDK
npm install pocketbase
- Query:
pb.collection("posts").getList(1, 20, { filter: pb.filter("author = {:uid}", { uid }), sort: "-created", expand: "author" }). Build filters withpb.filter()so user input is bound as parameters rather than concatenated. - Auth:
pb.collection("users").authWithPassword(email, password); the session lives inpb.authStore. - Realtime:
const unsubscribe = await pb.collection("messages").subscribe("*", (e) => ...);e.actioniscreate,updateordeleteande.recordthe row. Callunsubscribe()(orpb.collection("messages").unsubscribe()) when the view unmounts. The SDK reconnects on its own.
Server-side JavaScript (pb_hooks/*.pb.js)
Files in pb_hooks/ are loaded at start; on UNIX-based platforms PocketBase restarts itself when they change, elsewhere restart it manually. Handlers must call e.next() to continue the chain.
// pb_hooks/main.pb.js
onRecordCreateRequest((e) => {
if (e.record.getString("title").length < 3) {
throw new BadRequestError("Title must be at least 3 characters");
}
e.next();
}, "posts");
onRecordAfterCreateSuccess((e) => {
console.log("new post", e.record.id);
e.next();
}, "posts");
routerAdd("GET", "/api/shop/ping/{name}", (e) => {
return e.json(200, { hello: e.request.pathValue("name") });
});
cronAdd("nightly-cleanup", "0 3 * * *", () => {
console.log("cleanup ran");
});
- Record hooks are
onRecordCreate,onRecordUpdate,onRecordDelete(before persisting),onRecordAfterCreateSuccess/...UpdateSuccess/...DeleteSuccess(after commit), and the...Requestvariants for API calls. Pass collection names as trailing arguments to limit them. The old namesonBeforeCreateRecord/onAfterUpdateRecordno longer exist. - Each handler runs in its own isolated context, so variables or functions declared outside the handler are undefined inside it. Share code through a CommonJS module loaded inside the handler:
const utils = require(${__hooks}/utils.js). The engine is ES5-style goja, not Node: nofs,fetchor ESM imports without bundling. - Routes use
routerAdd(method, path, handler, ...middlewares)with Go-style{param}patterns; add$apis.requireAuth()to restrict to signed-in users. Prefix custom/api/paths with your app name to avoid clashing with system routes. - Cron jobs:
cronAdd(id, "* * * * *", fn); they also appear under Dashboard > Settings > Crons.
Deploy and back up
- Run
./pocketbase serve yourdomain.comfor automatic Let's Encrypt HTTPS, or put it behind Caddy or Nginx (set the "User IP proxy headers" in settings, and raiseproxy_read_timeoutso SSE connections survive). - Use a systemd unit (
Restart=always,WorkingDirectoryset to the app directory). In Docker, build your own image around the binary and mountpb_data/as a volume; there is no official image, and the docs give a minimal Alpine Dockerfile that downloads the release zip and mounts/pb/pb_data. - Back up with Dashboard > Settings > Backups (scheduled or on demand) before upgrading or running migrati
Установить pocketbase в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл pocketbase?
Assists with building backends using PocketBase, a single-binary backend with embedded SQLite, real-time subscriptions, file storage, and authentication. Use when creating MVPs, prototyping APIs, configuring collections and API rules, writing pb_hooks, or setting up auth flows. Trigger words: pocketbase, backend, sqlite, real-time, single binary, collections, pb.
Как установить скилл pocketbase?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pocketbase запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic