How dhinesh-dhinesh/hamster-calci-client works
Hamster Calci is a Telegram mini-app for tracking Hamster Kombat card levels and comparing their profit per hour, price, and return on investment. Users enter or update card levels, then review ranked cards and statistics; card values are estimated with exponential growth calculations. The main flow spans routed screens, card data state, calculation helpers, and Firestore persistence, with Firebase Analytics providing event and screen tracking. The README also describes Telegram integration. Some provider wiring and the statistics implementation were not excerpted, so their internal links are not inferred.
Main entry points: cardDrawerContext.tsx Level Drawer · App.tsx Route Shell · topCards.tsx Top Cards · cardDataContext.tsx Card Data Context
Components 17
App Screens
- Route Shell
src/App.tsx - Enter Levels
src/pages/enterData.tsx - Top Cards
src/pages/topCards.tsx - Statistics
src/pages/stats.tsx
Card Analysis
- Card View
src/components/card.tsx - Card Catalog
src/data/cardData.ts - Card Valuation
src/util/combineCards.ts - Number Formatting
src/util/numberFormat.ts - Category Cleanup
src/util/cleanString.ts
User And Card State
- User Context
src/components/userDataContext.tsx - Card Data Context
src/components/cardDataContext.tsx - Level Drawer
src/components/cardDrawerContext.tsx
Firebase Services
- Card Persistence
src/util/FirestoreService.ts - Firebase Setup
src/firebase.ts - Cloud Firestore
- Firebase Analytics
Other components
- Telegram Player
Connections 31
- Telegram Player → Route Shell: uses
README.md - Route Shell → Enter Levels: routes to
src/App.tsx - Route Shell → Top Cards: routes to
src/App.tsx - Route Shell → Statistics: routes to
src/App.tsx - Route Shell → User Context: reads user
src/App.tsx - Route Shell → Firebase Analytics: logs screens
src/App.tsx - Enter Levels → Card Catalog: uses catalog
src/pages/enterData.tsx - Enter Levels → Card Valuation: combines cards
src/pages/enterData.tsx - Enter Levels → Card Data Context: reads card state
src/pages/enterData.tsx - Enter Levels → Level Drawer: opens drawer
src/pages/enterData.tsx - Top Cards → Card Data Context: reads card state
src/pages/topCards.tsx - Top Cards → Card Catalog: uses catalog
src/pages/topCards.tsx - Top Cards → Card Valuation: combines and ranks
src/pages/topCards.tsx - Top Cards → Level Drawer: opens drawer
src/pages/topCards.tsx - Top Cards → Card View: renders cards
src/pages/topCards.tsx - Statistics → Card Data Context: reads card state
src/pages/stats.tsx - Statistics → Card Catalog: uses catalog
src/pages/stats.tsx - Statistics → Card Valuation: combines cards
src/pages/stats.tsx - Statistics → Number Formatting: formats values
src/pages/stats.tsx - Card Valuation → Card Catalog: uses card values
src/util/combineCards.ts - Card Data Context → User Context: reads user
src/components/cardDataContext.tsx - Card Data Context → Card Persistence: fetches card data
src/components/cardDataContext.tsx - Level Drawer → Card Data Context: updates local data
src/components/cardDrawerContext.tsx - Level Drawer → User Context: reads user
src/components/cardDrawerContext.tsx - Level Drawer → Card Persistence: updates card
src/components/cardDrawerContext.tsx - Level Drawer → Category Cleanup: cleans category
src/components/cardDrawerContext.tsx - Level Drawer → Number Formatting: formats values
src/components/cardDrawerContext.tsx - Card Persistence → Firebase Setup: uses database config
src/util/FirestoreService.ts - Firebase Setup → Cloud Firestore: initializes
src/firebase.ts - Firebase Setup → Firebase Analytics: initializes
src/firebase.ts - Telegram Player → Firebase Setup: Telegram identity integration
README.md