How kaemiii-ss/smaran works
Smaran is a memory-care companion combining patient and caregiver experiences, an AI chat service, routines, and cognitive games. The evidenced game workflow covers launching a game, generating or playing a round, and tracking completion; backend examples show authenticated requests reaching chat or routine handlers and persisting results. The tree also indicates broader care, account, and game capabilities. Several frontend and backend subsystems were not sampled, so those are represented conservatively without asserted call relationships.
Main entry points: App.jsx Recall game app · routes API routes · useRhythmGame.jsx Rhythm gameplay · ColorNumberMatchGame.jsx Color number match
Components 34
Care Platform
- Care frontend
frontend/src - Care dashboards
frontend/src/pages - Games catalog
frontend/src/pages/GamesCatalog.jsx
Backend Services
- API routes
backend/src/routes - Authentication
backend/src/controllers/auth.controller.js - User records
backend/src/models/user.model.js - Caregiver links
backend/src/models/patientCaregiver.model.js - Routine handlers
backend/src/controllers/routine.controller.js - Routine records
backend/src/models/routine.model.js - Chat handlers
backend/src/controllers/gemini.controller.js - Chat sessions
backend/src/models/chatbotSession.model.js - Gemini service
backend/src/gemini/gemini.service.js - Other care APIs
backend/src/controllers
Cognitive Games
- Recall game app
frontend/src/game_5/src/App.jsx - Card board
frontend/src/game_5/src/components/GameBoard.jsx - Game shell
frontend/src/game_5/src/components/GameShell.jsx - Game feedback
frontend/src/game_5/src/components/FeedbackOverlay.jsx - Win celebration
frontend/src/game_5/src/components/ConfettiCanvas.jsx - Bubble game app
Games/bubble_digits_game/src/App.jsx - Color number match
Games/bubble_digits_game/src/components/games/ColorNumberMatchGame.jsx - Rhythm gameplay
Games/follow_the_rhythm/src/hooks/useRhythmGame.jsx - Name game
frontend/src/name_game/App.jsx
Game Mechanics
- Level definitions
frontend/src/game_5/src/config/levels.js - Pair deck engine
frontend/src/game_5/src/hooks/usePairsEngine.js - Progress tracker
frontend/src/game_5/src/hooks/useTracker.js - Audio engine
Games/bubble_digits_game/src/lib/audioEngine.js - Cognitive engine
Games/bubble_digits_game/src/lib/cognitiveEngine.js - Voice engine
Games/bubble_digits_game/src/lib/voiceEngine.js - Rhythm audio
Games/follow_the_rhythm/src/hooks/useAudioEngine.jsx - Rhythm voice
Games/follow_the_rhythm/src/hooks/useVoiceFeedback.jsx - Rhythm nodes
Games/follow_the_rhythm/src/lib/nodes.js - Language context
Games/follow_the_rhythm/src/lib/LanguageContext.jsx
Other components
- Patient or caregiver
- Gemini AI
Connections 29
- Patient or caregiver → Care frontend: uses
- Care frontend → Care dashboards: offers
- Care frontend → Games catalog: offers
- API routes → Authentication: routes auth
- Authentication → User records: reads and writes
backend/src/controllers/auth.controller.js - Authentication → Caregiver links: creates link
backend/src/controllers/auth.controller.js - API routes → Routine handlers: routes routines
backend/src/routes/routine.routes.js - Routine handlers → Routine records: reads and writes
backend/src/controllers/routine.controller.js - API routes → Chat handlers: routes chat
backend/src/routes/gemini.routes.js - Chat handlers → Chat sessions: reads and writes
backend/src/controllers/gemini.controller.js - Chat handlers → Gemini service: requests reply
backend/src/controllers/gemini.controller.js - Gemini service → Gemini AI: generates reply
backend/src/gemini/gemini.service.js - API routes → Other care APIs: routes other APIs
backend/src/routes/routine.routes.js - Recall game app → Pair deck engine: builds deck
frontend/src/game_5/src/App.jsx - Pair deck engine → Level definitions: reads levels
frontend/src/game_5/src/hooks/usePairsEngine.js - Recall game app → Card board: renders board
frontend/src/game_5/src/App.jsx - Recall game app → Game shell: renders in shell
frontend/src/game_5/src/App.jsx - Recall game app → Progress tracker: tracks play
frontend/src/game_5/src/App.jsx - Recall game app → Game feedback: shows feedback
frontend/src/game_5/src/App.jsx - Recall game app → Win celebration: shows celebration
frontend/src/game_5/src/App.jsx - Bubble game app → Color number match: launches game
Games/bubble_digits_game/src/App.jsx - Color number match → Audio engine: uses audio
- Color number match → Cognitive engine: uses cognition
- Color number match → Voice engine: uses voice
- Rhythm gameplay → Rhythm audio: plays tones
Games/follow_the_rhythm/src/hooks/useRhythmGame.jsx - Rhythm gameplay → Rhythm voice: speaks prompts
Games/follow_the_rhythm/src/hooks/useRhythmGame.jsx - Rhythm gameplay → Rhythm nodes: selects nodes
Games/follow_the_rhythm/src/hooks/useRhythmGame.jsx - Rhythm gameplay → Language context: reads language
Games/follow_the_rhythm/src/hooks/useRhythmGame.jsx - Name game → Care frontend: embedded in platform
frontend/src/name_game/App.jsx