How foxy4096/pingville-web works
Project type and purpose
• From the README and file tree, Pingville Web is a PHP‐based companion website for a game (“PingVille”).
• It handles user accounts, authentication (login/signup/logout), token management, achievements, and exposes HTTP APIs for the game client to sync positions and query user data.
File structure
• Top‐level PHP scripts (index.php, login.php, signup.php, games.php, etc.) serve HTML pages to the browser.
• The api/ directory contains REST‐style endpoints (login.php, sync_position.php, get_last_position.php, me.php) that the game client or AJAX calls from the frontend invoke.
• templates/ holds shared HTML snippets (e.g., footer.php).
• utils/ holds reusable backend logic (auth.php for authentication, users.php for user‐related database operations).
• db.php centralizes database connection logic; query.sql provides schema or seed data.
• api/tasks/remove_expired_tokens.php is likely intended as a cron‐style maintenance job for token cleanup.
• script.js and styles.css are the main frontend assets; pages reference these for client‐side behavior and styling.
README for additional insights
• The database is MySQL (or compatible) configured via an environment _secrets.php file.
Detail
• Database schema only if necessary (tables for users, tokens, achievements), but at minimum show “MySQL” and “Connections from PHP”.