How svtrhub/karsa_demo works
Karsa is a student-development demo: a student completes profile onboarding, tours the workspace, chooses a specialist persona, and receives profile-aware streamed chat guidance. The page composes the experience; shared demo state and domain transitions support onboarding, chat, and rewards. The README also lists rate limiting and CORS validation, and planned competition, portfolio, coin-ledger, and room-customization features. Those planned features appear as locked “coming soon” UI, not implemented product subsystems. Some component wiring is supported only by the source index; unsampled internals are not inferred.
Main entry points: page.tsx Application flow · DemoContext.tsx Demo state · RumahKarsaRoom.tsx Workspace room · ChatModal.tsx Chat interface
Components 22
Student experience
- Application flow
src/app/page.tsx - Splash screen
src/components/splash/AppSplashScreen.tsx - Profile onboarding
src/components/onboarding/OnboardingFlow.tsx - First-use tour
src/components/ftux/FTUXSequence.tsx - Workspace room
src/components/dashboard/RumahKarsaRoom.tsx - Room camera
src/hooks/useCameraViewport.ts - Character sprites
src/components/dashboard/CharacterSprite.tsx - Persona navigation
src/components/dashboard/Sidebar.tsx - Workspace controls
src/components/dashboard/TopBar.tsx - Command center
src/components/dashboard/FloatingCommandCenter.tsx - Chat interface
src/components/chat/ChatModal.tsx - Planned features
src/components/dashboard/ComingSoonModal.tsx
Profile and state
- Demo state
src/context/DemoContext.tsx - State transitions
src/lib/domainEngine.ts - Browser storage
Persona guidance
- Persona prompts
src/lib/personas.ts
Chat service
- Chat stream hook
src/hooks/useChatStream.ts - Chat API route
src/app/api/chat/route.ts - Rate limiter
src/lib/rateLimit.ts - LLM streaming
src/lib/llm.ts
Other components
- Student
- Google Gemini
Connections 24
- Student → Application flow: opens app
README.md - Application flow → Splash screen: renders
src/app/page.tsx - Application flow → Profile onboarding: renders
src/app/page.tsx - Application flow → First-use tour: renders
src/app/page.tsx - Application flow → Workspace room: renders
src/app/page.tsx - Application flow → Persona navigation: renders
src/app/page.tsx - Application flow → Workspace controls: renders
src/app/page.tsx - Application flow → Command center: renders
src/app/page.tsx - Application flow → Chat interface: renders
src/app/page.tsx - Application flow → Planned features: renders
src/app/page.tsx - Application flow → Demo state: reads state
src/app/page.tsx - Profile onboarding → Demo state: updates profile
src/components/onboarding/OnboardingFlow.tsx - Persona navigation → Demo state: opens persona chat
src/components/dashboard/Sidebar.tsx - Workspace room → Room camera: uses camera
src/components/dashboard/RumahKarsaRoom.tsx - Workspace room → Character sprites: renders characters
src/components/dashboard/RumahKarsaRoom.tsx - Chat interface → Demo state: reads and updates chat
src/components/chat/ChatModal.tsx - Demo state → State transitions: delegates transitions
src/context/DemoContext.tsx - Demo state → Browser storage: persists state
src/context/DemoContext.tsx - Chat interface → Chat stream hook: sends messages
src/components/chat/ChatModal.tsx - Chat stream hook → Chat API route: posts chat
src/hooks/useChatStream.ts - Chat API route → Rate limiter: checks limits
src/app/api/chat/route.ts - Chat API route → LLM streaming: requests stream
src/app/api/chat/route.ts - LLM streaming → Persona prompts: builds prompt
src/lib/llm.ts - LLM streaming → Google Gemini: streams response
src/lib/llm.ts