Introduction
Lunaris is a minimal, plain-PHP web framework built from scratch — an action-based alternative to traditional MVC that keeps every line of your application within reach.
What is Lunaris?
Lunaris ditches the traditional MVC/controller layout in favour of an action-based approach: every route maps directly to an individual action class which is responsible for receiving the request, passing it through middlewares, and returning a response.
The framework ships no frontend build tools and no template language — views are
plain PHP files rendered with an output-buffering engine that supports layouts,
sections, partials and components. The entire framework lives in
system/ at roughly 33 files, every one of them short
enough to read in one sitting.
Philosophy: full control over your codebase
Lunaris is built around a simple idea — the developer should have full control. That means:
- No magic. No dependency-injection auto-wiring, no hidden service discovery, no compiled template layers. Everything is plain
new, static facades, and PHP-native views/sessions. - Small, readable source. Understand, modify or replace any part of the framework — because you can actually finish reading it.
- Direct PHP. Actions read
$_POST,$_GET,$_FILESand$_SESSIONdirectly. Nothing stands between your code and the language. - Nothing enforced but a tiny contract. An action only has to provide
middlewares()andmain(). Beyond that, structure your application however you like.
Lunaris gives you routing, requests, responses, views, sessions, security, logging and a console — and then gets out of your way.
Requirements
| Requirement | Details |
|---|---|
| PHP 8.3+ | The code uses enums, match expressions and anonymous classes; enforced by "php": ">=8.3" in composer.json. |
| Composer | Autoloading (System\ → system/, App\ → app/) and dependencies. |
| Web server | Apache with mod_rewrite, or any server that can rewrite everything to public/index.php. |
| Optional | Docker / Podman for the containerized environment. |
The framework at a glance
| Concern | Where it lives |
|---|---|
| HTTP routes | routes/web.php |
| Actions (no controllers) | app/Actions/ |
| Custom middlewares | app/Middlewares/ |
| Configuration | config/vars.php + .env |
| Views | views/ — plain PHP |
| Console commands | routes/console.php |
| The framework itself | system/ (namespace System\) |
| Logs | storage/logs/YYYY-MM-DD.log |
Where to go next
| Page | You’ll learn |
|---|---|
| Installation | Clone, install, generate your app key, run with Docker. |
| Architecture | The directory structure and the full request lifecycle. |
| Routing | Map URIs to actions, name routes, generate URLs. |
| Actions & Responses | The action contract, request input, and building responses. |
| Views | Layouts, sections, partials and components in plain PHP. |
| Support & Example | A complete end-to-end feature and the known quirks. |
Part of the Lunaris documentation · Source on Codeberg · MIT License