Getting started
Installation
Lapis needs PHP 8.5 or newer and Composer. The quickest way to start is the starter site, which gives you a working site with a layout and a home page. You may also add Lapis to a project you already have.
A new site
The starter site, lapis/app, is a project of its own. It comes with a layout, a home page, a [slug].php template for the pages editors create, a _404.php page and a config file:
composer create-project lapis/app my-site
At the end, Composer runs ./lapis setup, which creates the .env file with a signing key, the storage folders and the first editor account.
Into an existing project
To add Lapis to an existing Composer project, require the package and run the setup yourself:
composer require lapis/cms
./lapis setup # .env + SIGNING_KEY, storage folders, vendor assets, first editor
Without a terminal to answer in (in CI, or with composer -n), setup skips the first account. You may create it later with ./lapis user:create.
HTTPS, also locally
Editing needs a secure origin. Browsers only send the Sec-Fetch-Site header on secure origins, and Tempest's CSRF protection refuses every POST without it.
For a quick try, PHP's built-in server on localhost works over plain HTTP because browsers treat localhost and 127.0.0.1 as secure origins:
cd my-site php -S localhost:8000 -t public/
Any other local domain (such as *.test) and every live server needs HTTPS.
Once the site is running on a secure origin, sign in at /_lapis/login with the account setup created.