A small Pinata-ready starter for building hosted agent apps with Next.js, SQLite, optional password auth, and optional OpenClaw response/webhook proxy routes.
The included todo app is intentionally plain. Its job is to show the deployable pattern:
- read-only dashboard at
/app - SQLite persistence in
data/starter.sqlite - CRUD API routes under
/app/api/todos - optional
APP_PASSWORDBasic Auth - optional
API_PASSWORDgated OpenClaw proxy routes - Pinata v1
manifest.json - workspace docs for agent identity, bootstrap, and operations
This starter was built from Raid Guild cohort agent-template experiments. Learn more at https://www.raidguild.org/join.
npm install
npm run devOpen http://localhost:3000/app.
In a hosted Pinata instance, derive the public /app URL from HOSTNAME when possible.
A runtime hostname like xwvqggt3-0 maps to https://xwvqggt3.agents.pinata.cloud/app. If the pattern does not match, use the agent's Routes tab and choose the /app route.
npm run build
npm run typecheckGET /app/api/todosGET /app/api/todos?status=openPOST /app/api/todosPATCH /app/api/todos/:idDELETE /app/api/todos/:idGET /app/api/health
Example create:
curl -X POST http://localhost:3000/app/api/todos \
-H "Content-Type: application/json" \
-d '{"title":"Replace the starter schema","body":"Model the records your agent app should manage.","priority":"high","dueDate":"2026-04-30"}'Example update:
curl -X PATCH http://localhost:3000/app/api/todos/1 \
-H "Content-Type: application/json" \
-d '{"status":"done"}'Set APP_PASSWORD to require HTTP Basic Auth for /app and /app/api/*. Any non-empty username is accepted; the password must match APP_PASSWORD.
Leave APP_PASSWORD unset for local development or public demo instances.
This starter includes optional relays for the local OpenClaw gateway:
GET /app/api/openclaw/healthPOST /app/api/openclaw/responses->POST /v1/responsesPOST /app/api/openclaw/hooks/:name->POST /hooks/:name
The proxy is disabled unless API_PASSWORD is set in the runtime environment. When enabled, call it with either header:
Authorization: Bearer <API_PASSWORD>x-api-password: <API_PASSWORD>
Optional env:
OPENCLAW_BASE_URL: defaults tohttp://127.0.0.1:18789OPENCLAW_GATEWAY_TOKEN: forwarded as bearer auth for/v1/responseswhen present
To use these routes in a Pinata instance, enable the matching OpenClaw HTTP features in openclaw.json. At minimum, enable the responses endpoint:
{
"gateway": {
"http": {
"endpoints": {
"responses": {
"enabled": true
}
}
}
}
}Also enable webhook/hooks support for any named hook you want to relay through /app/api/openclaw/hooks/:name. Keep API_PASSWORD out of manifest.json; set it directly in the instance environment when you want the proxy online.
Good first changes:
- Rename the app and update
manifest.json. - Replace the todo schema in
lib/db.ts. - Replace
/app/api/todoswith your domain routes. - Keep the dashboard read-only.
- Update
workspace/OPERATIONS.mdso the agent knows how to call your APIs. - Keep the manifest minimal until Pinata deploy validation confirms extra fields are supported.
When using an agent or coding assistant to turn this starter into a new template, give it the official Pinata template docs and tell it to keep this repo as the working example pattern.
Useful references:
- Template overview:
https://docs.pinata.cloud/agents/templates/overview - Creating templates:
https://docs.pinata.cloud/agents/templates/creating
Suggested build prompt:
You are converting the RaidGuild Agent App Starter into a new Pinata agent template.
Use these docs as the source of truth:
- https://docs.pinata.cloud/agents/templates/overview
- https://docs.pinata.cloud/agents/templates/creating
Use this starter as the implementation pattern:
- Next.js App Router served at /app
- local SQLite persistence through better-sqlite3
- read-only browser dashboard
- API routes for agent/chat writes
- optional APP_PASSWORD Basic Auth
- optional API_PASSWORD OpenClaw proxy routes
- conservative Pinata manifest.v1.json shape
- workspace docs for BOOTSTRAP, IDENTITY, OPERATIONS, TOOLS, USER, SOUL, AGENTS, and HEARTBEAT
Build the new template by first defining the domain model, then updating the database, API routes, dashboard, workspace docs, README, and manifest. Keep the default template runnable without required external secrets. Run npm run build and npm run typecheck before calling the pass complete.
Before publishing, deploy from your template repo and test the hosted app route, API routes, auth behavior, and any OpenClaw proxy assumptions.
UI flow:
- Go to
https://agents.pinata.cloud/templates/submit. - Enter the public repository URL.
- Click Validate.
- Review the parsed manifest and workspace files.
- Submit for review.
CLI flow:
pinata agents templates validate https://github.com/user/my-template
pinata agents templates submit https://github.com/user/my-template
pinata agents templates submit https://github.com/user/my-template --branch developPublished templates can later be managed from My Templates or with the template CLI commands.
You are the RaidGuild Agent App Starter. First read workspace/BOOTSTRAP.md, workspace/IDENTITY.md, workspace/OPERATIONS.md, and workspace/TOOLS.md. Then ask me what kind of agent app I want to build from this starter and help me plan the first domain model, API routes, and dashboard surface.