The lightweight PHP framework with file-based routing and elegant Flow syntax.
Powered by Fluxor Core
Full documentation available at: π https://lizzyman04.github.io/fluxor-php
The documentation includes:
- π Installation guide
- π― File-based routing (Next.js style)
- π Flow syntax reference
- π¨ Views and layouts
- π§ Controllers and middleware
- βοΈ Environment configuration
- π Complete API reference with helper functions
- π Interactive installation guide
# Create a new Fluxor project
composer create-project lizzyman04/fluxor-php my-app
# Navigate to the project
cd my-app
# Start the development server
composer devVisit http://localhost:8000
|
Routes defined by folder structure - like Next.js app/router/
βββ index.php # GET /
βββ api/
β βββ users.php # GET /api/users
β βββ users/[id].php # GET /api/users/123 |
Ultra-clean, chainable route definitions Flow::GET()->do(function($req) {
$id = $req->param('id');
return Response::json(['user' => $id]);
}); |
|
Template system with sections and layouts View::extend('layouts/main');
View::section('content');
<h1>Hello World</h1>
View::endSection(); |
Organize your application logic class UserController extends Controller
{
public function index() {
return Response::json(User::all());
}
} |
|
CSRF protection, sessions, request filtering Flow::use(function($req) {
if (!$req->isAuthenticated()) {
return redirect('/login');
}
}); |
Global helpers for common tasks $url = base_url('api/users');
$path = base_path('storage/logs');
$debug = env('APP_DEBUG', false);
abort(404, 'Not Found'); |
After installation, your project will contain:
my-app/
βββ app/
β βββ router/ # File-based routes
β βββ index.php # GET /
β βββ api/
β βββ users/ # REST API examples
βββ public/
β βββ index.php # Front controller
β βββ assets/ # Static assets
βββ src/
β βββ Views/ # View templates
β βββ layouts/
β βββ home.php
βββ storage/ # Logs, cache, sessions
βββ .env # Environment configuration
βββ composer.json # Project dependencies
<?php
// app/router/api/hello/index.php
use Fluxor\Flow;
use Fluxor\Response;
Flow::GET()->do(fn($req) =>
Response::success(['message' => 'Hello, ' . $req->input('name', 'World')])
);| Feature | Description |
|---|---|
| π― File-based Routing | Routes defined by folder structure - like Next.js |
| π Flow Syntax | Ultra-clean, chainable route definitions |
| π¨ View System | Layouts, sections, stacks, and partials |
| π§ Controllers | MVC architecture with base controller |
| π‘οΈ Security First | Built-in CSRF, XSS protection, secure sessions |
| π¦ Middleware | Flexible request filtering (global + per-route) |
| π Error Handling | Hierarchical error pages (404, 500, etc.) |
| π§ Zero Config | Auto-detects base path and URL |
| π Environment Support | Built-in .env file parser with type casting |
| π οΈ Utilities | Global helpers (env(), base_path(), abort(), etc.) |
| β‘ Performance | Boot under 10ms, memory footprint ~2MB |
| π¦ Zero Dependencies | Just pure PHP, no external packages |
- PHP 8.1 or higher
- Composer
- Web server (Apache/Nginx) or PHP built-in server
composer create-project lizzyman04/fluxor-php my-app
cd my-app
composer devMIT License - see LICENSE file for details.
- Inspired by Next.js file-based routing
- Built with simplicity and performance in mind
- Zero dependencies for maximum control
Fluxor - Build elegant PHP applications with joy! π