The default application template for WebFiori Framework. Use this as a starting point to create new WebFiori projects.
- PHP >= 8.1
- Extensions:
json,mbstring,fileinfo,openssl - Composer
composer create-project webfiori/app my-site
cd my-site
php -S localhost:8080 -t publicThen open http://localhost:8080 in your browser.
βββ public/ # Web server document root
β βββ index.php # Application entry point
β βββ .htaccess # Apache rewrite rules
β βββ web.config # IIS rewrite rules
β βββ assets/ # Static files (CSS, JS, images)
βββ App/ # Application source code
β βββ Apis/ # REST API services
β βββ Commands/ # Custom CLI commands
β βββ Config/ # Configuration files (auto-generated)
β βββ Database/ # Migrations, seeders, tables
β βββ Domain/ # Domain entities
β βββ Health/ # Health check implementations
β βββ Ini/ # Initialization and route definitions
β βββ Langs/ # Internationalization files
β βββ Middleware/ # Custom middleware
β βββ Pages/ # Page controllers and views
β βββ Policies/ # ABAC policy classes
β βββ Storage/ # Sessions, logs, uploads (not web-accessible)
β βββ Tasks/ # Background jobs and scheduled tasks
βββ tests/ # PHPUnit tests
βββ composer.json
βββ webfiori # CLI entry point (Linux/macOS)
βββ webfiori.bat # CLI entry point (Windows)
By default, the framework uses App/ as the application root directory. To change this, edit the first parameter of App::initiate() in public/index.php:
App::initiate('MyApp', 'public', __DIR__);Reasons you might want to rename it:
- Gives your project a distinct identity instead of a generic
App/folder. - Avoids naming conflicts if you're integrating WebFiori into an existing project that already has an
App/directory. - Makes it easier to distinguish between multiple WebFiori-based projects in the same workspace.
composer testThis project uses PHP CS Fixer for code style enforcement.
composer cs-check # Check for violations (dry run)
composer cs-fix # Auto-fix violationsWebFiori includes a CLI tool for common tasks:
# Linux/macOS
php webfiori
# Windows
webfiori.batCommon commands:
php webfiori create:service # Create a new API service
php webfiori create:middleware # Create a new middleware
php webfiori create:migration # Create a database migration
php webfiori create:command # Create a custom CLI command
php webfiori migrations:run # Run pending migrations
php webfiori migrations:step # Interactively apply/skip migrations
php webfiori routes:cache # Build route cache for production
php webfiori services:list # List auto-discovered API services
php webfiori help # Show all available commandsFor information on how to contribute, see the contribution guide.
- For bugs and feature requests, open an issue.
- For security vulnerabilities, please email ibrahim@webfiori.com.
This project is licensed under the MIT License.