Skip to content
@hydra-foundation

Hydra

A collection of experimental PHP packages that come together to form the Hydra framework.

Hydra Foundation

hydra tests app tests Split Latest release

PHP PSR License

A collection of experimental PHP packages that form the foundation of my PHP framework, Hydra.

Documentation: hydra.williamhleucka.com — install, routing, templates, the admin, and a changelog of every release.

Experimental. A personal project, built in the open for my own use. Breaking changes are expected between any two versions, without notice.

Start here

composer create-project hydrakit/app my-app

That is the skeleton, with every hydrakit/* package resolved from Packagist. To work on the framework itself rather than with it, clone the monorepo below.

Where the code lives

hydra is the development monorepo: every package's source, one test suite, one release. It is where issues and pull requests belong.

The twenty-seven package repositories in this organization are generated. A split workflow republishes each packages/* directory to its own repository on every push and every tag, which is what keeps composer require hydrakit/http working from Packagist. They are outputs: issues are disabled, a pull request against one cannot be merged, and a direct push is overwritten by the next split.

app is the exception. It is a real repository, not a mirror, and is developed there.

Packages

Each links into the monorepo, where that package's source lives. Install any of them with composer require hydrakit/<name>.

Package Role
core Application object, container and service-provider contracts, and typed environment loading. Interfaces only.
http PSR-7/PSR-15 HTTP layer: request lifecycle, routing, and middleware pipeline.
nyholm Nyholm PSR-7/PSR-17 adapter: the default message and factory implementation for Hydra.
php-di PHP-DI PSR-11 adapter: the default container for Hydra.
kernel Hydra's default composition root and HTTP plumbing, kept in one place instead of copied per app.
session Session handling as PSR-15 middleware, behind split data and lifecycle interfaces.
database A thin PDO data-access seam and a raw-SQL migration runner.
cache A small key/value store behind one contract, with the atomic counters rate limiting needs.
validation Zero-dependency input validation: per-field rules, stateless, shareable.
view Native PHP templating with template inheritance and escape-by-convention safety. No compile step.
log A minimal PSR-3 logger that writes one plain-text line per record to a stream.
event A minimal PSR-14 event dispatcher and listener provider.
auth Authentication for Hydra: identity only, behind a swappable guard.
authorization Ability-based authorization for Hydra, on top of hydrakit/auth.
csrf Synchronizer-token CSRF protection as PSR-15 middleware.
console The generic console commands every Hydra app needs, and the contracts a command is written against.
symfony-console Symfony Console adapter: the default runner for Hydra commands, and the only package that names it.
admin A composable admin backend for Hydra apps: declare a module, get routes and htmx screens.
mail Outgoing mail behind one transport contract: SMTP for delivery, log and array transports so tests and local development never send.
throttle Request rate limiting as PSR-15 middleware, counted in a shared store.
scheduler Scheduled work from one cron entry: due checks, overlap locks and bounded batches.
queue Work that outlives the request: a job contract, a database queue with retries, drained by the scheduler.
filesystem File storage behind one contract: a private disk served through the app, a public disk served by the web server, and keys that never trust the client's filename.
broadcast Tell other processes that something changed: a publisher over Redis pub/sub, listen tokens, and an SSE hub that fans broadcasts out to browsers.
commonmark CommonMark adapter: Markdown to safe HTML for Hydra, with front matter and server-side code highlighting.
image Image variants for Hydra: a picture resized to the widths a page needs, as WebP, upright and without metadata.
seo Meta tags, sitemaps and Atom feeds for Hydra: built from plain values, escaped once, every URL absolute.
app The application skeleton every Hydra project starts from.

Principles

  • PSR all the way down. HTTP messages, containers, middleware, logging, events, factories and clocks speak the PHP-FIG standards.
  • Contracts over concretes. Packages depend on interfaces; the app binds the implementations. Swapping one out is a one-line change at the composition root.
  • One package, one job. A package that needs a concrete vendor gets an adapter of its own, so the seam stays swappable and the dependency stays optional. Four do: nyholm, php-di, symfony-console and commonmark. Twenty-three require nothing outside PHP and the PSR interfaces.

The longer version — what goes in, what stays out, and the questions a design is checked against before it is built — is written down at the ethos.

Popular repositories Loading

  1. app app Public

    Application skeleton for the Hydra PHP framework

    PHP 1

  2. hydra hydra Public

    Development monorepo for the Hydra PHP Framework

    PHP 1

  3. core core Public

    Container, router, and middleware pipeline for Hydra

    PHP

  4. http http Public

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

    PHP

  5. auth auth Public

    Authentication for Hydra

    PHP

  6. authorization authorization Public

    Authorization and access-control gate for Hydra

    PHP

Repositories

Showing 10 of 30 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…