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

Maintainers

Package info

github.com/assegaiphp/core

pkg:composer/assegaiphp/core

Statistics

Installs: 342

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0


README

Assegai Logo

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.1) and combines elements of OOP (Object Oriented Programming) and FP (Functional Programming).

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
<?php
// <path-to-project>/index.php

...

/*
 * Set the path to the request URI.
 */
$_GET['path'] = trim($_SERVER['REQUEST_URI'], '/');

/*
 * This is the entry point of the application.
 */

require_once './bootstrap.php';

Bootstrap the app

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

use Assegai\Core\AssegaiFactory;
use Liferaftinc\RudderDashboard\AppModule;

require './vendor/autoload.php';

/**
 * Bootstraps the application.
 *
 * @return void
 */
function bootstrap(): void
{
  $app = AssegaiFactory::create(AppModule::class);
  $app->run();
}

bootstrap();

Start the dev server

$ php -S localhost:5000 -t <path-to-project>

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.

Questions

For questions and support please use the official Discord channel. 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 stratgies, 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.