Search by

hyperdrive / framework

arthurnacious

Hyperdrive - PHP Framework inspired by NestJS with OpenSwoole

Package info

github.com/arthurnacious/hyperdrive

pkg:composer/hyperdrive/framework

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2026-09-22 14:11 UTC

This package is auto-updated.

Last update: 2026-09-22 14:11:49 UTC


README

A modern, high-performance PHP application framework inspired by NestJS and designed as a reusable package. Hyperdrive installs into your existing project and provides a modular architecture, Domain-Driven Design structure, and extremely high performance through OpenSwoole or Swoole.

Vision

Hyperdrive brings NestJS-style modules and clean architectural patterns to PHP. It is installed via Composer and used directly within your src/ directory. It does not scaffold a project like Laravel or Symfony CLI.

Performance First

Multi-Runtime Architecture

Runtime Approx Requests/sec Notes

OpenSwoole 5,000--50,000 Coroutine runtime, fastest Swoole 4,000--40,000 Async runtime Traditional PHP 100--500 FPM, process-per-request

Hyperdrive works under all three.

Module System (NestJS-Inspired)

#[Module(
    imports: [AuthModule::class],
    controllers: [UserController::class],
    injectables: [UserService::class, UserRepository::class],
    exports: [UserService::class]
)]
class UserModule {}

A module groups everything needed for a feature: controllers, services, repositories, configuration, and providers.

Domain-Driven Design Ready

Hyperdrive supports clear separation of architectural layers:

src/
  Module/
    Users/
      Domain/
      Application/
      Infrastructure/
      UI/

Modern PHP Features

  • PHP 8.4+
  • Attributes for routing, modules, services
  • Autowired dependency injection
  • PSR-compliant container, logging, and event patterns

Concurrent Operations

$results = Concurrent::all([
    'user' => fn() => $userRepo->find($id),
    'posts' => fn() => $postRepo->findByUser($id),
    'notifications' => fn() => $notificationRepo->getUnread($id),
]);

Installation

composer require hyperdrive/framework

Basic Application Example

$app = HyperdriveFactory::create(AppModule::class);
$app->listen(9501);
#[Module(controllers: [AppController::class])]
class AppModule {}
#[Route('/api')]
class AppController
{
    #[Get]
    public function index(): Response
    {
        return Response::json(['message' => 'Hello Hyperdrive']);
    }
}

Run:

php server.php

Production Features

Health Check Endpoint

#[Get('/health')]
public function health(): Response
{
    return Response::json([
        'status' => 'healthy',
        'timestamp' => time(),
        'version' => '1.0.0',
    ]);
}

Middleware Pipeline

#[Middleware(AuthMiddleware::class)]
class SecureController {}

Testing

composer test
composer test-coverage

Roadmap

  • CLI tool (php please)
  • Domain event system
  • Task scheduling
  • API versioning
  • Rate limiting middleware
  • Automatic OpenAPI documentation

Contributing

Hyperdrive is open source and welcomes contributions! We're particularly interested in:

  • Performance optimizations
  • Middleware implementations
  • Testing utilities
  • Documentation improvements

License

MIT License