Project SDF is a fast, robust, and modern project development framework designed for PHP enthusiasts. It is compact, easy to maintain, and extremely extendable.
- MVC Pattern: Clean separation of concerns.
- Spark ORM: Built-in QueryBuilder, Active Record, relationships (hasOne, hasMany, belongsTo, belongsToMany), pagination, timestamps, and soft deletes.
- Middleware Pipeline: PSR-15 inspired request filtering with CSRF, CORS, and Rate Limiting middleware.
- Authentication: SessionGuard and JwtGuard (HS256) with refresh token support and UserProvider.
- PSR-7 HTTP Messages: Immutable
Request,Response,Uri,Stream,UploadedFileimplementations with PSR-4 autoloading. - PSR-16 Cache: File, Redis, and Memcached drivers with tag support via a
static facade (
SDF\Cache\Cache). - PSR-3 Logger: LoggerAdapter bridging monolog/mixed loggers to structured
SDF\Log\interface. - PSR-14 Events: EventDispatcher with prioritized, stoppable listeners.
- Schema Builder: MySQL/SQLite Blueprint with foreign keys, timestamps, soft deletes.
- Localization: Dot-notation translator with pluralization via
SDF\Localization\Translator. - Mail: SMTP and Log mailers with Mailable fluent API (
SDF\Mail\). - Queues: Database and Redis queue drivers with Worker (
SDF\Queue\). - Storage: Local and S3 filesystem abstraction with
disk()switching (SDF\Storage\). - Encryption: AES-256-CBC with HMAC-SHA256 encrypt-then-MAC (
SDF\Encryption\Encrypter). - Validation: 19 built-in rules with custom rule support (
SDF\Validation\Validator). - Fast Routing: Route compilation and caching for O(1) static path matching.
- Config Loader: Supports
.phpand.jsonconfigs. Compiled to cache automatically. - Modern Fuse View Engine: Compiles to raw PHP with Blade-style
@extends/@section/@yield/@includeinheritance. - CLI Commands: Generators for Models, Controllers, Migrations, Tests,
Middleware, and more (
sdf/cli). - Swagger/OpenAPI: Automatic OpenAPI 3.0 spec generation from controller annotations.
- Composer Ready: PSR-4 autoloading via Composer with APCu optimization.
PHP: 8.2 or higher is required. The framework is tested up to PHP 8.5.
Performance: ~10,000 req/s on FrankenPHP 1.11 (Mac mini M1, full-stack
with Fuse view rendering). See wiki/app/tutorials/docker-frankenphp.md.
git clone https://github.com/devsimsek/project-sdf.git
cd project-sdf
composer installcomposer create-project devsimsek/project-sdfCopy .env.example to .env and configure your database:
cp .env.example .envConfigure the framework inside app/config/.
php sdf/cli db migrateUse the bundled CLI to generate components:
php sdf/cli g controller UserController
php sdf/cli g model User
php sdf/cli g test UserController --type=controller --namespace=App\\Controllers\\Userphp sdf/cli serve -p 8000
# Or with live-reload:
php sdf/cli serve -p 8000 --livevendor/bin/phpunit --testdoxFull documentation is available in the wiki/ directory.
- Core Components
- Spark ORM
- Fuse Template Engine
- Authentication
- Caching
- Validation
- Storage / Filesystem
- Schema Builder & Migrations
- Events (PSR-14)
- Localization
- Queues
- Timestamps & Soft Deletes
- Logging (PSR-3)
- Docker & FrankenPHP
Deploy with Docker Compose (FrankenPHP + MySQL 8.4 + Redis 7):
docker compose up -dSee wiki/app/tutorials/docker-frankenphp.md for detailed setup,
worker mode, and performance tuning.
vendor/bin/phpunit --testdox # 428 tests, 763 assertions
composer analyze # PHPStan level 5
composer cs:check # PHP-CS-Fixer PSR-12If you have any feedback or encounter issues, please open an issue within the repository.
Contributions are always welcome! Please follow PSR-12 coding standards and write tests for your components before opening a pull request.