How kaustavsen93/questpulse_surveys works
QuestPulse turns a business’s survey brief into a story game, publishes it by short link, collects player responses, and presents results and coupon rewards. The main flow runs from the business-facing editor through server-side AI generation and validation, then publication and player gameplay, with answers flowing to analytics and rewards. The graph also preserves account, voice-note, custom-scene, and storage capabilities. Server routes and several game modules were only partially sampled; uncertain implementation links are omitted rather than inferred.
Main entry points: server.js Application API · qp.js Shared game runtime · store.js Data store · validators.js Config validation
Components 25
Game creation
- Editor and dashboard
public/index.html - Game prompts
lib/gamePrompts.js - AI helpers
lib/assist.js - Model selection
lib/firstAnswer.js - Config validation
public/games/core/validators.js - Custom scenery
lib/scenery.js
Game experience
- Detective game
public/games/detective.js - RPG game
public/games/rpg.js - Quiz game
public/games/quiz.js - Platformer game
public/games/platformer.js - Shared game runtime
public/games/core/qp.js - Scene rendering
public/games/core/scenes.js - Voice notes
public/games/core/voice.js - Game languages
public/games/core/i18n.js
Accounts and publishing
- Application API
server.js - Accounts and sessions
server.js - Survey publishing
server.js
Results and rewards
- Answers and analytics
server.js - Coupon claims
public/games/core/rewards.js
Persistence and services
- Data store
lib/store.js - Password reset email
lib/mailer.js
Other components
- Business user
- Player
- Gemini AI
- Cloud Firestore
Connections 37
- Business user → Editor and dashboard: creates games
README.md - Editor and dashboard → Application API: requests generation
README.md - Application API → Game prompts: builds prompts
server.js - Application API → Config validation: validates configs
server.js - Application API → AI helpers: uses AI helpers
server.js - Application API → Custom scenery: generates scenes
server.js - Application API → Model selection: selects model calls
server.js - Game prompts → Config validation: uses schema rules
lib/gamePrompts.js - AI helpers → Game prompts: uses prompts
lib/assist.js - Custom scenery → Config validation: cleans scenery
lib/scenery.js - Application API → Gemini AI: requests generation
README.md - Business user → Survey publishing: publishes survey
README.md - Survey publishing → Application API: saves published game
README.md - Application API → Data store: reads and writes
server.js - Application API → Password reset email: sends reset links
server.js - Application API → Accounts and sessions: handles sign-in
README.md - Player → Survey publishing: opens short link
README.md - Survey publishing → Detective game: serves game
README.md - Survey publishing → RPG game: serves game
README.md - Survey publishing → Quiz game: serves game
README.md - Survey publishing → Platformer game: serves game
README.md - Detective game → Shared game runtime: uses runtime
- RPG game → Shared game runtime: uses runtime
- Quiz game → Shared game runtime: uses runtime
- Platformer game → Shared game runtime: uses runtime
- Shared game runtime → Config validation: validates games
- Shared game runtime → Game languages: localizes copy
- Shared game runtime → Scene rendering: renders scenes
- Shared game runtime → Voice notes: supports voice
- Player → Application API: submits answers
README.md - Application API → Answers and analytics: records responses
README.md - Answers and analytics → Data store: reads and writes
README.md - Application API → Coupon claims: claims coupons
README.md - Coupon claims → Data store: saves claims
README.md - Application API → Voice notes: transcribes notes
README.md - Player → Answers and analytics: views results
README.md - Data store → Cloud Firestore: uses optional backend
README.md