How barodillah/shortlink works
SLink is a multi-user URL-shortening platform with authenticated user and superuser workflows. Requests enter through the public front controller, are routed to controllers, and produce shortlink management, analytics, account administration, settings, or public redirects. Shortlink redirects and click analytics are major product stages; the README also documents them, though some implementation details were not sampled. The graph distinguishes controller orchestration, models, and persistence. Unsampled controller-to-model links are based on the SOURCE INDEX; uncertain redirect-to-click processing is shown as unverified.
Main entry points: Router.php Router · Database.php PDO connection · Auth.php Session authentication · Shortlink.php Shortlink records
Components 23
HTTP runtime
- Front controller
public/index.php - Router
app/Core/Router.php - Base controller
app/Core/Controller.php - Application views
app/Views
Product workflows
- Authentication
app/Controllers/AuthController.php - Dashboards
app/Controllers/DashboardController.php - Shortlink management
app/Controllers/ShortlinkController.php - Public redirects
app/Controllers/RedirectController.php - Click analytics
app/Controllers/AnalyticsController.php - User administration
app/Controllers/UserController.php - Settings and logs
app/Controllers/SettingsController.php
Domain and access
- Session authentication
app/Core/Auth.php - Access middleware
app/Middleware - Security controls
app/Core/Security.php - URL and parsing helpers
app/Helpers/functions.php
Persistence
- User records
app/Models/User.php - Shortlink records
app/Models/Shortlink.php - Click records
app/Models/Click.php - Activity records
app/Models/ActivityLog.php - Setting records
app/Models/Setting.php - PDO connection
app/Core/Database.php
Other components
- Visitor
- MySQL or MariaDB
Connections 36
- Visitor → Front controller: sends request
- Front controller → Router: dispatches request
public/index.php - Router → Authentication: routes auth
public/index.php - Router → Dashboards: routes dashboard
public/index.php - Router → Shortlink management: routes links
public/index.php - Router → Public redirects: routes code
public/index.php - Router → Click analytics: routes analytics
public/index.php - Router → User administration: routes users
public/index.php - Router → Settings and logs: routes settings
public/index.php - Router → Access middleware: runs middleware
public/index.php - Front controller → Security controls: initializes security
public/index.php - Base controller → Application views: renders views
app/Core/Controller.php - Authentication → Session authentication: authenticates
app/Controllers/AuthController.php - Dashboards → Session authentication: checks identity
app/Controllers/DashboardController.php - Shortlink management → Shortlink records: manages links
app/Controllers/ShortlinkController.php - Shortlink management → User records: checks limits
app/Controllers/ShortlinkController.php - Click analytics → Click records: queries analytics
app/Controllers/AnalyticsController.php - Click analytics → Shortlink records: loads link context
app/Controllers/AnalyticsController.php - User administration → User records: manages accounts
app/Controllers/UserController.php - User administration → Click records: loads trends
app/Controllers/UserController.php - Settings and logs → Setting records: updates settings
app/Controllers/SettingsController.php - Settings and logs → Activity records: queries logs
app/Controllers/SettingsController.php - Session authentication → User records: loads user
app/Core/Auth.php - Session authentication → Activity records: records sign-in
app/Core/Auth.php - Session authentication → PDO connection: checks login attempts
app/Core/Auth.php - Access middleware → Session authentication: checks session
app/Middleware/AuthMiddleware.php - Shortlink records → Security controls: generates codes
app/Models/Shortlink.php - Shortlink records → PDO connection: reads and writes
app/Models/Shortlink.php - User records → PDO connection: reads and writes
app/Models/User.php - Click records → PDO connection: reads and writes
app/Models/Click.php - Activity records → PDO connection: reads and writes
app/Models/ActivityLog.php - Setting records → PDO connection: reads and writes
app/Models/Setting.php - PDO connection → MySQL or MariaDB: connects via PDO
- Public redirects → Shortlink records: resolves destination
app/Controllers/RedirectController.php - Public redirects → Click records: records click
app/Controllers/RedirectController.php - URL and parsing helpers → Security controls: uses validators
app/Helpers/functions.php