POLASH FF CLUB - Backend package
=================================
This package was prepared for the uploaded Sketchware Pro project:
App/package label: POLASH FF CLUB
Package name from upload metadata: com.polash.ff.club.user
Minimum backend: PHP 8.0+ (tested design target PHP 8.2), MySQL 5.7+/MariaDB 10.3+.

IMPORTANT SOURCE LIMITATION
The uploaded .swb contains encrypted Sketchware project data. The readable metadata confirms the package and INTERNET permission, but does not expose the Activity names, view IDs, Java request code, or actual screen list. Therefore this is a coherent tournament backend matching the app identity and typical tournament features, not a verified one-to-one mapping to every screen inside the SWB. Do not assume undocumented UI fields.

INSTALL
1. Create a MySQL database and user in cPanel; grant the user ALL PRIVILEGES.
2. Open phpMyAdmin, select that database, import database.sql.
3. Upload config.php and api/ folder into public_html/polash_api/ (or another folder).
4. Edit config.php with database host/name/user/password.
5. Visit https://YOUR-DOMAIN/polash_api/api/index.php?action=health
6. Register your own account, then promote it to admin in phpMyAdmin:
   UPDATE polash_users SET role='admin' WHERE email='YOUR_EMAIL';

BASE URL
https://YOUR-DOMAIN/polash_api/api/index.php?action=

ENDPOINTS
GET  health
POST register                 username,email,mobile(optional),password
POST login                    email,password
POST logout                   Authorization: Bearer TOKEN
GET  profile                  Authorization: Bearer TOKEN
POST update_profile           username,mobile,avatar(optional), Bearer TOKEN
GET  matches                  ?status=upcoming|live|completed|cancelled|all
GET  match_details            ?match_id=ID
POST join_match               match_id, Bearer TOKEN
GET  my_matches               Bearer TOKEN
GET  leaderboard
GET  point_history            Bearer TOKEN
POST admin_create_match       title,mode,start_time; optional map_name,team_size,entry_points,prize_points,max_players,rules
POST admin_update_match       match_id,status
GET  match_players            ?match_id=ID (admin)
POST admin_set_result         match_id,user_id,rank,reward_points (admin)

AUTH
For protected endpoints send HTTP header:
Authorization: Bearer TOKEN
POST body may be JSON or form-data/x-www-form-urlencoded.

Sketchware connection note:
Use Web component / HttpURLConnection to call the base URL. Parse JSON keys success, message, data. The exact Sketchware component IDs and parameter names in the SWB could not be extracted from the encrypted project payload, so map these endpoints to your actual existing screen IDs in Sketchware.

This starter uses virtual tournament points only. It does not implement deposits, withdrawals, cash wallets, or real-money payment processing.
Use HTTPS and keep config.php private. Never put database passwords in the Android APK.
