PHPackages                             tthe/bagatelle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. tthe/bagatelle

ActiveProject[Framework](/categories/framework)

tthe/bagatelle
==============

Bagatelle is a PHP micro framework based on Symfony for simple websites and APIs.

v1.0.0(1mo ago)02MITPHP

Since Feb 9Pushed 1mo agoCompare

[ Source](https://github.com/dekadans/bagatelle)[ Packagist](https://packagist.org/packages/tthe/bagatelle)[ RSS](/packages/tthe-bagatelle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (15)Versions (6)Used By (0)

Bagatelle
=========

[](#bagatelle)

> - A trifle; an insubstantial thing.
> - (literature, music) A short piece of literature or of instrumental music, typically light or playful in character.

*― [bagatelle - Wiktionary, the free dictionary](https://en.wiktionary.org/wiki/bagatelle)*

Introduction
------------

[](#introduction)

Bagatelle is a PHP micro framework based on Symfony for simple websites and APIs.

Contents
--------

[](#contents)

Bagatelle bundles core parts of [Symfony](https://symfony.com/) with well known components [Monolog](https://seldaek.github.io/monolog/) (PSR-3 logging), [PHP-DI](https://php-di.org/) (PSR-11 dependency injection container), [Twig](https://twig.symfony.com/) (templating engine), [phpdotenv](https://github.com/vlucas/phpdotenv) (environment variables), [nyholm/psr7](https://github.com/Nyholm/psr7) (HTTP messages) and a Docker image based on [FrankenPHP](https://frankenphp.dev/).

### Source Code

[](#source-code)

This project, `tthe/bagatelle`, is the template for new projects. The implementation is in [`tthe/bagatelle-core`](https://github.com/dekadans/bagatelle-core).

Get Started
-----------

[](#get-started)

### Create project

[](#create-project)

Create a new application based on Bagatelle (replace "my-project" with your name of choice):

```
composer create-project tthe/bagatelle my-project
```

### Environment

[](#environment)

Enable the example environment configuration:

```
cp .env.example .env
```

### Run application

[](#run-application)

When developing you can either use PHP's built-in development server:

```
php -S localhost:8080 -t public
```

or using Docker:

```
docker compose up -d

# or, for production config (using port 80):
SERVER_NAME="your-domain.com" docker compose -f compose.yaml -f compose.prod.yaml up
```

Both development servers will start your Bagatelle-based application at localhost:8080.

The console application is executed using:

```
php bin/console.php
```

### Build

[](#build)

Add controllers to `src/Controllers`, console commands to `src/Commands` and configure the dependency injection container in `config/container.php`.

Documentation
-------------

[](#documentation)

### Controllers &amp; Routing

[](#controllers--routing)

Controllers are placed in the path defined by `PATH_CONTROLLERS` (`src/Controllers` by default).

Routes are bound using the standard Symfony `#[Route]` attribute, or the bundled method attributes `#[Get]`, `#[Post]` etc. See [documentation](https://symfony.com/doc/current/routing.html) (not all features are enabled out-of-the-box).

HTTP message representations is available using either [HttpFoundation](https://symfony.com/doc/current/components/http_foundation.html) or [PSR-7 interfaces](https://www.php-fig.org/psr/psr-7/).

### Console

[](#console)

Console commands are placed in the path defined by `PATH_COMMANDS` (`src/Commands` by default). They are loaded automatically using the `#[AsCommand]` attribute.

See [documentation](https://symfony.com/doc/current/console.html).

### Dependency Injection

[](#dependency-injection)

Bagatelle uses [PHP-DI](https://php-di.org/doc/) as its dependency injection container.

The container is configured by the file identified by `PATH_CONTAINER` (`config/container.php` by default).

A few notable services bound by Bagatelle:

Container keyService description`\Psr\Container\ContainerInterface`The container itself.`\Psr\Log\LoggerInterface`Monolog logger.`\Psr\EventDispatcher\EventDispatcherInterface`Dispatching events to subscribers.`\Symfony\Component\Routing\Generator\UrlGeneratorInterface`Generating URLs to routes.`\Twig\Environment`Twig instance for parsing templates/views.### Middleware

[](#middleware)

Middleware can be implemented using `\tthe\Bagatelle\Middleware\MiddlewareInterface` and applied to controllers or routes using the attribute: `#[Middleware(\Name\Of\Middleware::class)]`

These middleware are included by default:

NamePurpose`\tthe\Bagatelle\Http\CORS`Configuring CORS on controller or route level.`\tthe\Bagatelle\Http\BasicAuth`Protecting resources using HTTP Basic Authentication.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Total

4

Last Release

48d ago

Major Versions

v0.0.3 → v1.0.02026-06-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1143146?v=4)[Tomas Thelander](/maintainers/dekadans)[@dekadans](https://github.com/dekadans)

---

Top Contributors

[![dekadans](https://avatars.githubusercontent.com/u/1143146?v=4)](https://github.com/dekadans "dekadans (76 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/tthe-bagatelle/health.svg)

```
[![Health](https://phpackages.com/badges/tthe-bagatelle/health.svg)](https://phpackages.com/packages/tthe-bagatelle)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M672](/packages/shopware-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[contao/core-bundle

Contao Open Source CMS

1301.7M3.1k](/packages/contao-core-bundle)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19467.3M1.9k](/packages/drupal-core)[chameleon-system/chameleon-base

The Chameleon System core.

1029.4k6](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
