Search by

nesto / framework

hussein4alaa

Nesto — a PHP framework: modules, dependency injection, guards, pipes, interceptors, filters, validation, an ORM and a Prisma-style client, OpenAPI, queues, scheduling and a CLI, all with attributes.

Package info

github.com/trynesto/framework

pkg:composer/nesto/framework

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.4 2026-10-13 15:42 UTC

This package is not auto-updated.

Last update: 2026-10-13 18:08:57 UTC


README

Nesto Logo

Build Status Total Downloads Latest Stable Version License

About Nesto

Nesto is a PHP framework for building APIs with a clear structure. Your application is a tree of modules; each module declares its controllers and the services it provides, and everything is wired together with PHP attributes and constructor injection. Nesto takes care of the plumbing so you can focus on your domain:

Nesto speaks the PHP standards (PSR-7, 11, 15, 3, 14 and 16), so any Composer package plugs in.

Getting Started

composer global require nesto/framework
nesto new my-api
cd my-api
php nesto start

Open http://127.0.0.1:3000/api and you get Hello World!. Make sure Composer's global bin directory (composer global config bin-dir --absolute) is on your PATH.

If Composer reports a conflict with another global tool (for example psr/http-message locked to an older version), let it adjust the shared dependencies: composer global require nesto/framework -W.

A controller, a service and a module look like this:

use Nesto\Common\Attributes\{Body, Controller, Get, Injectable, Module, Post};
use Nesto\Validation\Attributes\{IsString, Length};

final class CreateCatDto
{
    #[IsString, Length(min: 2, max: 50)]
    public string $name;
}

#[Injectable]
final class CatsService
{
    private array $cats = [];

    public function create(CreateCatDto $dto): array
    {
        return $this->cats[] = ['id' => count($this->cats) + 1, 'name' => $dto->name];
    }

    public function findAll(): array
    {
        return $this->cats;
    }
}

#[Controller('cats')]
final class CatsController
{
    public function __construct(private readonly CatsService $cats) {}

    #[Get]
    public function findAll(): array
    {
        return $this->cats->findAll();
    }

    #[Post]
    public function create(#[Body] CreateCatDto $dto): array
    {
        return $this->cats->create($dto);
    }
}

#[Module(controllers: [CatsController::class], providers: [CatsService::class])]
final class CatsModule {}

Or let the console write it for you: php nesto g resource cats.

Learning Nesto

The Nesto documentation covers every part of the framework, and its tutorial builds a complete blog API step by step, from nesto new to production.

Requirements

  • PHP 8.3 or newer, with PDO and the driver of your database (pdo_pgsql, pdo_mysql or pdo_sqlite)
  • Composer 2

Contributing

Thank you for considering contributing to Nesto! Bug reports and pull requests are welcome on GitHub. To work on the framework:

git clone https://github.com/trynesto/framework nesto
cd nesto
composer install
vendor/bin/phpunit

The database tests also run against PostgreSQL, MySQL and MariaDB when NESTO_TEST_PGSQL_URL, NESTO_TEST_MYSQL_URL and NESTO_TEST_MARIADB_URL point at throwaway databases whose name contains test, and the Redis cache tests when NESTO_TEST_REDIS_URL is set (e.g. redis://127.0.0.1:6379/15; only keys prefixed nesto_test: are touched). To try a change in an application, create one against your checkout with bin/nesto new demo --dev.

Security Vulnerabilities

If you discover a security vulnerability within Nesto, please report it privately through GitHub security advisories instead of opening a public issue. All reports will be addressed promptly.

License

The Nesto framework is open-source software licensed under the MIT license.