A REST-style backend API implementation of the card game Xeri, built using PHP and MySQL.
This project simulates a multiplayer environment using HTTP requests via curl and manages full game state, authentication, scoring logic, and database persistence.
It was developed as a backend engineering project to demonstrate clean architecture, state management, and REST API design principles.
- Player creation
- Player join
- Token-based authentication
- Game creation & joining
- Turn-based move validation
- Game state tracking
- Score calculation engine
- MySQL database persistence
- Structured JSON API responses
- Modular folder architecture
The project follows a modular backend structure with separation of concerns:
- auth/ → Authentication endpoints
- players/ → Player management
- games/ → Game lifecycle & actions
- logic/ → Score calculation engine
- helpers/ → Utility & response helpers
- config/ → Environment configuration
- database.php → PDO database connection
- xeri.sql → Database schema
- Separation of business logic from routing
- Stateless HTTP communication
- Token-based session validation
- Persistent multiplayer state via database
- Clean response formatting (JSON)
- Player records
- Authentication tokens
- Active games
- Game state
- Move tracking
- Score tracking
git clone https://github.com/YOUR_USERNAME/xeri_api.git