modular php microservices with Slim framework

customized backend solutions with a small footprint

Slim is a PHP micro framework which basically takes a HTTP request, calls a routine based on it and returns a response.
It relies on the same composer based environment like its bigger brothers laravel and symfony but is – how the name implies – reduced to the max.

This reduction comes with a little extra bootstrapping work. When bootstrapping is done you have a beautiful, flexible and powerful piece of software, which can provide a wide range of backend-services running on almost every webhost.

Please see my Slim 4 Skeleton on GitHub.

The modular pattern allows integrating only the packages you need for your project.
For instance:

  • user management with sentinel
  • guzzle http to run a proxy, e.g. for collecting data from web-APIs or sites
  • you can borrow the ORM-Layer from laravel called Eloquent
  • use a configurable logger like monolog
  • or the event manager from doctrine
  • do database migrations and inserting mock-data via phpmig

Together with some useful techniques we can build reliable HTTP-REST-API-Microservices.

Database Migrations
Handling database while development with migrations gives us a kind of revision management for databases and allows integrating database operations into develop- and build-pipelines.

Behaviour-Driven-Development into Slim via the behat testing framework. This allows to test even fine-grained business logic, which does not only depend on the application but also the underlying data.

Please see my Slim 4 Skeleton on GitHub.