How wealthts/paygame works
This repository contains a Flutter client shell and an Express/MySQL backend for a game-top-up service. The visible backend workflow is: a user registers or logs in, browses games and packages, creates an order, and accesses payment, points, or receipt endpoints; administrators can manage games and complete orders. The Flutter application’s Dart feature code is absent from the supplied tree, so its screens and API calls cannot be mapped. Backend route relationships are shown where the server mounts them; route-to-database links are supported by the source index and sampled route code.
Main entry points: server.js Express API · db_config.js MySQL connection · games.js Game management · orders.js Order lifecycle
Components 13
API entry and auth
- Express API
backend/server.js - Registration and login
backend/routes/auth.js - JWT authorization
backend/middleware/auth.js - User endpoints
backend/routes/users.js
Game catalog
- Game management
backend/routes/games.js - Package endpoints
backend/routes/packages.js
Orders and fulfillment
- Order lifecycle
backend/routes/orders.js - Payment endpoints
backend/routes/payments.js - Points endpoints
backend/routes/points.js - Receipt endpoints
backend/routes/receipts.js
Persistence
- MySQL connection
backend/db_config.js - Paygame database
Other components
- API user
Connections 20
- API user → Express API: sends API requests
- Express API → Registration and login: mounts routes
backend/server.js - Express API → Game management: mounts routes
backend/server.js - Express API → Order lifecycle: mounts routes
backend/server.js - Express API → Package endpoints: mounts routes
backend/server.js - Express API → Payment endpoints: mounts routes
backend/server.js - Express API → Points endpoints: mounts routes
backend/server.js - Express API → Receipt endpoints: mounts routes
backend/server.js - Express API → User endpoints: mounts routes
backend/server.js - Registration and login → MySQL connection: queries users
backend/routes/auth.js - Game management → JWT authorization: checks admin access
backend/routes/games.js - Order lifecycle → JWT authorization: checks access
backend/routes/orders.js - Game management → MySQL connection: queries games
backend/routes/games.js - Order lifecycle → MySQL connection: reads and writes orders
backend/routes/orders.js - Package endpoints → MySQL connection: queries packages
backend/routes/packages.js - Payment endpoints → MySQL connection: queries payment data
backend/routes/payments.js - Points endpoints → MySQL connection: queries points data
backend/routes/points.js - Receipt endpoints → MySQL connection: queries receipts
backend/routes/receipts.js - User endpoints → MySQL connection: queries users
backend/routes/users.js - MySQL connection → Paygame database: connects to
backend/db_config.js