Get started in 5 minutes!
composer require bitshost/php-crud-api-generatorcopy vendor\bitshost\php-crud-api-generator\public\index.php index.php
copy vendor\bitshost\php-crud-api-generator\dashboard.html dashboard.html
copy vendor\bitshost\php-crud-api-generator\health.php health.phpChange config paths to point to vendor:
// Change this:
$dbConfig = require __DIR__ . '/config/db.php';
$apiConfig = require __DIR__ . '/config/api.php';
// To this:
$dbConfig = require __DIR__ . '/vendor/bitshost/php-crud-api-generator/config/db.php';
$apiConfig = require __DIR__ . '/vendor/bitshost/php-crud-api-generator/config/api.php';notepad vendor\bitshost\php-crud-api-generator\config\db.php
notepad vendor\bitshost\php-crud-api-generator\config\api.phpdb.php:
return [
'host' => 'localhost',
'dbname' => 'your_database',
'user' => 'root',
'pass' => '',
'charset' => 'utf8mb4'
];api.php - Generate JWT secret:
php -r "echo bin2hex(random_bytes(32));"Paste result into api.php:
'jwt_secret' => 'YOUR_64_CHAR_SECRET_HERE',php -S localhost:8000# Login
curl -X POST -d "username=admin&password=password123" http://localhost:8000/?action=login
# View dashboard
http://localhost:8000/dashboard.html3 files copied:
- index.php (2 lines modified)
- dashboard.html (0 modifications)
- health.php (0 modifications)
2 files edited:
- vendor/.../config/db.php
- vendor/.../config/api.php
Total code changes: 2 lines! 🎉
That's it! Your API is ready. All configs stay in vendor directory - clean and simple!