AgentSkillsCN

pocket-brain-local-secure-stack

启动 PocketBrain 本地安全端到端栈(前端 + 工作线程代理 + 同步服务器 + Postgres + Redis)。在需要进行完整本地集成测试、复现身份验证或同步问题、验证 /api/v2 代理透传功能,或准备安全路径端到端检查时使用。

SKILL.md
--- frontmatter
name: pocket-brain-local-secure-stack
description: Stand up the PocketBrain local secure end-to-end stack (frontend + worker proxy + sync server + Postgres + Redis). Use when asked to run full local integration, reproduce auth or sync issues, validate /api/v2 proxy passthrough, or prepare secure-path E2E checks.

PocketBrain Local Secure Stack

Start local infrastructure and application services in the documented order and verify health before testing.

Workflow

  1. Confirm local prerequisites.
  • Ensure Node.js 18+, npm, Docker, and Docker Compose are available.
  1. Start infrastructure dependencies.
  • Run docker compose up -d postgres redis.
  1. Seed local env files.
  • Run cp server/.env.example server/.env if missing.
  • Run cp worker/.dev.vars.example worker/.dev.vars if missing.
  • Ensure VPS_API_ORIGIN=http://127.0.0.1:8788 in worker/.dev.vars.
  1. Start services in separate terminals.
  • Terminal A: npm run server:dev.
  • Terminal B: npm run worker:dev.
  • Terminal C: npm run dev:proxy.
  1. Verify health.
  • Check http://localhost:8788/health.
  • Check http://localhost:8788/ready.
  • Open http://localhost:3000.
  1. Run optional validation.
  • Run npm run test for headless E2E checks when requested.
  • Use targeted E2E files for scenario-specific regressions.
  1. Teardown when finished.
  • Stop local app processes.
  • Run docker compose stop postgres redis or docker compose down.

Troubleshooting

  • Read references/startup-sequence.md for exact startup order.
  • Read references/troubleshooting.md for common failures and recovery commands.

Safety

  • Never commit server/.env or worker/.dev.vars.
  • Keep ALLOW_INSECURE_DEV_AUTH=true only for local development.
  • Do not use local insecure defaults as production guidance.