How giahuy910/aura-farm-battle works
Aura Farm Battle is a browser game for registering, claiming giftcodes, collecting gacha items, and challenging friends in turn-based matches. Its client separates authenticated pages and account state, REST API access, room/battle interaction, and battle presentation. The README documents a Haskell/Servant backend and MongoDB, but no server source is in the supplied tree; those are shown as external dependencies. Some client-page wiring is unsampled, so those links are marked unverified rather than asserted as inspected.
Main entry points: BattleScreen.tsx Battle screen · page.tsx Gacha and history · AuthProvider.tsx Auth provider · useRoomSocket.tsx Room socket state
Components 27
Game pages
- Authenticated shell
client/app/(authenticated)/layout.tsx - Game home
client/app/(authenticated)/page.tsx - Gacha and history
client/app/(authenticated)/gacha/page.tsx - Room listing
client/app/(authenticated)/rooms/page.tsx - Room match page
client/app/(authenticated)/rooms/[id]/page.tsx - User inventory
client/app/(authenticated)/user/page.tsx
Account state
- Auth provider
client/contexts/auth/AuthProvider.tsx - Auth context
client/contexts/auth/AuthContext.tsx - Login and registration
client/components/LogIn.tsx - Settings and giftcodes
client/components/SettingManager.tsx
REST access
- Authentication API
client/api/auth.ts - Giftcode API
client/api/giftcode.ts - Gacha API
client/api/pool.ts - Gacha history API
client/api/gachaHistory.ts - Room API
client/api/rooms.ts - User API
client/api/user.ts
Rooms and battle
- Room socket state
client/websocket/useRoomSocket.tsx - Battle protocol types
client/websocket/battleTypes.ts
Battle presentation
- Battle screen
client/components/battle/BattleScreen.tsx - Effect playback
client/components/battle/EffectOverlay.tsx - Effect sprites
client/components/battle/SpriteEffect.tsx - Battle assets
client/components/battle/battleAssets.ts - Reward selection
client/components/battle/RewardPannel.tsx - Match results
client/components/battle/ResultScreen.tsx
Other components
- Player
- Game backend
- MongoDB
Connections 25
- Player → Authenticated shell: uses
README.md - Authenticated shell → Game home: opens
- Player → Login and registration: registers
- Login and registration → Auth provider: authenticates through
- Auth provider → Authentication API: calls
client/contexts/auth/AuthProvider.tsx - Auth provider → Auth context: provides
client/contexts/auth/AuthProvider.tsx - Player → Settings and giftcodes: claims code
- Settings and giftcodes → Giftcode API: redeems through
- Player → Gacha and history: opens
README.md - Gacha and history → Gacha API: loads pools
- Gacha and history → Gacha history API: loads history
- Player → Room listing: finds matches
- Room listing → Room API: uses
- Room match page → Room socket state: uses
- Room socket state → Battle protocol types: uses types
client/websocket/useRoomSocket.tsx - Room socket state → Game backend: exchanges room events
- Room match page → Battle screen: presents match
- Battle screen → Effect playback: shows round effects
- Effect playback → Effect sprites: renders
client/components/battle/EffectOverlay.tsx - Effect playback → Battle assets: uses
client/components/battle/EffectOverlay.tsx - Battle screen → Reward selection: shows rewards
- Battle screen → Match results: shows outcome
- Player → User inventory: manages inventory
- User inventory → User API: loads account data
- Game backend → MongoDB: persists game data