PHPackages                             apitin/apitin - 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. [API Development](/categories/api)
4. /
5. apitin/apitin

ActiveProject[API Development](/categories/api)

apitin/apitin
=============

Ultra light-weight API project

v1.4.3(4y ago)048MITPHPPHP &gt;=8.0.0

Since Apr 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/wex/apitin-apitin)[ Packagist](https://packagist.org/packages/apitin/apitin)[ RSS](/packages/apitin-apitin/feed)WikiDiscussions master Synced 1mo ago

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

Apitin - ultra lightweight API framework
========================================

[](#apitin---ultra-lightweight-api-framework)

- Requires `PHP 8.0+`
- Development can be done with `built-in web server`
- `Apache` &amp; `mod_rewrite` supported
- Can be used with `modules` and pure `callbacks`
- Supports magical loading with `static dependency injection`

TODO
----

[](#todo)

- Route caching

Getting started
---------------

[](#getting-started)

1. Create new project using `composer` with:

```
composer create-project apitin/apitin example-api
```

2. Start internal web server

```
cd example-api
composer run dev
```

3. Visit `http://127.0.0.1:3000/` and start developing!

Features
--------

[](#features)

1. Custom router

```
$router->get('foo/*', function($uri) {});
$router->get('bar/{id}', function($id) {});

$router->with('user', function() use ($router) {
    $router->get('view/{id}', function($id) {}); // user/view/{id}
    $router->get('edit/{id}', function($id) {}); // user/edit/{id}
});
```

2. Extended `PDO` library

```
$db = Database::factory();

// Fetch multiple
foreach ($db->all('SELECT * FROM `test`') as $t) {}

// Fetch single
$entry = $db->first('SELECT * FROM `test` WHERE `id` = ?', 1);

// Fetch column
$sum = $db->one('SELECT SUM(`price`) FROM `test`');

// Insert
$db->insert('test', ['foo' => 'bar']);

// Update
$db->update('test', ['foo' => 'bar'], ['id' => 1]);

// Replace
$db->replace('test', ['foo' => 'bar'], ['id' => 1]);

// Delete
$db->delete('test', ['id' => 1]);
```

3. Static dependency injection

```
class FooModule extends Apitin\Module
{
    public function route(Router $router): void
    {
        $router->get('*', function($uri) {
            return $this->call('test');
        });
    }

    public function test(Apitin\Database $database)
    {

    }
}
```

4. Module registration event &amp; call event

```
class FooModule extends Apitin\Module
{
    public function onRegister(Apitin\Application &$application): void
    {
        // Here be dragons.
    }

    public function onCall(Apitin\Application &$application): void
    {
        // Called while current module is called (route is matched)
    }
}
```

5. Alternative routing with `Attributes`

```
class TestModule extends Apitin\Module
{
    #[Route("*", ["GET"])]
    public function test($uri)
    {
        echo "Called for: {$uri}";
        exit;
    }
}
```

6. Alternative static dependency injection with `Attributes`

```
class TestModule extends Apitin\Module
{
    #[Inject(Apitin\Database::class)]
    protected Apitin\Database $db;

    #[Route("*", ["GET"])]
    public function test($uri)
    {
        var_dump( $this->db );
        exit;
    }
}
```

7. Http-helper

```
print_r( Http::post('https://example.com/')->json() );
```

8. CLI-support

```
# This is mapped to GET /test
php index.php test
```

9. Templates with partials

```
class TestModule extends Apitin\Module
{
    #[Route("/test", ["GET"])]
    public function test()
    {
        return Template::create(APP_PATH . 'views/test.phtml');
    }
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

12

Last Release

1815d ago

Major Versions

v0.0.5 → v1.0.02021-05-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49327294?v=4)[vvex](/maintainers/vvex)[@VVex](https://github.com/VVex)

---

Top Contributors

[![wex](https://avatars.githubusercontent.com/u/180108?v=4)](https://github.com/wex "wex (33 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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