Search by

lekoala / kaly

lekoala

A small modular PSR HTTP framework with convention-based routing and first-class dependency injection

Package info

github.com/lekoala/kaly

pkg:composer/lekoala/kaly

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

dev-master 2026-09-28 06:06 UTC

This package is auto-updated.

Last update: 2026-09-28 06:19:13 UTC


README

Latest Version Total Downloads License PHP Version Require

A small modular PSR HTTP framework with convention-based routing and first-class dependency injection

Kaly is an opinionated but lightweight application framework built on PHP standards:

  • PSR based: PSR-7 messages, PSR-11 container, PSR-15 middleware.
  • Dependency injection: powered by kaly-di, autowiring and explicit definitions.
  • Convention-based routing: no route file to maintain, controllers map to URIs; explicit routes.php when you need it.
  • Modular architecture: each module has its own config, controllers, templates and assets.
  • Middleware support: plain PSR-15 middleware, plus an optional generator style for before/after hooks.
  • Multilingual support: built-in locale detection.
  • Renderer agnostic: Latte (recommended), kaly-tpl (lightweight native PHP) or Twig, through tiny adapters.
  • No database, no ORM, no forms: Kaly stays a small HTTP framework.
  • No auth/CSRF/rate-limit bundled: provide your own PSR-15 middleware.

Stability

Internal lekoala/kaly-di and lekoala/kaly-tpl are 0.x and may evolve. Public contracts (RouterInterface, RendererInterface, ExceptionHandlerInterface, PSR-15 pipeline) are stable within 0.x — no intentional breaking change.

Views

Kaly ships no template engine: return a Kaly\View\View from a controller and register a Kaly\View\RendererInterface (see docs/views.md). Optional adapters are provided for Latte, kaly-tpl and Twig.

Requirements

  • PHP 8.3+
  • A PSR-7 implementation for your application (Nyholm is recommended); the core only depends on the PSR interfaces.

Installation

composer require lekoala/kaly nyholm/psr7

Quick start

// public/index.php
require __DIR__ . '/../vendor/autoload.php';

Kaly\Core\App::create(dirname(__DIR__))->run();
// modules/app/src/Controller/IndexController.php  ->  GET /
namespace App\Controller;

final class IndexController
{
    public function index(): string
    {
        return 'Hello';
    }
}

A module is any folder of modules/ with a config.php (it may be empty). Any other module is routable under its name (modules/Shop answers on /shop/...). See UPGRADE.md when updating.

Documentation

See Documentation. Run composer docs or composer docsify.

Testing

composer test