This starter demonstrates how to build a Telegram Mini App with SpawnDock local preview support.
Install dependencies with pnpm install.
If you are using SpawnDock, bootstrap the project with:
npx -y @spawn-dock/create@beta --token <pairing-token> [project-dir]pnpm run devstarts Next.js and the SpawnDock tunnel together (no AI agent). The tunnel startup logs also print the Telegram Mini App deep link when the bootstrappedspawndock.config.jsonincludes it.pnpm run agentstarts Next.js, the tunnel, then the local SpawnDock runtime launcher (spawndock/agent.mjs).pnpm run dev:nextstarts only the local Next.js server.pnpm run dev:tunnelstarts only the SpawnDock tunnel client.pnpm run agent:sessionstarts only the SpawnDock AI runtime launcher (spawn-dock session, no dev server).pnpm run buildbuilds the starter for production.pnpm run publish:github-pagesexports the app and deploys it to GitHub Pages.pnpm run startstarts the production Next.js server.
AGENTS.mdcontains the base system instructions for AI agents working inside this template.CLAUDE.mdprovides Claude Code project memory and points it to the local TMA knowledge skill..agents/skills/tma-knowledge-searchcontains the local Telegram Mini App / SpawnDock knowledge-search skill used by compatible agents.- That skill is Node-based and should be run with
node .agents/skills/tma-knowledge-search/scripts/search_tma_knowledge.mjs "<query>"from the project root. - Agents should treat
pnpm run devas the main local flow because it starts both Next.js and the SpawnDock dev tunnel. - Use
pnpm run dev:nextonly when you explicitly want the local app server without the tunnel. - SpawnDock bootstrap also mirrors the same skill into
~/.codex/skills/tma-knowledge-searchwhen preparing a local Codex setup.
The starter expects a bootstrap step that writes spawndock.config.json and
spawndock.dev-tunnel.json before pnpm run dev is used. The template itself
already ships agent MCP configs and a local wrapper so the generated project is
ready to connect to @spawn-dock/mcp via /mcp/sse.
spawndock.config.jsoncontains preview/runtime data for the app.spawndock.config.jsoncan also includeapiTokenfor the TMA knowledge-search skill.spawndock.dev-tunnel.jsoncontains tunnel connection data..env.localcan includeSPAWNDOCK_API_TOKENfor the same knowledge-search access.opencode.jsonis generated during bootstrap for OpenCode..mcp.jsonis generated during bootstrap for Claude Code.spawndock/mcp.mjsresolvesmcpServerUrlfromspawndock.config.json.public/tonconnect-manifest.jsonis replaced during bootstrap with the correct preview URL.
- The template still supports the regular Next.js build and start commands.
- The
mockTelegramEnvdevelopment-only shim is still used by the app.