ShortStream is not just another URL shortener. It is a high-performance System Design Simulator and Analytics Dashboard. While running entirely in the browser for demonstration purposes, it faithfully simulates a production-grade backend architecture involving Redis Write-Through Caching, PostgreSQL Persistence, and Asynchronous Analytics Pipes.
"A masterclass in modern web architecture, visualized."
Simulating a "Hot Path" architecture where 99% of read traffic hits the cache layer.
- Cache Hit (Redis): <50ms latency (simulated)
- Cache Miss (DB): ~800ms latency (simulated)
Visualize your reach with stunning, interactive charts.
- Click Velocity: Track spikes in traffic instantly.
- Device Breakdown: Detailed user agent parsing.
- Geolocation Estimates: IP-based region tracking simulation.
Enterprise-grade URL validation logic.
- Support for
http,https, andlocalhostfor dev testing. - Smart protocol appending (automatically adds
https://if missing). - Malicious pattern detection.
Unique "Glass Box" mode lets you see the code that would be running on the server.
- View actual Prisma Schemas.
- Inspect Redis Controller logic.
- Review Docker Compose configurations.
ShortStream simulates a dual-layer storage strategy maximizing read throughput.
graph TD
User[User Clicks Link] -->|Get /:shortCode| API{API Gateway}
API -->|1. Check Cache| Redis[(Redis Cache)]
Redis -->|Hit| Redirect[Redirect 302]
Redis -->|Miss| DB[(PostgreSQL DB)]
DB -->|Found| CacheWrite[Write to Redis]
CacheWrite --> Redirect
Redirect -.->|Async| Analytics[Analytics Service]
Analytics -->|Batch Write| DB
- Read Path: First lookup is always against the in-memory store.
- Write Path: New URLs are persisted to Disk (DB) immediately.
- Analytics Path: Decoupled from the critical request path to ensure zero latency penalty for users.
- Frontend: React 19, TypeScript
- Styling: Tailwind CSS, Lucide Icons
- Visualization: Recharts
- Build Tool: Vite
- Deployment: Netlify
- Node.js 18+
- npm 9+
-
Clone the repository
git clone https://github.com/yourusername/shortstream-analytics.git cd shortstream-analytics -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000to see the app in action.
| Dashboard | Analytics |
|---|---|
(Note: Replace with actual application screenshots)
