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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nypl/microservice-starter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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

NYPL Microservice Starter

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

Since Oct 18Pushed 2mo ago27 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 today

READMEChangelog (2)Dependencies (20)Versions (190)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.3"
}

```

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

55

—

FairBetter than 97% of packages

Maintenance76

Regular maintenance activity

Popularity27

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 87.8% 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 ~19 days

Recently: every ~699 days

Total

182

Last Release

62d 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://avatars.githubusercontent.com/u/53827770?v=4)[John Berube](/maintainers/jberube-nypl)[@jberube-nypl](https://github.com/jberube-nypl)

![](https://avatars.githubusercontent.com/u/21960470?v=4)[Daniel Appel](/maintainers/danamansana)[@danamansana](https://github.com/danamansana)

![](https://avatars.githubusercontent.com/u/439581?v=4)[Paul Beaudoin](/maintainers/nonword)[@nonword](https://github.com/nonword)

---

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)")[![nonword](https://avatars.githubusercontent.com/u/439581?v=4)](https://github.com/nonword "nonword (3 commits)")[![gkallenberg](https://avatars.githubusercontent.com/u/1726809?v=4)](https://github.com/gkallenberg "gkallenberg (2 commits)")[![yossariano](https://avatars.githubusercontent.com/u/58152038?v=4)](https://github.com/yossariano "yossariano (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.8k532.1M19.4k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[azuracast/azuracast

The AzuraCast self-hosted web radio station management suite.

3.9k27.8k](/packages/azuracast-azuracast)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[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.

45344.0k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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