How capstone-projects-2025-spring/project-acc-hungry-hippos works
Project Type & Purpose
This is a full-stack, web-based, real-time multiplayer game (“Hungry Hippos”) built with:
• Frontend: React + TypeScript + Phaser 3 for UI, game logic, physics
• Backend: a lightweight Node/TypeScript WebSocket server (in server-backend/main.tsx + sessionAPI.js)
• Static assets: served directly (images, audio under public/assets & public/audio)
• Accessibility Layer: AAC interface mapped to game controls
The result is a cross-platform browser game emphasizing inclusivity and AAC support.
File Structure Analysis
• Top-level “Hungry-Hippo-Game” folder contains:
– public/…: static assets (images, audio) and style.css
– server-backend/: WebSocket API server entrypoint
– src/: React + Phaser code
– src/game/: Phaser engine setup, scenes, event bus, hippo & strategy classes
– src/components, src/pages: reusable UI + page routes (Landing, RoleSelect, AAC, Phaser, Presenter, Leaderboard, etc.)
– src/contexts/WebSocketContext.tsx: encapsulates socket logic
– src/data: JSON fixtures (food lists, sessionIDs)
– router.tsx: SPA routing
– build configs: tsconfig, vite.config.*.mjs, vercel.json, vitest.config.ts
• Dev & CI: .devcontainer/, .github/workflows/, Dockerfile? (none), of which workflows handle spelling, build, deploy.
Key Architectural Patterns
• Component-based UI (React)
• Game engine layer (Phaser) isolated from React via PhaserGame.tsx wrapper
• Context API for global WebSocket and AAC event distribution
• Strategy pattern for Hippo movement (Jump, Walk, EdgeSlide)
• SPA routing + code-splitting per page
• Server-client real-time messaging (WebSocket) for session management & multiplayer sync
Main Components & Data Flows
[Frontend – Client Browser]
• React UI Layer: pages + components (buttons, leaderboards, AAC panel)
• Game Engine Layer: PhaserScene rendering physics, sprites, collisions
• AAC Input Layer: translates alternative communication inputs into game events
• WebSocket Client: sends events (join session, move requests, score updates) & listens for server broadcasts
• Static Asset Loader: fetches images/audio from public/assets & public/audio
[Backend – WebSocket Server]
• Session Manager (sessionAPI.js): maintains sessionID, broadcasting, round orchestration
• WebSocket Endpoints: handle client connect/disconnect, route messages between conductor & hippo players
[Optional External Services]
• Hosting & CI/CD: Vercel (frontend), GitHub Pages (docs), GitHub Actions for build & deploy
• Docs Site (Docusaurus under documentation/)
Essential Details to Capture
– SPA routing & page modules (Landing, RoleSelect, AACPanel, GameScene, Presenter)
– WebSocketContext as the glue for real-time events
– Public/assets & public/audio as static content providers
– Strategy pattern files under src/game/moveStrategy
– server-backend’s role in session orchestration