A lightweight PHP 8.3+ library for URL shortening. SOLID and DDD, a repository at the edge, no bundled storage.
Architecture · PHP · DDD
Problem
URL shortening is a small domain that frameworks tend to swallow. Storage, codes and validation get mixed into one class.
Role
Author and maintainer
Approach
Separated Url as a value object, shortening logic, code generation and a repository interface. The application owns persistence. Composer package tenqz/shortify.
Outcome
A library that shortens and expands URLs without dictating the database.
Shortening a URL is a domain problem, not a reason to pull in a framework. The application already has storage. The library should not pretend otherwise.
Shortify keeps Url as a value object with validation, generates codes, and talks to storage through UrlRepositoryInterface. shorten and expand sit on a facade. Persistence stays outside the package.