$ show spatie/dashboard.spatie.be
This is a production Laravel application that powers the real-time office dashboard at Spatie (dashboard.spatie.be). It displays a rotating set of screens on a wall-mounted TV, showing team member statuses, GitHub/Packagist statistics, climate data, cookie club ratings, now-playing music, Officient calendar attendance, Oh Dear uptime alerts, and product analytics from Fathom. The architecture is a monolith built on Laravel 12 with Livewire 4 for reactive components, Tailwind CSS 4 for styling, and Pusher/WebSockets for real-time updates. Key entry points are the main dashboard route (/) and webhook endpoints for now-playing songs and Oh Dear alerts. Data flows from external APIs (Fathom, GitHub, Packagist, Slack, Officient, Apple Music, Last.fm, climate sensors, Cookie Club) into database-backed tile stores, which are polled by Livewire components. The system includes a screen scheduler with conditional visibility, a weekplanning overlay, and a deploy-status endpoint for automatic page reloads. The codebase is well-structured, follows Laravel conventions, and includes comprehensive tests. While the dashboard is tailored to Spatie's internal use, many components (Fathom analytics service, forecast calculator, path normalizer, screen availability checker, weekplanning logic) are cleanly abstracted and could be reused in other dashboard or analytics projects.
The LLM identified 5 files worth highlighting for reuse:
A service that aggregates Fathom analytics data (daily, live, top pages, traffic sources) with a sophisticated caching strategy using Laravel's flexible cache (fresh-for/stale-for durations). It handles path normalization, groups rows by label, and computes forecasts. The class is well-structured with dependency injection and could be extracted for any Fathom-based analytics dashboard.
A standalone calculator that forecasts end-of-day visit totals based on historical data from matching weekdays. It accounts for DST day length variations and returns forecast value, typical baseline, comparison percentage, and remaining fraction. This is a pure, testable class with no framework dependencies, easily reusable in any analytics context.
A utility that normalizes URL paths by replacing dynamic segments (numeric IDs, UUIDs, ULIDs, long hex strings) with a placeholder ':id'. This is essential for grouping analytics page views by route pattern rather than individual instances. The class is pure PHP with no dependencies, directly reusable in any analytics pipeline.
A service that determines which dashboard screens are currently available based on configurable conditions. It uses a ScreenCondition interface to allow any screen to define its own availability logic (e.g., only show now-playing when a song is active). This pattern cleanly separates screen availability from rendering and can be reused in any multi-screen dashboard system.
A utility that determines whether the current time falls within a configurable weekly planning window (e.g., Monday 12:00-12:15 for team standup). It also calculates milliseconds until the next transition, enabling auto-reload. The class is well-abstracted with configurable day, time, and timezone, making it reusable for any time-window-based feature toggling.