Falt Leap Framework

20
Files
~3,200
Lines
0
Dependencies
iterate forever 1 Design Schema Your data, your rules. PostgreSQL does the rest. 2 Generate Models One command. Zero typing. Your ORM writes itself. 3 Build & Ship Controllers, views, routes. Features in minutes. 4 Evolve Change schema. Regenerate. Done.

Zero Dependencies

No Composer. No vendor folder. No supply-chain anxiety. Every line of code is yours to read, understand, and trust.

PostgreSQL-First

Built exclusively for PostgreSQL. Schema introspection, Active Record ORM, and auto-generated models straight from your database.

Modern PHP 8+

Strict types, named arguments, match expressions — clean, modern PHP without legacy baggage or abstraction soup.

Everything you need. Nothing you don't.

A complete MVC framework in ~3,200 lines. Every feature is built-in, battle-tested, and dependency-free.

Routing & HTTP

Expressive Routing

Map URLs to Controller@method with a clean array syntax. No YAML, no annotations.

Dynamic Parameters

Capture URL segments with {param} patterns, auto-injected as method arguments.

HTTP Method Routing

Nest GET, POST, PUT, PATCH, DELETE handlers under the same URL. Automatic 405 responses.

Middleware Pipeline

Stack auth, roles, and custom middleware on routes or entire controllers. Chainable and composable.

Request Abstraction

Unified access to POST, GET, JSON body, headers, and method detection in one clean object.

Session Management

Simple set/get/destroy API with built-in flash message support and auth user helpers.

Database & ORM

PostgreSQL-Native

Purpose-built for PostgreSQL. Schema support, information_schema introspection, and PDO prepared statements.

Active Record ORM

Models are table rows. Find, modify, save, delete — with zero configuration and auto-detected primary keys.

Fluent Query Builder

Chain where(), join(), orderBy(), limit(), groupBy(), having() — returns hydrated model instances.

Model Joins

Join models with INNER, LEFT, or RIGHT joins. Columns auto-prefixed, nested objects hydrated automatically.

Aggregation Functions

Built-in Count, Sum, Avg, Max, Min — all parameterized and SQL-injection safe.

Auto Model Generation

Run php gen.php all to generate models from your schema. Type-mapped, annotated, ready to use.

Views & Templating

Layout Inheritance

Master layout with {{content}} placeholder. Render wrapped or standalone with one method call.

Auto XSS Protection

All view data auto-escaped via htmlspecialchars. Use rawData only when you explicitly need unescaped HTML.

Flash Messages

One-time session messages rendered automatically via placeholder. Show once, then gone.

JSON Responses

Return JSON from any controller with renderJson(). Perfect for building APIs alongside your views.

Safe Iteration

Foreach over view data safely. Each item auto-wrapped with XSS protection. Works with empty checks and null coalescing.

Pure PHP Templates

No custom syntax to learn. Templates are .leap.php files with native PHP. Your IDE just works.

Architecture & DX

Dependency Injection

Controllers auto-receive db, request, session, and view via constructor. No service containers needed.

PSR-4 Autoloading

Custom autoloader maps namespaces to directories. No Composer, yet fully organized by namespace.

Rich Debug Mode

Interactive error pages with stack traces, source code, request data, and a live debug console.

Debug Console

Execute PHP in context of the error. Inspect variables, test fixes, iterate fast — right in the browser.

Error Logging

Exceptions logged to storage/logs/error.log with full context. Syntax errors caught and highlighted.

Environment Config

.env file support for database credentials and app settings. No framework-specific config formats.

Real-time & Infrastructure

WebSocket Server

Built-in RFC 6455 WebSocket server. Real-time features without any external dependencies or services.

Docker Ready

Alpine + nginx + PHP-FPM container included. One command to spin up a full development environment.

Web Installer

Hit the URL, fill in database credentials, and the framework bootstraps itself. Models auto-generated on setup.

Session Auth

Built-in authentication with login, logout, user ID helpers, and middleware guards for protected routes.

Lightweight & Fast

~20 files, ~3,200 lines. Boots in milliseconds. No abstraction layers to wade through.

Strict Types

declare(strict_types=1) everywhere. Type safety baked in from day one. Catch bugs at compile time.

30+
Features
12
Core Classes
0
Dependencies
1
Command to Start

See how simple it is

Routes map to controllers. Controllers talk to models. That's it.

Routing
// conf/router.config.php — the entire routing file
$routes = [
    "/"               => "HomeController@welcome",
    "/users"          => ["UsersController@index", "auth"],
    "/users/edit/{id}" => [
        "GET"  => ["UsersController@edit",   "auth"],
        "POST" => ["UsersController@update", "auth"],
    ],
];
Controller
// app/UsersController.php — a complete controller
class UsersController extends LeapController
{
    public function index()
    {
        $this->view->data = Users::Query()->get();
        $this->view->render('users/index');
    }

    public function edit($id)
    {
        $user = Users::Query()->where("id = :id", [":id" => $id])->first();
        $this->view->data = $user;
        $this->view->render('users/edit');
    }
}
Active Record
// Find, modify, save — that's the whole ORM
$user = Users::Query()->where("username = :u", [":u" => "admin"])->first();
$user->name = "New Name";
$user->save();

// Create a new record
$user = new Users();
$user->loadFromRequest($this->request);
$user->save();

// Delete
Users::delete($id);
Views
<!-- views/users/index.leap.php — auto-escaped by default -->
<table class="table">
  <?php foreach ($this->data as $user) : ?>
    <tr>
      <td><?= $user->username ?></td>
      <td><?= $user->name ?></td>
      <td><a href="/users/edit/<?= $user->id ?>">Edit</a></td>
    </tr>
  <?php endforeach; ?>
</table>
Model Generation
# Models are generated from your database. Not hand-written.
$ php gen.php all

Generated: Users.model.php
Generated: Orders.model.php
Generated: Products.model.php

# Schema changes? Regenerate. Done.
$ php gen.php users