PHPackages                             tuupola/slim-api-skeleton - 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. tuupola/slim-api-skeleton

ActiveProject

tuupola/slim-api-skeleton
=========================

Slim 3 + Zend Table Gateway + Monolog API skeleton

3093.2k60[6 issues](https://github.com/tuupola/slim-api-skeleton/issues)PHPCI failing

Since Mar 16Pushed 4y ago22 watchersCompare

[ Source](https://github.com/tuupola/slim-api-skeleton)[ Packagist](https://packagist.org/packages/tuupola/slim-api-skeleton)[ RSS](/packages/tuupola-slim-api-skeleton/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Slim 3 API skeleton
===================

[](#slim-3-api-skeleton)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d4380dadec27f74ed4089b149675d576d39a08ed446f4531ad4f718e6195d7cd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f747575706f6c612f736c696d2d6170692d736b656c65746f6e2f54657374732f6d61737465723f7374796c653d666c61742d737175617265)](https://github.com/tuupola/slim-api-skeleton/actions)[![Coverage](https://camo.githubusercontent.com/9d125ba66bdd00dc72464c381c496ca43583d8a9767c44bc317e747a301be059/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f747575706f6c612f736c696d2d6170692d736b656c65746f6e2e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/tuupola/slim-api-skeleton)

This is Slim 3 API skeleton project for Composer. Project uses [Zend Table Gateway](https://docs.zendframework.com/zend-db/table-gateway/) and [Phinx](https://phinx.org/) for database operations, [Monolog](https://github.com/Seldaek/monolog) for logging, and [Fractal](http://fractal.thephpleague.com/) as a serializer. [Vagrant](https://www.vagrantup.com/) virtualmachine config and [Paw](https://paw.cloud/) project files are included for easy development. The skeleton tries to follow DDD principles.

Install
-------

[](#install)

Install the latest version using [composer](https://getcomposer.org/).

```
$ composer create-project --no-interaction --stability=dev tuupola/slim-api-skeleton app
```

Usage
-----

[](#usage)

If you have [Vagrant](https://www.vagrantup.com/) installed start the virtual machine.

```
$ cd app
$ vagrant up
```

Now you can access the api at

### Get a token

[](#get-a-token)

```
$ curl "https://192.168.50.52/token" \
    --request POST \
    --include \
    --insecure \
    --header "Content-Type: application/json" \
    --data '["todo.all"]' \
    --user test:test

HTTP/1.1 201 Created
Content-Type: application/json

{
    "token": "XXXXXXXXXX",
    "expires": 1491030210
}

```

```
$ export TOKEN=XXXXXXXXXX

```

### Create a new todo

[](#create-a-new-todo)

```
$ curl "https://192.168.50.52/todos" \
    --request POST \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN" \
    --header "Content-Type: application/json" \
    --data '{ "title": "Test the API", "order": 10 }'

HTTP/1.1 201 Created
ETag: "c39de417d4d1f5fe22d19cad68d672d8"
Last-Modified: Sat, 16 Apr 2016 10:21:50 GMT
Location: /todos/12Cf2ZjVvyu3A
Content-Type: application/json

{
    "data": {
        "uid": "12Cf2ZjVvyu3A",
        "order": 10,
        "title": "Test the API",
        "completed": false,
        "links": {
            "self": "/todos/12Cf2ZjVvyu3A"
        }
    }
}

```

### Get an existing todo

[](#get-an-existing-todo)

```
$ curl "https://192.168.50.52/todos/12Cf2ZjVvyu3A" \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN"

HTTP/1.1 200 OK
ETag: "c39de417d4d1f5fe22d19cad68d672d8"
Last-Modified: Sat, 16 Apr 2016 10:21:50 GMT
Content-Type: application/json

{
    "data": {
        "uid": "12Cf2ZjVvyu3A",
        "order": 10,
        "title": "Test the API",
        "completed": false,
        "links": {
            "self": "/todos/12Cf2ZjVvyu3A"
        }
    }
}

```

### Update part of an existing todo

[](#update-part-of-an-existing-todo)

```
$ curl "https://192.168.50.52/todos/12Cf2ZjVvyu3A" \
    --request PATCH \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN" \
    --header "Content-Type: application/json" \
    --header 'If-Match: "c39de417d4d1f5fe22d19cad68d672d8"' \
    --data '{ "order": 27 }'

HTTP/1.1 200 OK
ETag: "ab6070930158fc8323aa4550aff438b7"
Last-Modified: Sat, 16 Apr 2016 10:27:16 GMT
Content-Type: application/json

{
    "data": {
        "uid": "12Cf2ZjVvyu3A",
        "order": 27,
        "title": "Test the API",
        "completed": false,
        "links": {
            "self": "/todos/12Cf2ZjVvyu3A"
        }
    }
}

```

### Fully update an existing todo

[](#fully-update-an-existing-todo)

```
$ curl "https://192.168.50.52/todos/12Cf2ZjVvyu3A" \
    --request PUT \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN" \
    --header "Content-Type: application/json" \
    --header 'If-Match: "ab6070930158fc8323aa4550aff438b7"' \
    --data '{ "title": "Full update", "order": 66, "completed": true }'

HTTP/1.1 200 OK
ETag: "451665ea7769851880f411750bbd873c"
Last-Modified: Sat, 16 Apr 2016 10:28:45 GMT
Content-Type: application/json

{
    "data": {
        "uid": "12Cf2ZjVvyu3A",
        "order": 66,
        "title": "Full update",
        "completed": true,
        "links": {
            "self": "/todos/12Cf2ZjVvyu3A"
        }
    }
}

```

### Delete an existing todo

[](#delete-an-existing-todo)

```
$ curl "https://192.168.50.52/todos/12Cf2ZjVvyu3A" \
    --request DELETE \
    --include \
    --insecure \
    --header "Authorization: Bearer $TOKEN"

HTTP/1.1 204 No Content

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

↑

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3325405a7d8a43bc40dd0e760a4b7f268fba32a7150cf0327f64f13d1661df0b?d=identicon)[tuupola](/maintainers/tuupola)

---

Top Contributors

[![tuupola](https://avatars.githubusercontent.com/u/21913?v=4)](https://github.com/tuupola "tuupola (169 commits)")[![misi](https://avatars.githubusercontent.com/u/311629?v=4)](https://github.com/misi "misi (1 commits)")[![pdrappo](https://avatars.githubusercontent.com/u/6614661?v=4)](https://github.com/pdrappo "pdrappo (1 commits)")

---

Tags

apiphprestskeletonslim3

### Embed Badge

![Health badge](/badges/tuupola-slim-api-skeleton/health.svg)

```
[![Health](https://phpackages.com/badges/tuupola-slim-api-skeleton/health.svg)](https://phpackages.com/packages/tuupola-slim-api-skeleton)
```

PHPackages © 2026

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