Spiral Framework Web application skeleton
A ready-to-run Web application on RoadRunner with Cycle ORM, Stempler templates, queues, cache, mailer, events, translations and sample pages. The installer rebuilds this branch on each release.
To pick only the components you need, install the application with the installer instead:
composer create-project spiral/app my-appThe application needs PHP 8.2+ with the mbstring and sockets extensions.
git clone https://github.com/spiral/app.git my-app
cd my-app
composer install
cp .env.sample .env
php app.php encrypt:key -m .env
php app.php configure
composer rr:download
composer serve:devOpen http://127.0.0.1:8080 in the browser.
composer serve:devAPP_ENV=localand debug mode: errors come with details and a stack trace.- The tokenizer, view and ORM schema caches are off: code changes apply after a worker restart, without clearing caches.
- Buggregator Trap starts next to the application and receives what it sends.
Open the Trap web UI at http://127.0.0.1:5007; the Buggregator plugin for PhpStorm connects to the same port. The command points the application at Trap:
| What | Sent to Trap by |
|---|---|
dump() and trap() |
VAR_DUMPER_FORMAT=server, VAR_DUMPER_SERVER=127.0.0.1:9912 |
| Logs of the default channel | MONOLOG_DEFAULT_CHANNEL=remote, MONOLOG_REMOTE_URL=127.0.0.1:9913 |
| Emails | MAILER_DSN=smtp://127.0.0.1:1025 |
| Sentry events | SENTRY_DSN=http://sentry@127.0.0.1:8000/1, with spiral/sentry-bridge installed |
| OpenTelemetry traces, logs and metrics | OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318, OTEL_EXPORTER_OTLP_PROTOCOL=http/json, with spiral/otel-bridge installed |
composer serveAPP_ENV=prod, no debug mode and basic error verbosity: errors come without details.- The tokenizer, view and ORM schema caches are on; the command clears them before the start.
Both commands override the matching variables of .env. To run the application in production without Composer, set them in .env:
APP_ENV=prod
DEBUG=false
VERBOSITY_LEVEL=basic
TOKENIZER_CACHE_TARGETS=true
VIEW_CACHE=true
CYCLE_SCHEMA_CACHE=true
CYCLE_SCHEMA_WARMUP=trueClear the caches after each deploy:
php app.php cache:clean