PHPackages                             tpalinski/slim-microtemplate - 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. [Templating &amp; Views](/categories/templating)
4. /
5. tpalinski/slim-microtemplate

ActiveLibrary[Templating &amp; Views](/categories/templating)

tpalinski/slim-microtemplate
============================

A small template for Slim microservices using Doctrine and some QOL stuff, based on the Slim Skeleton template

01PHPCI passing

Since Sep 5Pushed 8mo agoCompare

[ Source](https://github.com/tpalinski/slim-microtemplate)[ Packagist](https://packagist.org/packages/tpalinski/slim-microtemplate)[ RSS](/packages/tpalinski-slim-microtemplate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Slim Framework 4 Microtemplate
==============================

[](#slim-framework-4-microtemplate)

This is a Slim microservice template based on the [Slim Skeleton](https://github.com/slimphp/Slim-Skeleton) template. Support for Doctrine 4 was added, along with some utility DTO parsing and .env file support with sensible default handling. There is also a lightweight APCU based cache implementation.

Overview
--------

[](#overview)

### `app`

[](#app)

This directory contains all meta-ish information about the application. Here you register all DI related things, along with configuring your routes and the container itself.

### `logs`

[](#logs)

Literally just logs from the app

### `public`

[](#public)

Good ole' php public directory, with .env file being parsed in index.php

### `src`

[](#src)

This is the main business logic directory that you will work the most in

#### `Application`

[](#application)

Here is your http communication layer, with custom middleware and route handlers living here. Additionally, app settings are defined here. Some basic APCU based cache implementation can be also found here.

#### `Domain`

[](#domain)

All abstract things such as interfaces and abstract classes should live here. For Doctrine entities, `Entity` directory should be where you put them, since this is the default directory where metadata is searched for.

#### `Infrastructure`

[](#infrastructure)

Directory for all services and repositories. I would recommend using Doctrine repositories and wiring them up with entity classes instead of writing your own from scratch, since they work very well in this setting.

### `tests`

[](#tests)

Write your tests here. We use PHPunit for unit testing. You can find an example test suite for the APCU cache implementation here.

### `var`

[](#var)

This is where slim and doctrine cache things.

### `cli-config.php`

[](#cli-configphp)

Doctrine CLI configuration. See `composer.json` for sample commands.

Running the app
---------------

[](#running-the-app)

Before attempting to run the app, please make sure that `.env` is present in the project directory. Otherwise, the app will start throwing up errors on start.

### Running in docker-compose

[](#running-in-docker-compose)

You can either use standolone image with `Dockerfile`, or full setup with postgres included with `docker compose`:

1. `docker compose up` to build image and run the app
2. You can install deps locally with composer, or use the container: `docker compose run --rm -it slim composer install`
3. Use the provided migration commands or access Doctrine CLI: `docker compose run --rm -it slim composer db` (for fresh migration: `db:create`) The application should be now accessible @ `http://127.0.0.1:8080`.

### Running locally

[](#running-locally)

Would still recommend docker, but you can run the app with `composer start`. The same steps and commands apply - `composer install` to install dependencies and `composer db` for Doctrine CLI access.

Development
-----------

[](#development)

To install a pre-commit phpstan check for your code quality, please run `composer hook:install`. We provided `.editorconfig` as well as phpstan config file for you to modify as you please.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b5ab2acb094b7defe36e971a237c6b496474bac907077bdc85b7b20b5f6165b?d=identicon)[tpalinski](/maintainers/tpalinski)

---

Top Contributors

[![tpalinski](https://avatars.githubusercontent.com/u/108625684?v=4)](https://github.com/tpalinski "tpalinski (14 commits)")

### Embed Badge

![Health badge](/badges/tpalinski-slim-microtemplate/health.svg)

```
[![Health](https://phpackages.com/badges/tpalinski-slim-microtemplate/health.svg)](https://phpackages.com/packages/tpalinski-slim-microtemplate)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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