How iampawan/pitchtank works
Pitch Tank is a browser-based startup-pitch and fictional investment simulation. A founder chooses live voice or the explicitly scripted preview, pitches for 60 seconds, answers investor questions, negotiates offers and counteroffers, then accepts a deal or ends the session. The Next.js experience presents the studio and sends actions through its session hook to FastAPI, which owns turn deadlines, validation and deal state. Live voice uses Agora; checkpoints and usage limits can persist through the deployment’s durable storage. Source excerpts are partial, so uncertain internal routing is omitted.
Main entry points: main.py FastAPI session API · page.tsx Studio interface · useTank.ts Session controller · agora_adapter.py Agora adapter
Components 20
Studio experience
- Studio interface
web/app/page.tsx - Investor stage
web/components/Stage.tsx - Investor characters
web/components/Investor.tsx - Proposal form
web/components/ProposalForm.tsx - Sharing
web/lib/sharing.ts - Session controller
web/lib/useTank.ts - API client
web/lib/tank.ts - Snapshot utilities
web/lib/session-state.ts
Session and game
- FastAPI session API
server/main.py - Studio routes
server/studio_api.py - Game rules
server/session_model.py - Conversation moderation
server/moderator.py - Usage limits
server/limits.py
Voice integration
- Voice connection
web/lib/voice.ts - Agora adapter
server/agora_adapter.py
Persistence and deployment
- Session store
server/storage.py - Cloudflare gateway
deployment/cloudflare/worker.ts - Durable checkpoints
deployment/cloudflare/worker.ts
Other components
- Founder
- Agora voice services
Connections 21
- Founder → Studio interface: uses studio
- Studio interface → Investor stage: renders scene
- Investor stage → Investor characters: renders panel
- Studio interface → Proposal form: presents terms
- Studio interface → Session controller: starts actions
- Session controller → API client: sends requests
- Session controller → Voice connection: controls voice
- Session controller → Snapshot utilities: checks revisions
- API client → FastAPI session API: calls API
- FastAPI session API → Studio routes: includes routes
- FastAPI session API → Game rules: applies actions
- FastAPI session API → Agora adapter: controls agents
- Agora adapter → Conversation moderation: uses moderation
- Agora adapter → Agora voice services: connects agents
- Voice connection → Agora voice services: connects browser
- FastAPI session API → Session store: saves checkpoints
- FastAPI session API → Usage limits: checks quotas
- Session store → Cloudflare gateway: requests remote state
- Cloudflare gateway → Durable checkpoints: routes state
- Cloudflare gateway → FastAPI session API: forwards requests
- Founder → Sharing: shares app link