README: update project structure and self-hosting steps for setup.php

This commit is contained in:
danny 2026-06-14 14:43:30 +02:00
parent 09d601e303
commit 7b638d4afb

View file

@ -66,16 +66,18 @@ No frontend framework, no build step — everything runs directly in the browser
```
guessTheLiar/
├── index.html # Entire frontend (lobby, player view, host view)
├── api.php # REST API for all game actions
├── auth.php # Login, session management, PIN handling
├── migrate.php # Automatic DB migration system (V1–V8)
├── login.php # Login page
├── profile.php # Player profile & lifetime statistics
├── admin.php # Admin panel (user management)
├── config.php # DB credentials (not in repo — see setup below)
├── schema.sql # Initial DB schema reference
└── identity/ # Logo & favicon (PNG + PSD)
├── index.html # Entire frontend (lobby, player view, host view)
├── api.php # REST API for all game actions
├── auth.php # Login, session management, PIN handling
├── migrate.php # Automatic DB migration system (V1–V8)
├── setup.php # One-time admin setup (self-deletes after use)
├── login.php # Login page
├── profile.php # Player profile & lifetime statistics
├── admin.php # Admin panel (user management)
├── config.php # DB credentials — not in repo, copy from below
├── config.example.php # Credential template (safe to commit)
├── schema.sql # Initial DB schema reference
└── identity/ # Logo & favicon (PNG + PSD)
```
---
@ -129,29 +131,35 @@ All actions go through `api.php?action=<name>` (GET or POST with a JSON body).
**Requirements:** PHP 8.1+, MySQL 8+, web server (Apache or Nginx)
**1. Clone the repo**
```bash
git clone https://github.com/<your-username>/guessTheLiar.git
git clone https://github.com/daniediekert-blip/guessTheLiar.git
cd guessTheLiar
```
Create `config.php`:
```php
<?php
return [
'host' => 'localhost',
'dbname' => 'your_database',
'user' => 'your_db_user',
'pass' => 'your_db_password',
'charset' => 'utf8mb4',
];
```
Create the database:
**2. Create the database**
```sql
CREATE DATABASE your_database CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
```
All tables are created automatically by the migration system on the first page load.
**3. Create `config.php`** (copy from the template)
```bash
cp config.example.php config.php
```
Then fill in your credentials — `config.php` is in `.gitignore` and will never be committed.
**4. Run the setup wizard**
Open `https://yourdomain.com/setup.php` in your browser. Enter a username and password for the admin account and submit the form.
The setup wizard will:
- Run all database migrations automatically (creates every table)
- Create the admin account
- **Delete itself** — `setup.php` is removed from the server automatically on success
If auto-delete fails due to file system permissions, remove `setup.php` manually.
**5. Done** — open `index.html` and start playing.
---