matthewaprice / phossil
Routing, typed views and components for PHP sites that build to static HTML.
Requires
- php: >=8.4
Requires (Dev)
- phpunit/phpunit: ^13.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-31 21:51:16 UTC
README
Note: This repository contains the core for the phossil site kit. To create an application with phossil, visit matthewaprice/phossil-starter
phossil is a PHP site kit with routing and typed components that builds to plain static HTML, ready for AWS Amplify or any static host.
You get routes, typed views and components while you build, and a folder of static files when you deploy.
Read the documentation at phossil.dev
Why
I love PHP, and I wanted the same dist/ workflow JavaScript developers take for granted. phossil gives you one. Here are a couple of project types that I use this kit for:
- Simple sites that never needed a server. Build once and host the HTML anywhere.
- Bigger sites that will need infrastructure later but need client feedback now. Ship a static preview today and keep the PHP for when you add the backend.
Either way, it's one command: composer build:zip renders every route and zips it with your assets for a host like AWS Amplify.
Quick start
phossil runs PHP, nginx and Vite in Docker. You also need PHP and Node on your machine, for Composer and pnpm:
- Docker, with Compose
- PHP 8.5 with Composer
- Node 24 or later, with pnpm
composer create-project matthewaprice/phossil-starter my-site cd my-site pnpm install # Vite, Tailwind, oxfmt and oxlint docker compose up --build
create-project copies the phossil starter into my-site/ and installs phossil, the matthewaprice/phossil package in this repo, into vendor/. It then asks whether to start a git repository with a first commit, and what to call its default branch (press Enter for main). Answer n to the first question to skip it.
Open http://localhost:8000.
Build
With the containers still running, build the site and zip it:
composer build:zip
You get dist/, and dist.zip beside it at the root of the repo, ready to upload to any static host.
Format and lint
pnpm format # oxfmt: JS, CSS, JSON, Markdown pnpm format:check # the same, without writing pnpm format:build # run on the built dist folder pnpm lint # oxlint: app/js
Documentation
- Getting started: install, run it locally, add a page, and build.
- Directory structure: what each file and folder does.
- Deploy to AWS Amplify: deploy by hand or from GitHub Actions on every push.
- Features: routing, typed views and components, Vite and Tailwind, Docker, and the build.
Sites built with phossil
These sites run on phossil in production:
- matthewaprice.com: Matthew Price's personal site.
- phossil.dev: the phossil documentation.