DEV Community

Risbern Fernandes
Risbern Fernandes

Posted on

Stadium Sync

Building StadiumSync: Transforming the Live Stadium Experience with React and Firebase

In the roar of a 50,000-seat stadium, information is often the one thing that doesn't travel fast enough. Whether it's finding the nearest pizza stall, knowing when it's your turn to leave the stand, or coordinating a massive stadium-wide chant, the gap between organizers and fans has traditionally been filled by static signs and overtaxed PA systems.

Enter StadiumSync—a real-time experience platform built to bridge that gap. In this post, I’ll dive into how I built this platform using React, Firebase, and Glassmorphism design to bring the stadium experience into the digital age.


The Vision: Orchestrating the Chaos

Large-scale events are logistical puzzles. The goal for StadiumSync was simple: create a two-sided platform that empowers coordinators to manage the event flow in real-time, while giving attendees a seamless, "no-installation-required" web experience.

Key Pillars:

  1. Real-time Coordination: Broadcast exit instructions and chants instantly.
  2. Interactive Content: Digital menus and venue maps at your fingertips.
  3. Feedback Loop: Instant crowd sentiment collection for organizers.

The Tech Stack

To ensure speed and reliability, I chose a modern, lightweight stack:

  • Frontend: Vite + React for a lightning-fast Single Page Application (SPA).
  • Real-time Database: Firebase Firestore for instant data synchronization across thousands of devices.
  • Cloud Storage: Firebase Storage for high-res venue maps and stall images.
  • Styling: Vanilla CSS with a heavy focus on Glassmorphism. No heavy UI libraries—just lean, high-performance CSS.

Technical Deep Dive

1. Real-time Sync with onSnapshot

The "magic" of StadiumSync comes from Firestore's onSnapshot. We didn't want attendees refreshing the page for updates. When a coordinator changes the "Exit Guide" message, it pulses on every attendee's phone within milliseconds.

// A snippet of how real-time updates are handled in AttendeeView.jsx
useEffect(() => {
  const unsubscribe = onSnapshot(doc(db, "config", "egressMessage"), (doc) => {
    if (doc.exists()) {
      setEgressData(doc.data());
    }
  });
  return () => unsubscribe(); // Clean up listener on unmount
}, []);
Enter fullscreen mode Exit fullscreen mode

2. The "Event Code" Gate

Security doesn't always need to be complex. Since we wanted anyone in the stadium to join without creating an account, we implemented a Code Gate.

  • Coordinators generate a unique session code.
  • Attendees enter the code to unlock the event data.
  • The session is persisted in sessionStorage, keeping the experience friction-free.

3. Glassmorphism & Mobile-First Design

Stadiums are high-energy, dark environments. The UI follows a "Dark Mode" aesthetic with semi-transparent, frosted-glass layers (Glassmorphism). This ensures high legibility and a premium feel while the crowd is under the stadium lights.

We used 100dvh (Dynamic Viewport Height) to ensure the UI fits perfectly on mobile screens, avoiding the "jumping" effect caused by mobile browser URL bars.


Key Features Highlights

Dynamic Chant Broadcaster

Ever wanted to lead a 10,000-person chant? Coordinators can push "Active Chants" to everyone's screen. A "Join" button helps fans stay in sync with the rhythm of the game.

🍔 Digital Stall Menus

No more squinting at distant posters. Attendees can browse all food stalls, view high-res item images, and check prices directly from their seats.

Smart Exit Logic

Post-match congestion is a safety risk. Our real-time Egress Guide allows coordinators to broadcast "Wait" or "Go" instructions stand-by-stand, ensuring a smooth and safe exit for everyone.


Challenges & Lessons

Building for a "Smart Stadium" context reminded me that connectivity is king. By keeping the asset sizes small and relying on Firebase's efficient synchronization, we built a tool that works even on spotty stadium Wi-Fi.

Vanilla CSS was a deliberate choice. It allowed for fine-tuned animations (like the pulsing exit alert) without the overhead of a CSS-in-JS library, keeping the Lighthouse scores high and the "Time to Interactive" low.


Final Thoughts

StadiumSync isn't just a dashboard; it's a bridge between the physical and digital world of live sports. By leveraging real-time cloud tech, we can turn a stressful match-day experience into a seamless, interactive journey.

Built for the Virtual PromptWars Challenge #1 - Physical Event Experience


Check out the project on GitHub: [https://github.com/Risbern21/StadiumSync.git]
Built by: Antigravity AI

Top comments (0)