v0.2.0 · PHP 8.3+ · MIT

Welcome to Lunaris

A minimal, plain-PHP framework built from scratch. Action-based routing, PHP-native views, and zero magic — full control over your codebase.

Terminal
git clone <your-repo-url> lunaris && cd lunaris
composer install
php lunar key:generate
Philosophy
No magic, plain new
Architecture
Action-based, no controllers
Source
~33 readable files
Why Lunaris

Everything you need. Nothing you didn’t ask for.

Lunaris is small enough to read in a weekend and complete enough to ship a real application.

⚡

Action-based

Every route maps to a single action class with a tiny contract: middlewares() and main(). No controllers, no guessing.

🧠

No magic

No auto-wiring, no service discovery, no compiled templates. Plain new, static facades, and native PHP all the way down.

📄

Plain PHP views

An output-buffering engine with layouts, sections, partials and components — but the template is still just a PHP file.

🛡️

Secure by default

CSRF middleware, bcrypt hashing, AES-256-GCM encryption, hardened session cookies and validated hosts come built in.

🧩

Onion middlewares

Guard any action with an ordered middleware pipeline. Short-circuit requests, inspect the raw request, pass it on.

🖥️

First-class CLI

The lunar console boots env, config and logging — register your own commands in routes/console.php.

Request lifecycle

From request to response in eight steps

Understand the whole framework by following one request through the system.

Lifecycle
public/index.php
    └─> Bootstrap::configure()
        └─> Container::loadRoutes()
            └─> Route::dispatch()
                └─> Route::executeHandler()
                    └─> Middleware pipeline
                        └─> Action->main($params)
                            └─> Echoed to the client

Each phase is a short, readable class you can open and modify. Any Throwable thrown along the way is caught once, mapped to 404 / 403 / 500, and rendered through your configured error view.

Explore the architecture →
Coming soon

Atlas — the database engine for Lunaris

A lightweight PDO layer with raw SQL control, a fluent query builder (Probe), Active Record models (Planet), reusable query objects and DTO hydration (Capsule). Currently being rebuilt from scratch.

Raw SQL Probe query builder Planet models Capsule DTOs Transactions MySQL · PostgreSQL · SQLite Prepared statements JSON-ready results

Start building with Lunaris

Clone the repository, generate your app key, and render your first action in under two minutes.