marwa / framework
PSR-7, PSR-15 Modular PHP Micro Framework.
dev-main
2025-08-04 15:08 UTC
Requires
- php: >= 7.1
- ext-json: *
- aura/session: ^2.1
- doctrine/collections: ^2.2
- fakerphp/faker: ^1.19
- filp/whoops: ^2.15
- firebase/php-jwt: ^6.4
- guzzlehttp/guzzle: ^7.8
- hybridauth/hybridauth: ^3.3
- kint-php/kint: ^5.1
- laminas/laminas-diactoros: ^3.3
- laminas/laminas-httphandlerrunner: ^2.10
- league/container: ^4.2
- league/event: ^2.0
- league/flysystem: ^3.28
- league/route: ^5.1
- markrogoyski/simplelog-php: 2.*
- matthiasmullie/scrapbook: ^1.4
- memran/marwadb: dev-master
- nesbot/carbon: ^2.33
- nette/utils: ^4.0
- peppeocchi/php-cron-scheduler: ^4.0
- psy/psysh: @stable
- rakit/validation: ^1.2
- swiftmailer/swiftmailer: ^6.0
- symfony/console: ^6.4
- symfony/dotenv: ^7.1
- symfony/filesystem: ^7.3
- symfony/process: ^7.1
- symfony/translation: ^5.1
- twig/twig: ^3.0
Requires (Dev)
- phpstan/phpstan: ^0.12
- phpstan/phpstan-phpunit: ^0.12
- phpunit/phpunit: ^8
- squizlabs/php_codesniffer: 3.*
This package is auto-updated.
Last update: 2025-08-04 15:08:49 UTC
README
A lightweight, modular PHP micro-framework built for speed, scalability, and simplicity. It adheres to PSR standards and offers rich features like routing, ORM, CLI tools, authentication, mailing, and more — making it ideal for rapid API or web application development.
🚀 Features
- PSR-4 Autoloading & PSR-7 HTTP Message support
- Expressive Routing System
- MVC Pattern
- ORM with Relationships
- Authentication & Authorization
- Middleware Support
- Queue Job Handling
- Notification System (Email/SMS)
- Session & Cookie Management
- Templating with Smarty
- Built-in CLI (
marwa
)
📦 Requirements
- PHP >= 8.2
- Composer
- MySQL or supported database
- Optional: Redis (for cache/session/queue)
📥 Installation
git clone https://github.com/memran/marwa-framework.git
cd marwa-framework
composer install
Create .env
file:
cp .env.example .env
Update your environment variables for DB, mail, etc.
🔧 Running the App
Use PHP's built-in web server:
php -S localhost:8000 -t public
🧭 Example Route
// routes/web.php use Marwa\Application\Routing\Route; Route::get('/', function () { return 'Hello from Marwa!'; });
🎮 Using the CLI
The marwa
CLI allows code generation and system operations:
php marwa make:controller HomeController php marwa make:model Product php marwa migrate
📚 Folder Structure
.
├── public/ # Web root (index.php, assets)
├── routes/ # Route definitions
├── src/
│ └── Application/
│ ├── Controllers/ # Your app controllers
│ ├── Models/ # ORM models
│ ├── Views/ # Smarty templates
│ ├── Console/ # CLI command classes
│ ├── Services/ # Business logic services
│ └── ... # Other framework components
├── storage/ # Logs, sessions, cache
├── marwa # CLI entry point
├── .env # Environment variables
├── composer.json
🔐 Authentication Example
use Marwa\Application\Auth\Auth; if ( Auth::check() ) { $user = Auth::user(); }
📨 Notification Example
use Marwa\Application\Notification\Notify; Notify::to('user@example.com')->send('Welcome to Marwa Framework!');
🗄️ Model Example
namespace App\Models; use Marwa\Application\Models\Model; class User extends Model { protected $table = 'users'; }
Querying:
use App\Models\User; $users = User::all(); $user = User::find(1);
📜 License
Licensed under the MIT License
🤝 Contributing
We welcome contributions. Feel free to fork, make a pull request, or suggest features via GitHub issues.