URL Shortener Module Development

Замовник: AI | Опубліковано: 25.10.2025

We need a clean, production-ready URL Shortener module inside our existing project platform (Laravel modular architecture). This module will let users create short links, protect them with passwords, set expiry/pause, view analytics, and auto-generate QR codes for download. No external API work and no database schema write-ups are required—just module logic, views, routes, and integration with our existing layout/helpers. --- What you’ll build (scope) Shorten Link Flow Form fields: Long URL, Custom Slug (optional), Expiry (optional), Password Protection (optional), “Generate QR” toggle. Result screen: Short link + Copy button, QR preview, Download QR option. Redirect & Protection Route like /go/{slug} to redirect safely. If protected: show password prompt → validate → continue. Graceful states for expired or paused links. User Dashboard (“Tools → URL Shortener”) List of user links with columns: Short Link, Original, Clicks, QR, Status, Password?, Created, Actions. Actions: Copy, Edit (change slug, expiry, password on/off), Pause/Resume, Delete, View Stats. Analytics (per-link) Clicks over time, top countries, referrers, device/browser breakdown (simple charts/tables). QR Codes Auto-generate QR for each short link (PNG preferred). Show mini preview in list; allow download. Admin View (“Modules → URL Shortener”) Cards: Total Links, Protected Links, Total Clicks. Global list with filters; disable/delete any link. Settings toggles: allow guest shortening, allow password protection, blocklist domains. --- UI/UX expectations Use our existing Afli admin theme (Blade + Tailwind). Card-style forms, compact tables with filters, clear icons ( for protected). Clean password prompt page for protected links. Simple charts (ApexCharts/Chart.js) for clicks, countries, devices. Mobile-responsive. --- Deliverables A self-contained Modules/UrlShortener module with: Routes, Controllers, Middleware (for tracking), Blade views, Service/Helper for QR generation. User pages: Shorten Form, My Links, Link Analytics, Protected Password Prompt. Admin pages: Dashboard + Links table + basic settings. Seed/test data or a quick demo walkthrough so we can verify features. Basic unit/feature tests for the shorten/redirect/password flow (nice to have). --- Timeline (4 days, Dubai time) Day 1: Module skeleton, routes, Shorten form + result view, QR generation. Day 2: Redirect flow, password prompt + validation, expiry/pause handling, list page (My Links). Day 3: Analytics page (charts/tables), actions (edit/pause/delete/duplicate), polish lists. Day 4: Admin views, settings toggles, QA pass, responsive tidy-up, brief handover notes. --- Tech & constraints Laravel (modular structure already in project). Blade + Tailwind for UI. Use safe redirects (redirect()->away()), hash passwords, and keep pages fast (cache where sensible). Do not include external API work or DB schema documentation in this delivery. --- Acceptance criteria Short links create successfully with optional custom slug, expiry, and password. Visiting /go/{slug}: Active + no password → instant redirect. Protected → password screen → correct password redirects; wrong shows error. Expired/paused → friendly info page (no redirect). “My Links” shows accurate counts, QR previews, status, and actions work. Analytics page loads with click graph + simple breakdowns. Admin page shows totals and can disable/delete links; settings toggles apply.