Download the PHP package malinichevvv/lift-skeleton without Composer
On this page you can find all versions of the php package malinichevvv/lift-skeleton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download malinichevvv/lift-skeleton
More information about malinichevvv/lift-skeleton
Files in malinichevvv/lift-skeleton
Package lift-skeleton
Short Description A starter URL-shortener microservice built on the Lift PHP micro-framework.
License MIT
Homepage https://github.com/malinichevvv/lift-skeleton
Informations about the package lift-skeleton
Lift Skeleton — URL Shortener
A small, production-shaped URL-shortener microservice built on the Lift PHP micro-framework.
It is meant as a starting point: clone it, read it in five minutes, then
replace the links resource with your own. Despite its size it exercises a
real slice of the framework — attribute routing, request validation, the
query builder, migrations, a cache layer, per-route middleware and a custom
console command.
Quick start
create-project copies .env, generates an APP_KEY and runs the migrations
for you. The service is now live on http://localhost:8000.
Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
GET |
/ |
Self-describing endpoint list | — |
GET |
/health |
Liveness + database probe (200 / 503) |
— |
POST |
/links |
Create a short link | X-API-Key |
GET |
/links/{slug}/stats |
Click statistics for a short link | — |
GET |
/{slug} |
Redirect to the original URL | — |
POST /links accepts JSON:
slug is optional (a random one is generated); expires_in is optional
(seconds until the link stops resolving).
Authentication
POST /links is guarded by ApiKeyMiddleware. Set API_KEY in .env and send
it as the X-API-Key header. While API_KEY is empty every request is allowed
— handy locally, but set a key before deploying.
Project layout
Console
vendor/bin/lift ships with the framework; this project adds a few commands:
Tests
Feature tests run against a fresh in-memory SQLite database — no setup, no external services.
Configuration
SQLite is the default and needs nothing. To use MySQL/PostgreSQL or Redis,
uncomment the relevant block in .env. Redis, when configured, backs the
slug → URL lookup cache.
Docker
Brings up the service (with lift serve) plus a Redis container.
License
MIT — see LICENSE.