How revaldo007/gaming-portal works
Gaming Portal is a browser arcade with account sessions, playable games, profiles, score history, leaderboards, coins, and achievements. The main user flow is sign in or register, enter the portal, play a game, and submit its result; the backend records scores and awards coins and achievements, which the portal reads for profile and leaderboard views. The README and sampled files establish the frontend/API wiring and backend routes. Frontend game internals were not sampled, so game execution details are not expanded here.
Main entry points: main.py HTTP API · auth.py Account Routes · scores.py Scores & Awards · database.py DB Sessions
Components 19
Browser App
- App Router
Frontend/src/App.jsx - Sign In
Frontend/src/pages/AuthPage.jsx - Session State
Frontend/src/context/AuthContext.jsx - Arcade Portal
Frontend/src/GamingPortal.jsx - Lottie Player
Frontend/src/components/LottiePlayer.jsx - API Client
Frontend/src/api.js
API Surface
- HTTP API
Backend/main.py - Account Routes
Backend/routes/auth.py - Game Catalog
Backend/routes/games.py - Scores & Awards
Backend/routes/scores.py - Achievement Routes
Backend/routes/achievements.py - Profile Routes
Backend/routes/users.py
Backend Services
- Token & Passwords
Backend/auth.py - Auth Dependency
Backend/dependencies.py - Domain Models
Backend/models.py
Persistence
- DB Sessions
Backend/database.py - SQLite Database
- Avatar Uploads
Backend/uploads
Other components
- Player
Connections 37
- Player → App Router: uses
Frontend/src/App.jsx - App Router → Session State: provides session
Frontend/src/App.jsx - App Router → Sign In: shows signed out
Frontend/src/App.jsx - App Router → Arcade Portal: shows signed in
Frontend/src/App.jsx - Sign In → Session State: calls login/register
Frontend/src/pages/AuthPage.jsx - Sign In → Lottie Player: renders
Frontend/src/pages/AuthPage.jsx - Session State → API Client: calls
Frontend/src/context/AuthContext.jsx - Arcade Portal → API Client: fetches portal data
README.md - API Client → HTTP API: sends requests
README.md - HTTP API → Account Routes: registers router
Backend/main.py - HTTP API → Game Catalog: registers router
Backend/main.py - HTTP API → Scores & Awards: registers router
Backend/main.py - HTTP API → Achievement Routes: registers router
Backend/main.py - HTTP API → Profile Routes: registers router
Backend/main.py - HTTP API → DB Sessions: creates tables
Backend/main.py - Account Routes → Token & Passwords: hashes and signs
Backend/routes/auth.py - Account Routes → Auth Dependency: requires current user
Backend/routes/auth.py - Account Routes → DB Sessions: uses sessions
Backend/routes/auth.py - Account Routes → Domain Models: reads and writes
Backend/routes/auth.py - Auth Dependency → Token & Passwords: decodes token
Backend/dependencies.py - Auth Dependency → DB Sessions: loads user
Backend/dependencies.py - Auth Dependency → Domain Models: loads user model
Backend/dependencies.py - Scores & Awards → Auth Dependency: requires current user
Backend/routes/scores.py - Scores & Awards → DB Sessions: queries and commits
Backend/routes/scores.py - Scores & Awards → Domain Models: stores scores and awards
Backend/routes/scores.py - Scores & Awards → Game Catalog: reads game catalog
Backend/routes/scores.py - Achievement Routes → Auth Dependency: requires current user
Backend/routes/achievements.py - Achievement Routes → DB Sessions: queries records
Backend/routes/achievements.py - Achievement Routes → Domain Models: reads achievement models
Backend/routes/achievements.py - Profile Routes → DB Sessions: queries profile
Backend/routes/users.py - Profile Routes → Domain Models: reads user models
Backend/routes/users.py - DB Sessions → SQLite Database: persists data
Backend/database.py - Account Routes → Avatar Uploads: writes avatar
Backend/routes/auth.py - HTTP API → Avatar Uploads: serves uploads
Backend/main.py - Account Routes → HTTP API: broadcasts profile updates
Backend/routes/auth.py - Scores & Awards → HTTP API: broadcasts coin updates
Backend/routes/scores.py - Arcade Portal → Scores & Awards: submits game results
README.md