PHPackages                             malinichevvv/lift-skeleton - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. malinichevvv/lift-skeleton

ActiveProject[API Development](/categories/api)

malinichevvv/lift-skeleton
==========================

A starter URL-shortener microservice built on the Lift PHP micro-framework.

v1.0.1(2mo ago)05MITPHPPHP &gt;=8.1

Since May 18Pushed 2mo agoCompare

[ Source](https://github.com/malinichevvv/lift-skeleton)[ Packagist](https://packagist.org/packages/malinichevvv/lift-skeleton)[ Docs](https://github.com/malinichevvv/lift-skeleton)[ RSS](/packages/malinichevvv-lift-skeleton/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Lift Skeleton — URL Shortener
=============================

[](#lift-skeleton--url-shortener)

A small, production-shaped **URL-shortener microservice** built on the [Lift PHP micro-framework](https://github.com/malinichevvv/lift-php).

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
-----------

[](#quick-start)

```
composer create-project malinichevvv/lift-skeleton myapp
cd myapp
composer serve
```

`create-project` copies `.env`, generates an `APP_KEY` and runs the migrations for you. The service is now live on .

```
# Create a short link (API key is empty by default — see .env)
curl -X POST http://localhost:8000/links \
     -H 'Content-Type: application/json' \
     -d '{"url": "https://www.php.net/releases/8.3/en.php"}'
# -> {"slug":"aZ3kPq","short_url":"http://localhost:8000/aZ3kPq", ...}

# Open the short link in a browser — it redirects, and the click is counted.
open http://localhost:8000/aZ3kPq

# Inspect the stats
curl http://localhost:8000/links/aZ3kPq/stats
```

Endpoints
---------

[](#endpoints)

MethodPathDescriptionAuth`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:

```
{ "url": "https://example.com", "slug": "optional-custom", "expires_in": 86400 }
```

`slug` is optional (a random one is generated); `expires_in` is optional (seconds until the link stops resolving).

Authentication
--------------

[](#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
--------------

[](#project-layout)

```
app/
  Controllers/   HealthController, LinkController  — attribute-routed
  Middleware/    ApiKeyMiddleware                  — PSR-15
  Console/       PruneExpiredCommand               — custom CLI command
bootstrap/app.php  builds the App: env, config, services, middleware, routes
config/            app.php, database.php
database/migrations/  schema, run by `lift migrate`
public/index.php   front controller
tests/             feature tests on an in-memory SQLite database
lift.php           registers project console commands

```

Console
-------

[](#console)

`vendor/bin/lift` ships with the framework; this project adds a few commands:

```
php vendor/bin/lift serve          # development server
php vendor/bin/lift migrate        # run migrations
php vendor/bin/lift routes:list    # show registered routes
php vendor/bin/lift links:prune    # delete expired links (wire to cron)
php vendor/bin/lift list           # all available commands
```

Tests
-----

[](#tests)

```
composer test
```

Feature tests run against a fresh in-memory SQLite database — no setup, no external services.

Configuration
-------------

[](#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
------

[](#docker)

```
docker compose up --build
```

Brings up the service (with `lift serve`) plus a Redis container.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance87

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

67d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/140523673?v=4)[Vladislav Malinichev](/maintainers/malinichevvv)[@malinichevvv](https://github.com/malinichevvv)

---

Tags

phpSkeletonREST APIurl shortenerstartermicro-frameworklift

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/malinichevvv-lift-skeleton/health.svg)

```
[![Health](https://phpackages.com/badges/malinichevvv-lift-skeleton/health.svg)](https://phpackages.com/packages/malinichevvv-lift-skeleton)
```

###  Alternatives

[phplicengine/bitly

Bitly API v4

22305.0k](/packages/phplicengine-bitly)[rubix/server

Deploy your Rubix ML models to production with scalable stand-alone inference servers.

642.3k](/packages/rubix-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
