PHPackages                             connell/gratis - 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. [Framework](/categories/framework)
4. /
5. connell/gratis

ActiveLibrary[Framework](/categories/framework)

connell/gratis
==============

A framework for REST development in PHP.

v1.0.1(2y ago)14MITPHPPHP ^8.3

Since Jan 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/connellr023/gratis)[ Packagist](https://packagist.org/packages/connell/gratis)[ RSS](/packages/connell-gratis/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

 [![](https://github.com/connellr023/gratis/raw/main/public/images/logo_large.png?raw=true)](https://github.com/connellr023/gratis/blob/main/public/images/logo_large.png?raw=true)
===================================================================================================================================================================================

[](#-)

> A lightweight framework for developing *REST-like* APIs in **PHP**.

 [![](https://camo.githubusercontent.com/7216f6e0d8c62cd556c54a6330b2e2a6193fe0a0053e8c02dc35a0a933776867/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646576656c6f7065722d436f6e6e656c6c20526566666f2d646532333439)](https://camo.githubusercontent.com/7216f6e0d8c62cd556c54a6330b2e2a6193fe0a0053e8c02dc35a0a933776867/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646576656c6f7065722d436f6e6e656c6c20526566666f2d646532333439) [![](https://camo.githubusercontent.com/5efe88017121410b2d1022b435eca0716c81eb9837b4a83d3981186358931666/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d333634336431)](https://camo.githubusercontent.com/5efe88017121410b2d1022b435eca0716c81eb9837b4a83d3981186358931666/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d333634336431) [![](https://camo.githubusercontent.com/d2cf2579f8e73206aa2e4e6cb800ef6cd7a0b25056557551ceaa6e1b7c4c0792/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c616e67756167652d5048502d393337646264)](https://camo.githubusercontent.com/d2cf2579f8e73206aa2e4e6cb800ef6cd7a0b25056557551ceaa6e1b7c4c0792/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c616e67756167652d5048502d393337646264) [![](https://github.com/connellr023/gratis/actions/workflows/unit.yml/badge.svg)](https://github.com/connellr023/gratis/actions/workflows/unit.yml/badge.svg)[![](https://github.com/connellr023/gratis/actions/workflows/integration.yml/badge.svg)](https://github.com/connellr023/gratis/actions/workflows/integration.yml/badge.svg)

### Table Of Contents

[](#table-of-contents)

- [Overview](#overview)
- [Composer](#composer)
- [Intended Structure](#intended-structure)
    - [Middlewares](#middlewares)
    - [Controllers](#controllers)
    - [Models](#models)
    - [View](#view)
- [Documentation](public/doc/INDEX.md)
    - Structure
        - [Middlewares](public/doc/MIDDLEWARES.md)
        - [Controllers](public/doc/CONTROLLERS.md)
        - [Models](public/doc/MODELS.md)
        - [View](public/doc/VIEW.md)
    - Services
        - [Router Class](public/doc/ROUTER.md)
        - [Database Class](public/doc/DATABASE.md)
- [Development](#development)
    - [Requirements](#requirements)
    - [Installing Dependencies](#installing-dependencies)
    - [Continuous Integration](#running-the-phpunit-test-suite)
- [License](#license)

### Overview

[](#overview)

**Gratis** is a versatile framework designed to promote the separation of concerns, fostering scalable code practices by encapsulating logic within handlers. Primarily tailored for creating robust and scalable APIs that follow the **CRUD** lifecycle, the framework follows a *REST-like* architectural style. It allows form seamless interactions with **SQL** databases, providing a structured and efficient foundation for building web applications.

### Composer

[](#composer)

The **Gratis** framework can be used in a composer **PHP** project by running the following command,

```
composer require connell/gratis
```

### Intended Structure

[](#intended-structure)

```
│
└── src/
    ├── Models/
    │ └── ...
    │
    ├── Controllers/
    │ └── ...
    │
    ├── Middlewares/
    │ └── ...
    │
    ├── View/
    │ └── ...
    │
    └── ...

```

The code structure is meticulously crafted to adhere to a well-defined separation of concerns, delineating distinct roles for *model*, *controller*, *middleware*, and *view* components.

- ### Middlewares

    [](#middlewares)

    Positioned at the forefront of the process, middlewares gain initial access to client *request* and *response* objects before the controller takes charge. This makes them adept at tasks like client verification and handling cross-origin resource sharing.
- ### Controllers

    [](#controllers)

    Tasked with managing HTTP requests, controllers within the API play a pivotal role in orchestrating communication with the backend logic, ensuring a seamless exchange of information with the front end.
- ### Models

    [](#models)

    Endowed with the capability to execute database I/O operations, models uphold a rigorously typed database schema. This commitment ensures robust data integrity and reliability throughout the system.
- ### View

    [](#view)

    Housed within a dedicated directory, the *View* encapsulates static webpage code tailored for a single-page web application.

This framework is specifically designed to integrate with static files generated by contemporary front-end frameworks, such as **Vue.js** or **React**.

### Development

[](#development)

Below details information about the development environment.

### Requirements

[](#requirements)

The required dependencies for this framework are as follows from `composer.json`,

```
"require": {
  "php": "^8.3",
  "ext-pdo": "*"
},
"require-dev": {
  "phpunit/phpunit": "^10.5",
  "guzzlehttp/guzzle": "^7.8"
}
```

### Installing Dependencies

[](#installing-dependencies)

The only dependency used in this framework is **PHPUnit** for development testing. In order to install **PHPUnit**as well as generate autoload files, run the following command,

```
composer install
```

### Running The PHPUnit Test Suite

[](#running-the-phpunit-test-suite)

If you want to run the integration tests, the local **PHP** development server must be running on `http://localhost:8000`. There is a script to do this in `composer.json`,

```
composer dev
```

In order to the run the entire automated test suite for this framework, execute,

```
composer test
```

For just integration,

```
composer test:integration
```

For just unit tests,

```
composer test:unit
```

or see the **GitHub Actions** tab.

### License

[](#license)

This software is distributed under the **MIT** license. See `LICENSE` for more information.

 [![](https://github.com/connellr023/gratis/raw/main/public/images/logo_small.png?raw=true)](https://github.com/connellr023/gratis/blob/main/public/images/logo_small.png?raw=true)

Developed and tested by **Connell Reffo** in 2024.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

3

Last Release

856d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d85842e5b0741efd04b93db3bcdc16b4c7be5ee3bb9b504e660c1910c6a22e74?d=identicon)[connellr023](/maintainers/connellr023)

---

Top Contributors

[![connellr023](https://avatars.githubusercontent.com/u/58084009?v=4)](https://github.com/connellr023 "connellr023 (60 commits)")

---

Tags

frameworkmvcobject-orientedphp8

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/connell-gratis/health.svg)

```
[![Health](https://phpackages.com/badges/connell-gratis/health.svg)](https://phpackages.com/packages/connell-gratis)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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