Skip to content
View SoloPHP's full-sized avatar

Block or report SoloPHP

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
SoloPHP/README.md

SoloPHP

Small, independent PSR packages for PHP. Use one, or all of them together.

Solo is not a framework. Each package does one job: a router, a container, request DTOs, a validator, repositories, a logger. They meet at PSR interfaces, and at solophp/contracts where PSR has none, so you can take one package into any project or replace one with another implementation. Two starter applications show how they fit together.

Website · Getting started · Packages · Packagist

Start a project

Both starters need PHP 8.4 and Composer. They include tests and are set up for PHPUnit, PHPStan at level max and PSR-12.

Skeleton · JSON API

Skeleton is a ready-to-run JSON API with one CRUD module, request validation, SQLite, error handling, logging and tests.

  1. Create the project with composer create-project solophp/skeleton my-app.
  2. Enter the project directory with cd my-app.
  3. Start the API with composer serve.

Build your first module

Inertia Svelte Skeleton · Web app

Inertia Svelte Skeleton combines server-side routing and controllers with an Inertia.js 3 and Svelte 5 frontend. It also needs Node.js.

Create the project with composer create-project solophp/inertia-svelte-skeleton my-app.

Set up PHP and Vite

Packages

Every package runs on PHP 8.3 or later, except Container, which needs 8.4.

PackageWhat it doesDocsLatest version
HTTP kernel
solophp/application PSR-15 kernel: service providers, a middleware pipeline, routing and a route cache Docs Latest version of solophp/application
solophp/router Routes, groups and parameter patterns, compiled for matching; URLs built from route names Docs Latest version of solophp/router
solophp/container PSR-11 container with autowiring, interface binding and lazy services Docs Latest version of solophp/container
solophp/http-emitter Sends a PSR-7 response: status line, headers and a streamed body README Latest version of solophp/http-emitter
solophp/contracts The interfaces the packages share where PSR has none README Latest version of solophp/contracts
Input
solophp/input Typed, immutable request DTOs, validated, cast and processed by attributes Docs Latest version of solophp/input
solophp/validator Rule strings compiled once, one structured error per field Docs Latest version of solophp/validator
Data
solophp/repository Typed table repositories over Doctrine DBAL, with translations, batch-loaded relations, stable pages and transactions Docs Latest version of solophp/repository
solophp/cache PSR-16 cache with file and Redis adapters: atomic file writes, isolated Redis namespaces and typed values Docs Latest version of solophp/cache
Infrastructure
solophp/logger PSR-3 logger for files shared across processes and for standard error, in line, JSON or logfmt Docs Latest version of solophp/logger
solophp/dotenv Strict .env loader: layered files, server variables first, all-or-nothing loading and typed accessors Docs Latest version of solophp/dotenv
solophp/event-dispatcher PSR-14 event dispatcher with priorities, subscribers, listeners matched by class or interface, and stoppable events Docs Latest version of solophp/event-dispatcher
solophp/job-queue Database-backed job queue: leased claims with ownership tokens, per-job retry policies, a long-running worker Docs Latest version of solophp/job-queue
solophp/rate-limiter Atomic per-key rate limits: fixed or renewable windows in Redis, with an in-memory twin for tests README Latest version of solophp/rate-limiter
solophp/tokens Tokens for reset links, invitations and sessions: random secrets stored only as hashes, in Redis or in memory Docs Latest version of solophp/tokens
solophp/http-client Immutable PSR-18 client on Guzzle: safe retries, credentials bound to their origin and redacted logs Docs Latest version of solophp/http-client
solophp/image Immutable GD images: EXIF orientation, bounded resizing, JPEG, PNG and WebP encoding, and smaller-only optimization Docs Latest version of solophp/image
Frontend
solophp/inertia Inertia.js 3 server adapter for PSR-7 and PSR-15: partial reloads, deferred props, flash data, SSR, Precognition Docs Latest version of solophp/inertia
solophp/vite Vite without a framework: the tags that load entries from the dev server or the build manifest, an asset version and a Twig function README Latest version of solophp/vite

Legacy

Archived repositories are no longer maintained; their replacements are listed under Legacy.

Pinned Loading

  1. Skeleton Skeleton Public

    Starter application for SoloPHP: the Solo packages wired together into a working JSON API.

    PHP

  2. Application Application Public

    PSR-15 application kernel for PHP with service providers, a middleware pipeline, routing, and a compiled route cache.

    PHP 1

  3. Router Router Public

    PHP router with an independent route builder, immutable runtime, typed results, and compiled matching.

    PHP 4

  4. Input Input Public

    Typed, validated input DTOs for PHP 8.3+: immutable classes built through their constructor from HTTP input, with attribute-driven validation, casting and processing

    PHP 1

  5. Repository Repository Public

    Typed PHP repositories over Doctrine DBAL with translation fallback, batch-loaded relations, stable pagination, and transactions.

    PHP 1

  6. Container Container Public

    PSR-11 dependency injection container for PHP with autowiring, interface bindings, and lazy services.

    PHP 1