Skip to content
@hydra-foundation

Hydra Foundation

Hydra is a modular PHP web application framework.

Hydra Foundation

A modular PHP framework built on PSR contracts — small packages, sharp boundaries, no magic.

PHP PSR License


Hydra is a PHP framework assembled from independent packages. Each one does a single job, depends on as little as possible, and codes against an interface rather than its neighbours. The split between framework mechanism and application policy is deliberate: the core defines contracts and orchestration, the packages supply the mechanism, and your app wires them together at the composition root.

Packages

The dependency graph flows downward — core knows nothing of the layers above it.

Package Role
hydrakit/core The foundation: application object, container & service-provider contracts, typed environment loading. Defines interfaces only — concretes are bound by the app.
hydrakit/http PSR-7 / PSR-15 HTTP layer — request lifecycle, routing, and the middleware pipeline.
hydrakit/nyholm Nyholm PSR-7 / PSR-17 adapter — the default message and factory implementation.
hydrakit/kernel Default composition root and HTTP plumbing — the framework-side wiring app builds on.
hydrakit/session Session handling exposed through PSR-15 middleware.
hydrakit/database A thin PDO-based data layer.
hydrakit/validation Zero-dependency input validation.
hydrakit/view Native PHP templating — no compile step, no new syntax.
hydrakit/log A PSR-3 logger.
hydrakit/event A PSR-14 event dispatcher and listener provider.
hydrakit/auth Authentication, built on the HTTP and session packages.
hydrakit/authorization Ability-based authorization on top of auth.
hydrakit/csrf CSRF protection delivered as middleware.
hydrakit/console The CLI surface, powered by Symfony Console.
hydrakit/app The application skeleton — the composition root every Hydra project starts from.

Principles

  • PSR all the way down. Containers, HTTP messages, middleware, logging, and factories speak the PHP-FIG standards, so packages compose with the wider ecosystem and with each other.
  • Contracts over concretes. Packages depend on interfaces. The app binds the implementations. Swapping one out is a one-line change at the composition root.
  • Mechanism vs. policy. The framework provides the how; your application owns the what. The two never bleed into each other.
  • Explicit beats implicit. No facades, no auto-discovery surprises. If a service is available, you can point to the line that bound it.

Getting started

Every project begins from the hydrakit/app skeleton:

cp .env.example .env             # defaults run as-is for local dev
composer install                 # resolves the framework packages
php bin/console key:generate     # writes a fresh APP_KEY

composer start                   # serve at http://localhost:8000

Open http://localhost:8000 and you'll see Welcome to Hydra. A full Docker stack (PHP-FPM, nginx, MariaDB, Redis) is available too — see the app README.

Requirements

  • PHP 8.2+
  • Composer
  • Optional: Docker + Compose for the full local stack

Popular repositories Loading

  1. app app Public

    Application skeleton for the Hydra PHP framework

    PHP 1

  2. core core Public

    Container, router, and middleware pipeline for the Hydra PHP framework

    PHP

  3. http http Public

    PSR-7/15/17 HTTP contracts and helpers for Hydra

    PHP

  4. auth auth Public

    Authentication for Hydra

    PHP

  5. authorization authorization Public

    Authorization and access-control gate for Hydra

    PHP

  6. csrf csrf Public

    CSRF token protection and middleware for Hydra

    PHP

Repositories

Showing 10 of 16 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…