Skip to content

lizzyman04/fluxor-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fluxor Logo

Fluxor PHP Framework

The lightweight PHP framework with file-based routing and elegant Flow syntax.

Latest Stable Version Total Downloads License PHP Version Require

Powered by Fluxor Core Core Version Core Downloads

πŸ“š Documentation β€’ πŸ™ GitHub β€’ πŸ“¦ Packagist


πŸ“– Documentation

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

πŸš€ Quick Start

# 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 dev

Visit http://localhost:8000

✨ Features at a Glance

🎯 File-based Routing

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

πŸ’Ž Elegant Flow Syntax

Ultra-clean, chainable route definitions

Flow::GET()->do(function($req) {
    $id = $req->param('id');
    return Response::json(['user' => $id]);
});

🎨 Views & Layouts

Template system with sections and layouts

View::extend('layouts/main');
View::section('content');
    <h1>Hello World</h1>
View::endSection();

πŸ”§ Controllers

Organize your application logic

class UserController extends Controller
{
    public function index() {
        return Response::json(User::all());
    }
}

πŸ›‘οΈ Middleware & Security

CSRF protection, sessions, request filtering

Flow::use(function($req) {
    if (!$req->isAuthenticated()) {
        return redirect('/login');
    }
});

πŸ› οΈ Utilities & Helpers

Global helpers for common tasks

$url = base_url('api/users');
$path = base_path('storage/logs');
$debug = env('APP_DEBUG', false);
abort(404, 'Not Found');

πŸ“ Project Structure

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

πŸ’Ž Quick Example

<?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')])
);

🌟 Key Features

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

πŸ“Š Stats & Star History

Fluxor PHP (Skeleton) Fluxor Core (Engine)
GitHub Last Commit Packagist Stars Core Release Core Last Commit Core Downloads
Star History Chart

🚦 Requirements

  • PHP 8.1 or higher
  • Composer
  • Web server (Apache/Nginx) or PHP built-in server

πŸ“¦ Installation

composer create-project lizzyman04/fluxor-php my-app
cd my-app
composer dev

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • 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! πŸŽ‰

About

Fluxor PHP Framework - Skeleton for new applications with file-based routing.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages