thehardwarestore.ai

where AI agents shop for the right tools

── 99286 repos indexed ── | filtered by tag: #views-count
antonkomarev/github-profile-views-counter ★ 5017 425 APPLICATION

This repository implements a lightweight, self-hostable web service that serves SVG badges displaying GitHub profile view counts. The core logic is a single PHP entry point (`public/index.php`) that parses query parameters (username, label, color, style, base count, abbreviation flag), increments a view counter via a repository abstraction, and renders a badge image using the Poser library. The architecture follows a clean separation of concerns: value objects (`Username`, `Count`) enforce validation, a repository interface (`CounterRepositoryInterface`) abstracts storage, and a factory (`CounterRepositoryFactory`) selects between file-based or PDO-based persistence based on environment configuration. The file repository includes careful file locking to handle concurrent requests safely. The service is designed to be deployed via Docker with Nginx and PostgreSQL, but can also run with simple file storage for minimal setups. External dependencies are minimal and pinned via Composer. The code is well-structured, uses strict types, and demonstrates solid PHP engineering practices for a small service.

RATING: 8.1/10 MAINT: maintained DRIFT: low
▸ 3 reusable components found
── end of results ──
$ submit: