PHPackages                             nypl/microservice-starter - 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. nypl/microservice-starter

ActiveLibrary

nypl/microservice-starter
=========================

NYPL Microservice Starter

2.0.2(9mo ago)73.0k5[3 PRs](https://github.com/NYPL/php-microservice-starter/pulls)PHPCI passing

Since Oct 18Pushed 4mo ago28 watchersCompare

[ Source](https://github.com/NYPL/php-microservice-starter)[ Packagist](https://packagist.org/packages/nypl/microservice-starter)[ RSS](/packages/nypl-microservice-starter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (10)Versions (188)Used By (0)

NYPL PHP Microservice Starter
=============================

[](#nypl-php-microservice-starter)

This package is intended to be used as the starter package for PHP-based NYPL Microservices.

This package adheres to [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/), and [PSR-4](http://www.php-fig.org/psr/psr-4/) (using the [Composer](https://getcomposer.org/) autoloader).

Deployment
----------

[](#deployment)

This library is intended to be used as a Composer dependency hosted on Packagist. To deploy a new version, create a numeric tag, like "2.0.0" and push it up to [Github](https://github.com/NYPL/php-microservice-starter). Then, log into [Packagist](https://packagist.org/packages/nypl/microservice-starter) and hit the update button to pull in the new tag. This will make your new tag available as a Composer dependency version that your apps can access.

Installation
------------

[](#installation)

Via Composer

```
"require": {
    "nypl/microservice-starter": "^2.0.0"
}

```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- PHP Extensions
    - [Rdkafka](https://arnaud-lb.github.io/php-rdkafka/phpdoc/book.rdkafka.html)

Features
--------

[](#features)

- RESTful HTTP framework ([Slim](http://www.slimframework.com/))
- Database PDO library ([Slim-PDO](https://github.com/FaaPz/Slim-PDO))
- Kafka message publishing ([Rdkafka](https://arnaud-lb.github.io/php-rdkafka/phpdoc/book.rdkafka.html))
- Avro serializer ([Avro](http://apache.osuosl.org/avro/))
- Swagger documentation generator ([swagger-php](https://github.com/zircote/swagger-php))
- Error logging ([Monolog](https://github.com/Seldaek/monolog))
- Identity/JWT authentication via NYPL API Gateway (`X-NYPL-Identity`)

Usage
-----

[](#usage)

### HTTP/API Server

[](#httpapi-server)

See the `samples/service` directory to learn how to create an example service.

#### Basic Example

[](#basic-example)

Create an `index.php` with a `Service` object and your [Slim](http://www.slimframework.com/) routes:

```
$service = new NYPL\Starter\Service();

$service->get("/v0.1/bibs", function (Request $request, Response $response) {
    $controller = new Controller\BibController($request, $response);
    return $controller->getBibs();
});

```

Configure your web server to load `index.php` on all requests. See the `samples/service-config` directory for sample configuration files for an Apache `.htaccess` or Nginx `nginx.conf` installation.

### Swagger Documentation Generator

[](#swagger-documentation-generator)

Create a Swagger route to generate Swagger specification documentation:

```
$service->get("/swagger", function (Request $request, Response $response) {
    return SwaggerGenerator::generate(__DIR__ . "/src", $response);
});

```

### Forked Avro library

[](#forked-avro-library)

A fork of the Avro PHP library is included in this repo. See [the Avro README](lib/Avro/README.md) for details.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance66

Regular maintenance activity

Popularity24

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 92.9% 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 ~18 days

Recently: every ~630 days

Total

181

Last Release

294d ago

Major Versions

0.1.56 → 1.0.02017-05-17

0.1.57 → 1.0.142017-06-28

1.2.29 → 2.0.02025-03-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/6890ff3f2fd05c3ff161c5453ac6f7d74a093d6342fada063868c07af1d98d91?d=identicon)[jberube-nypl](/maintainers/jberube-nypl)

![](https://www.gravatar.com/avatar/39c8efe84d76c79ea7ad6d8ef9ff549e7a3bb547b5bdba91dd9e55f7c70de049?d=identicon)[danamansana](/maintainers/danamansana)

---

Top Contributors

[![jberube-nypl](https://avatars.githubusercontent.com/u/53827770?v=4)](https://github.com/jberube-nypl "jberube-nypl (79 commits)")[![keithbauer](https://avatars.githubusercontent.com/u/1844072?v=4)](https://github.com/keithbauer "keithbauer (4 commits)")[![gkallenberg](https://avatars.githubusercontent.com/u/1726809?v=4)](https://github.com/gkallenberg "gkallenberg (2 commits)")

### Embed Badge

![Health badge](/badges/nypl-microservice-starter/health.svg)

```
[![Health](https://phpackages.com/badges/nypl-microservice-starter/health.svg)](https://phpackages.com/packages/nypl-microservice-starter)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)

PHPackages © 2026

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