PHPackages                             maurobonfietti/slim4-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. [HTTP &amp; Networking](/categories/http)
4. /
5. maurobonfietti/slim4-api-skeleton

ActiveLibrary[HTTP &amp; Networking](/categories/http)

maurobonfietti/slim4-api-skeleton
=================================

Useful skeleton for RESTful API development, using PHP and Slim 4.

1.1.0(1y ago)1392.3k36[2 issues](https://github.com/maurobonfietti/slim4-api-skeleton/issues)MITPHPPHP ^8.3CI failing

Since Oct 6Pushed 1y ago6 watchersCompare

[ Source](https://github.com/maurobonfietti/slim4-api-skeleton)[ Packagist](https://packagist.org/packages/maurobonfietti/slim4-api-skeleton)[ Docs](https://github.com/maurobonfietti/slim4-api-skeleton)[ Fund](https://ko-fi.com/maurobonfietti)[ RSS](/packages/maurobonfietti-slim4-api-skeleton/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (8)Versions (103)Used By (0)

SLIM 4 - API SKELETON
=====================

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

Useful skeleton for RESTful API development, using [Slim PHP micro-framework](https://www.slimframework.com).

[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/0439f5531dcb9701093bfe61c7bb3e0a443b0f1ae7e2180ef4b972b88542a152/68747470733a2f2f7472617669732d63692e636f6d2f6d6175726f626f6e6669657474692f736c696d342d6170692d736b656c65746f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/maurobonfietti/slim4-api-skeleton)[![Coverage Status](https://camo.githubusercontent.com/d6174538d1a9e3af21bfffa629d18cebed33390b535fd519ba09c70c46b218b6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6175726f626f6e6669657474692f736c696d342d6170692d736b656c65746f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/maurobonfietti/slim4-api-skeleton?branch=master)[![Packagist Version](https://camo.githubusercontent.com/a7897531a3f7a6797e689b1b37901c630a602e9baeb22e13044129632e7773f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6175726f626f6e6669657474692f736c696d342d6170692d736b656c65746f6e)](https://packagist.org/packages/maurobonfietti/slim4-api-skeleton)

💻 TECHNOLOGIES USED:
--------------------

[](#-technologies-used)

The main technologies used in this project are:

- PHP 8
- Slim 4
- MySQL
- PHPUnit
- dotenv
- Docker
- Docker Compose

⚙️ QUICK INSTALL:
-----------------

[](#️-quick-install)

### Requirements:

[](#requirements)

- Composer.
- PHP &gt;= 8.1
- MySQL/MariaDB.
- or Docker.

### With Composer:

[](#with-composer)

You can create a new project running the following commands:

```
composer create-project maurobonfietti/slim4-api-skeleton [my-api-name]
cd [my-api-name]
composer test
composer start
```

#### Configure your connection to MySQL Server:

[](#configure-your-connection-to-mysql-server)

By default, the API uses a MySQL database.

You should check and edit this configuration in your `.env` file:

```
DB_HOST='127.0.0.1'
DB_NAME='yourMySqlDatabase'
DB_USER='yourMySqlUsername'
DB_PASS='yourMySqlPassword'
DB_PORT='3306'

```

### With Docker:

[](#with-docker)

If you like Docker, you can use this project with **Docker** and **Docker Compose**.

**Minimal Docker Version:**

- Engine: 18.03+
- Compose: 1.21+

**Docker Commands:**

```
# Create and start containers for the API.
docker-compose up -d --build

# Checkout the API.
curl http://localhost:8081

# Stop and remove containers.
docker-compose down
```

📦 DEPENDENCIES:
---------------

[](#-dependencies)

### LIST OF REQUIRE DEPENDENCIES:

[](#list-of-require-dependencies)

- [slim/slim](https://github.com/slimphp/Slim): Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
- [slim/psr7](https://github.com/slimphp/Slim-Psr7): PSR-7 implementation for use with Slim 4.
- [pimple/pimple](https://github.com/silexphp/Pimple): A small PHP dependency injection container.
- [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv): Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.

### LIST OF DEVELOPMENT DEPENDENCIES:

[](#list-of-development-dependencies)

- [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit): The PHP Unit Testing framework.
- [symfony/console](https://github.com/symfony/console): The Console component eases the creation of beautiful and testable command line interfaces.
- [nunomaduro/phpinsights](https://github.com/nunomaduro/phpinsights): Instant PHP quality checks from your console.
- [maurobonfietti/slim4-api-skeleton-crud-generator](https://github.com/maurobonfietti/slim4-api-skeleton-crud-generator): CRUD Generator for Slim 4 - Api Skeleton.

🔖 ENDPOINTS:
------------

[](#-endpoints)

### BY DEFAULT:

[](#by-default)

- Hello: `GET /`
- Health Check: `GET /status`

📹 TUTORIAL:
-----------

[](#-tutorial)

Learn how to develop a RESTful API with PHP and Slim 4 by following this [video](https://youtu.be/DetK1w65S-k) \[🎥 🔈 🇪🇸 🇦🇷\]

    Desarrollar.una.API.RESTful.con.PHP.y.Slim.4.mp4    ❤️ SUPPORT THE PROJECT
----------------------

[](#heart-support-the-project)

If you would like to support this project, you can:

- Invite the author a coffee ☕ 😋
- Give a star to the repository ⭐ 😊

[![ko-fi](https://camo.githubusercontent.com/1fedf764fa06114b797ee53e7506df10880abed6766f854202d758df1707969d/68747470733a2f2f7777772e6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/maurobonfietti)

😎 AND THAT'S IT!
----------------

[](#sunglasses-and-thats-it)

Now, go to build an excellent RESTful API.

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.6% 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 ~81 days

Total

100

Last Release

559d ago

Major Versions

0.42.0 → 1.0.0.x-dev2024-03-22

PHP version history (6 changes)0.14.0.x-devPHP ^7.3

0.31.0.x-devPHP ^7.4

0.32.0.x-devPHP ^7.4 || ^8.0

0.39.0.x-devPHP ^8.0

0.40.0.x-devPHP ^8.1

1.1.0.x-devPHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24535949?v=4)[Mauro Bonfietti](/maintainers/maurobonfietti)[@maurobonfietti](https://github.com/maurobonfietti)

---

Top Contributors

[![maurobonfietti](https://avatars.githubusercontent.com/u/24535949?v=4)](https://github.com/maurobonfietti "maurobonfietti (348 commits)")[![GoldraK](https://avatars.githubusercontent.com/u/1814307?v=4)](https://github.com/GoldraK "GoldraK (6 commits)")[![DLzer](https://avatars.githubusercontent.com/u/22087888?v=4)](https://github.com/DLzer "DLzer (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![gitvitox](https://avatars.githubusercontent.com/u/22220646?v=4)](https://github.com/gitvitox "gitvitox (1 commits)")[![mrevjd](https://avatars.githubusercontent.com/u/161211?v=4)](https://github.com/mrevjd "mrevjd (1 commits)")[![toniop99](https://avatars.githubusercontent.com/u/35426566?v=4)](https://github.com/toniop99 "toniop99 (1 commits)")

---

Tags

api-skeletonmysqlphprest-apislimslim-micro-frameworkphpapirestslimmysqlREST APIslim4slim-micro-framework

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/maurobonfietti-slim4-api-skeleton/health.svg)

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

###  Alternatives

[maurobonfietti/rest-api-slim-php

Example of REST API with Slim PHP Framework.

3061.7k](/packages/maurobonfietti-rest-api-slim-php)[xendit/xendit-php

Xendit PHP SDK

189730.6k6](/packages/xendit-xendit-php)[colorfield/mastodon-api

PHP wrapper for Mastodon API

282.9k1](/packages/colorfield-mastodon-api)

PHPackages © 2026

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