Getting Started

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, $_FILES and $_SESSION directly. Nothing stands between your code and the language.
  • Nothing enforced but a tiny contract. An action only has to provide middlewares() and main(). Beyond that, structure your application however you like.
In one sentence

Lunaris gives you routing, requests, responses, views, sessions, security, logging and a console — and then gets out of your way.

Requirements

RequirementDetails
PHP 8.3+The code uses enums, match expressions and anonymous classes; enforced by "php": ">=8.3" in composer.json.
ComposerAutoloading (System\ → system/, App\ → app/) and dependencies.
Web serverApache with mod_rewrite, or any server that can rewrite everything to public/index.php.
OptionalDocker / Podman for the containerized environment.

The framework at a glance

ConcernWhere it lives
HTTP routesroutes/web.php
Actions (no controllers)app/Actions/
Custom middlewaresapp/Middlewares/
Configurationconfig/vars.php + .env
Viewsviews/ — plain PHP
Console commandsroutes/console.php
The framework itselfsystem/ (namespace System\)
Logsstorage/logs/YYYY-MM-DD.log

Where to go next

PageYou’ll learn
InstallationClone, install, generate your app key, run with Docker.
ArchitectureThe directory structure and the full request lifecycle.
RoutingMap URIs to actions, name routes, generate URLs.
Actions & ResponsesThe action contract, request input, and building responses.
ViewsLayouts, sections, partials and components in plain PHP.
Support & ExampleA complete end-to-end feature and the known quirks.

Part of the Lunaris documentation · Source on Codeberg · MIT License