| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/project-slim/ |
Upload File : |
# Slim 4 Boilerplate with OOP Structure ## Request Flow 1. Client sends request to `/public/index.php` 2. Slim routes request → e.g. `/api/v1/auth/login` 3. Controller delegates logic → `AuthController@login` 4. Controller calls `AuthService` 5. Service uses `UserRepository` to fetch user 6. Service formats result using `ApiResponse` 7. Controller returns JSON response to client ## Quickstart ```bash composer install cp .env.example .env php -S localhost:8080 -t public ``` ### Test ```bash curl -X POST http://localhost:8080/api/v1/auth/login -d "email=demo@example.com&password=secret" ``` project-slim/ ├── app/ ✅ Core application logic │ ├── Controllers/ ✅ Request handling │ ├── Services/ ✅ Business logic │ ├── Repositories/ ✅ Data access + Interfaces │ ├── Response/ ✅ Standardized responses │ └── Routes/ ✅ Route definitions ├── config/ ✅ Configuration ├── public/ ✅ Web entry point └── vendor/ ✅ Dependencies