Local Development

Run the full PocketAgent platform — Next.js frontend and FastAPI backend — on your machine.

Prerequisites

  • Node.js 20+ and npm
  • Python 3.11+
  • An OpenAI-compatible API key
  • WalletConnect project ID (for RainbowKit wallet connections)

Clone and install

git clone https://github.com/Jayanng/PocketAgent.git
cd PocketAgent
npm install
cd backend && pip install -r requirements.txt

Configure environment

Backend

cd backend
cp .env.example .env

Set at minimum OPENAI_API_KEY, ENCRYPTION_KEY, and JWT_SECRET. See the full reference in Configuration.

Frontend

cd frontend
cp .env.example .env.local

Set NEXT_PUBLIC_API_URL=http://127.0.0.1:8000 (no trailing slash) and your WalletConnect project ID.

Start dev servers

npm run dev

From the repository root. Runs frontend (:3000) and backend (:8000) concurrently.

  1. Web UI — http://localhost:3000
  2. Automations — http://localhost:3000/scheduled-tasks
  3. REST API — http://127.0.0.1:8000
  4. Swagger UI — http://127.0.0.1:8000/docs
  5. ReDoc — http://127.0.0.1:8000/redoc

Local auth bypass

For UI-only development you can set DISABLE_AGENT_AUTH=true in the backend and NEXT_PUBLIC_DISABLE_AGENT_AUTH=true in the frontend. Never use this in production.

Run tests

cd backend && pytest -q
cd frontend && npm test