A high-performance, real-time 3D visualization of social media posts using Server-Sent Events (SSE). Built with a modern monorepo architecture to demonstrate production-ready patterns.
This project implements a production-grade, real-time visualization dashboard for social media event streams. It is designed to ingest high-frequency Server-Sent Events (SSE), aggregate them in real-time, and visualize the density of post types over a weekly schedule using a 3D-style calendar heatmap.
The solution is architected as a monorepo to strictly separate the core business logic (data ingestion, validation, aggregation) from the presentation layer. This ensures that the complex stream processing logic is robust, testable, and reusable across different frontend frameworks (React, Vue, Svelte).
The system is built as a Monorepo using Turborepo and pnpm. This structure was chosen to simulate a real-world environment where core libraries are shared across multiple applications or micro-frontends.
packages/core)The "brain" of the application is decoupled from the UI.
SSEClient: Manages the persistent connection.EventAccumulator: Handles real-time data aggregation.StreamService: Orchestrates state and subscriptions.apps/web)The "presentation" layer.
packages/styles)| Decision | Choice | Reasoning |
|---|---|---|
| Package Manager | pnpm | Fast and allows us to use monorepos efficiently. |
| Validation | Zod | Runtime validation is critical for external streams. Zod infers TS types, reducing duplication. |
| State Management | Observer Pattern | The StreamService implements a simple observer pattern, avoiding the overhead of Redux/Vuex for this specific use case. |
Note on the observer pattern:
The observable pattern is a software design pattern in which an object, known as the "subject" or "observable," maintains a list of its dependents, called "observers," and notifies them automatically of any state changes, usually by calling one of their methods.
This pattern is particularly useful for implementing distributed event handling systems, where changes in one part of the system need to be communicated to other parts.
While the current solution is robust, several trade-offs were made to balance complexity with the constraints of the challenge.
EventAccumulator stores all data in memory.IndexedDB (client-side) or a time-series database
(server-side) to allow for historical analysis and session restoration.packages/core (100%
coverage of logic).# Clone the repository
git clone https://github.com/edouardmisset/upfluence-coding-challenge.git
# Install dependencies
pnpm install
# Start development server
pnpm dev
Open http://localhost:4321/upfluence-coding-challenge/ to view the landing
page.
The core logic is fully unit tested using Vitest.
# Run all tests
pnpm test
# Run linting
pnpm lint
# Run formatting
pnpm format
Edouard Misset
Some code was generated with the help of AI tools (GitHub Copilot) to accelerate development. All code has been reviewed and adjusted by the author to ensure quality and correctness.