PHPackages                             baseapi/baseapi-template - 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. [Templating &amp; Views](/categories/templating)
4. /
5. baseapi/baseapi-template

ActiveProject[Templating &amp; Views](/categories/templating)

baseapi/baseapi-template
========================

Project template for BaseAPI - a tiny, KISS-first PHP 8.4 framework

v1.9.0.1(3mo ago)126MITPHPPHP ^8.4CI failing

Since Sep 11Pushed 3mo agoCompare

[ Source](https://github.com/TimAnthonyAlexander/base-api-template)[ Packagist](https://packagist.org/packages/baseapi/baseapi-template)[ RSS](/packages/baseapi-baseapi-template/feed)WikiDiscussions main Synced 3w ago

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

BaseAPI Project
===============

[](#baseapi-project)

This is the "empty" template project using baseapi. Creating a new project with baseapi will use this as a starter template.

Quick Start
-----------

[](#quick-start)

Create a new baseapi project "my-api" using Composer:

```
composer create-project baseapi/baseapi-template my-api
cd my-api
```

Copy the environment example file and start the server

```
cp .env.example .env
php mason serve
```

Your API will be available at `http://localhost:7879`. You can change host and port in the .env file.

### Console commands are run using:

[](#console-commands-are-run-using)

```
php mason
```

Git Hooks
---------

[](#git-hooks)

This template includes pre-commit hooks that automatically check code quality:

- **PHP Syntax Check** - Validates all staged PHP files
- **PHPStan Analysis** - Static code analysis (if available)
- **Tests** - Runs PHPUnit tests when core files change
- **Code Quality** - Prevents debugging functions in commits
- **File Size Warnings** - Alerts for large files

### Setup

[](#setup)

Hooks are automatically installed when creating a new project. To reinstall manually:

```
composer setup-hooks
```

### Bypass Hook (Not Recommended)

[](#bypass-hook-not-recommended)

```
git commit --no-verify -m "Skip pre-commit checks"
```

See `.githooks/README.md` for detailed documentation.

Dependency Injection Example
----------------------------

[](#dependency-injection-example)

This template demonstrates BaseAPI's dependency injection system:

### EmailService Example

[](#emailservice-example)

The `SignupController` shows how to inject services:

```
class SignupController extends Controller
{
    private EmailService $emailService;

    public function __construct(EmailService $emailService)
    {
        $this->emailService = $emailService;
    }

    public function post(): JsonResponse
    {
        // ... user creation logic ...

        // Use injected service
        $this->emailService->sendWelcome($user->email, $user->name);

        return JsonResponse::ok($user->jsonSerialize());
    }
}
```

### Service Provider

[](#service-provider)

Services are registered in `app/Providers/AppServiceProvider.php`:

```
public function register(ContainerInterface $container): void
{
    $container->singleton(EmailService::class);
    $container->singleton(UserProvider::class, SimpleUserProvider::class);
}
```

### Configuration

[](#configuration)

Providers are registered in `config/app.php`:

```
'providers' => [
    \App\Providers\AppServiceProvider::class,
],
```

Documentation
-------------

[](#documentation)

For full framework documentation, features, and usage examples, see:

- **[BaseAPI Repository](https://github.com/timanthonyalexander/base-api)** - Complete documentation

---

**BaseAPI** - The tiny, KISS-first PHP 8.4 framework that gets out of your way.

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance79

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity68

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

Recently: every ~16 days

Total

71

Last Release

111d ago

Major Versions

v0.7.10 → v1.0.02025-10-01

PHP version history (2 changes)v0.1.0PHP &gt;=8.4

v0.4.3PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/149d3f0b78cf8104b42119c4dc2e7f7abdaf72f59dc215dcc7b1188a1d24ae2b?d=identicon)[lairner](/maintainers/lairner)

---

Top Contributors

[![TimAnthonyAlexander](https://avatars.githubusercontent.com/u/66881998?v=4)](https://github.com/TimAnthonyAlexander "TimAnthonyAlexander (171 commits)")

---

Tags

baseapikickstartphpphpapitemplateSkeletonbaseapi

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19564.8M1.6k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M517](/packages/shopware-core)[bitrix24/b24phpsdk

An official PHP library for the Bitrix24 REST API

10139.4k5](/packages/bitrix24-b24phpsdk)

PHPackages © 2026

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