A progressive PHP framework for building efficient and scalable server-side applications.

Maintainers

Package info

github.com/assegaiphp/core

pkg:composer/assegaiphp/core

Fund package maintenance!

Open Collective

Statistics

Installs: 414

Dependents: 1

Suggesters: 2

Stars: 0

Open Issues: 1


README

Assegai Logo

Latest release Tests PHP 8.4+ License Status active

A progressive PHP framework for building effecient and scalable server-side applications.

Description

Assegai is a framework for building efficient, scalable PHP server-side applications. It uses modern PHP (PHP 8.4+) and combines elements of OOP (Object Oriented Programming) and FP (Functional Programming).

Contribution workflow

For commit and pull request conventions in this repo, see:

Philosophy

In recent years, PHP has gained a lot of features out the box that make it a really compelling language for developers. Assegai aims to take advantage of these wonderful features and provide an application architecture which allows for the effortless creation of highly testable, scalable, loosely coupled and easily maintainable applications. The architecture is heavily inspired by Nestjs.

Getting started

Quick Start

$ composer require assegaiphp/core

For a real application, the recommended path is still the CLI:

$ assegai new my-app

Then use Core directly when you want to understand or extend the framework runtime itself.

Minimal bootstrap

<?php
// <path-to-project>/index.php

if (!isset($_GET['path']) || $_GET['path'] === '') {
  $_GET['path'] = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
}

require_once __DIR__ . '/bootstrap.php';

Bootstrap the app:

<?php
// <path-to-project>/bootstrap.php

use Assegai\Core\AssegaiFactory;
use App\AppModule;

require __DIR__ . '/vendor/autoload.php';

function bootstrap(): void
{
  $app = AssegaiFactory::createFromProject(AppModule::class, __DIR__);
  $app->run();
}

bootstrap();

Start the development server:

$ assegai serve

For the fuller walkthrough, start with Getting Started.

Server-rendered UI, HTMX, and Web Components

Assegai is not JSON-only. The framework supports classic server-rendered views through view(...), component-backed pages through render(...), automatic HTMX inclusion in rendered HTML, and first-class Web Components hydration through safe data-props helpers plus automatic bundle injection.

For the full walkthrough, see Pages and Components.

Data, ORM, and Relations

For data-backed applications, Assegai ships with a TypeORM-inspired workflow around modules, repositories, entities, and migrations. The fuller persistence track now lives in:

Constrained Route Params

Assegai routes support constrained dynamic params using angle-bracket syntax:

#[Get(':id<int>')]
public function findById(#[Param('id')] int $id): object
{
  // ...
}

Built-in constraints currently include int, slug, uuid, alpha, alnum, hex, and ulid.

For the full guide set, visit assegaiphp.com/guide.

Questions

For questions and support, use the official guide and support pages:

The issue list of this repo is exclusively for bug reports and feature requests.

Issues

Please make sure to read the Issues Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

Consulting

With official support, you can get expert help straight from the Assegai core team. We provide dedicated technical support, migration strategies, advice on best practices and design decisions, PR reviews, and team augmentation. Read more about support here.

Support

Assegai is an MIT-licensed open source project. It can grow thanks to sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Assegai is MIT licensed.