How tippi-fifestarr/sadcoin-email works
This is a Next.js Web3 productivity game: a player connects a wallet, progresses through corporate-character and mini-game stages, turns their input into an editable AI-generated email, and sends it. The README also documents token purchases, staking/rewards, conversions, achievement NFTs, and multi-network support. The graph distinguishes the game orchestrator, email-generation and delivery services, and blockchain UI/integration. Some screen and contract implementation details were not sampled; unsourced subsystem links are omitted rather than inferred.
Main entry points: main-game.tsx Game flow · useContracts.ts Contract actions · route.ts Generation API · appkit.tsx Wallet connection
Components 24
Game experience
- Game entry
sad-email-frontend/src/app/page.tsx - Game flow
sad-email-frontend/src/main-game.tsx - Game screens
sad-email-frontend/src/components/screens - Character content
sad-email-frontend/src/data/gameData.ts - Terminal UI
sad-email-frontend/src/components/CRTContainer.tsx - Game explanation
sad-email-frontend/src/about-page.tsx
Email workflow
- Email input
sad-email-frontend/src/components/screens/EmailInputScreen.tsx - Email editing
sad-email-frontend/src/components/screens/WritingScreen.tsx - Email delivery API
sad-email-frontend/src/app/api/send-email/route.ts
AI generation
- Generation API
sad-email-frontend/src/app/api/generate-email/route.ts - Bedrock provider
sad-email-frontend/src/lib/bedrock.ts - Gemini provider
sad-email-frontend/src/lib/gemini.ts - AI model service
Wallet and rewards
- Navigation and wallet UI
sad-email-frontend/src/components/NavBar.tsx - Wallet connection
sad-email-frontend/context/appkit.tsx - Contract actions
sad-email-frontend/src/hooks/useContracts.ts - Contract interfaces
sad-email-frontend/src/lib/contracts.ts - Staking screen
sad-email-frontend/src/components/screens/WaterCoolerScreen.tsx - Debug controls
sad-email-frontend/src/components/DebugPanel.tsx - Network switcher
sad-email-frontend/src/components/NetworkSwitcher.tsx
Other components
- Player
- Recipient inbox
- Wallet user
- Blockchain networks
Connections 26
- Player → Game entry: opens game
sad-email-frontend/src/app/page.tsx - Game entry → Game flow: renders
sad-email-frontend/src/app/page.tsx - Game flow → Game screens: routes screens
sad-email-frontend/src/main-game.tsx - Game flow → Terminal UI: renders in
sad-email-frontend/src/main-game.tsx - Game flow → Navigation and wallet UI: renders
sad-email-frontend/src/main-game.tsx - Game flow → Game explanation: offers details
- Game flow → Character content: uses character data
- Game flow → Email input: collects input
- Game flow → Generation API: requests generation
- Game flow → Email editing: presents draft
- Email editing → Email delivery API: submits email
- Email delivery API → Recipient inbox: sends email
- Generation API → Bedrock provider: selects provider
- Generation API → Gemini provider: selects provider
- Bedrock provider → AI model service: generates text
- Gemini provider → AI model service: generates text
- Wallet user → Wallet connection: connects
sad-email-frontend/context/appkit.tsx - Wallet connection → Blockchain networks: configures networks
sad-email-frontend/context/appkit.tsx - Navigation and wallet UI → Wallet connection: initiates connection
- Game flow → Staking screen: opens staking
- Staking screen → Contract actions: calls staking actions
sad-email-frontend/src/components/screens/WaterCoolerScreen.tsx - Debug controls → Contract actions: tests contract actions
sad-email-frontend/src/components/DebugPanel.tsx - Debug controls → Network switcher: renders switcher
sad-email-frontend/src/components/DebugPanel.tsx - Contract actions → Contract interfaces: uses interfaces
- Contract actions → Blockchain networks: reads and writes
- Network switcher → Blockchain networks: switches network