DEV Community

Maheswari-23
Maheswari-23

Posted on

TTConnect-Real-Time Office Table Tennis Matchmaking System

DEV Weekend Challenge: Community

TTConnect – Real-Time Office Table Tennis Matchmaking System

This is a submission for the DEV Weekend Challenge: Community

The Community

TTConnect is built for office employees who regularly use a shared Table Tennis table during breaks.

In many workplaces, recreational spaces are limited resources. A single table often serves multiple teams, which leads to coordination issues such as:

  • Difficulty finding players at the same time
  • Manual coordination through chat tools
  • Confusion over turn-taking
  • Lack of fairness in rotation

TTConnect addresses these problems by introducing a structured, automated system for match scheduling and queue management. The goal is to make recreational play more organized, fair, and accessible within the workplace community.

What I Built

TTConnect is a real-time Table Tennis matchmaking web application built using the MERN stack.

The system allows employees to create:

  • Singles matches (2 players)
  • Doubles matches (4 players)

Each match has a fixed duration of 20 minutes.
The system handles:

  • Player allocation
  • Queue management
  • Automatic promotion on cancellation
  • Push notifications for match coordination

The application ensures efficient usage of shared office resources while minimizing manual intervention.

How the System Works
Match Creation

A user creates a match by selecting:

Match mode:Singles (2 players) or Doubles (4 players)

Scheduled start time

Each match automatically has a fixed duration of** 20 minutes**.

Once created, a push notification is broadcast to all registered users via Firebase Cloud Messaging (FCM). Notifications are delivered even if the browser is minimized or closed.

The notification displays:

  • Match mode
  • Scheduled start time
  • Duration (20 minutes)
  • Response options: Yes (Join) or No (Decline)

Users can respond directly from the notification interface.

Player Allocation Logic

The allocation follows a first-come, first-served model:

  • For Singles mode: The first 2 users who respond “Yes” are confirmed.
  • For Doubles mode: The first 4 users who respond “Yes” are confirmed. If additional users respond “Yes” after the limit is reached, they are placed into a FIFO (First-In-First-Out) waiting queue.

Queue and Cancellation Handling

Confirmed players can cancel before the match begins.

If a confirmed player cancels:

  • The next user in the waiting queue is automatically promoted.
  • If multiple users remain in the queue after a match begins:
  • Once the current 20-minute match ends
  • The system automatically creates the next match slot
  • The required number of players are selected from the queue in FIFO order
  • These players receive confirmation notifications with the new scheduled time

This ensures fairness, continuous rotation, and optimal utilization of the table.

Demo

Live Application:
[https://ttconnect-1.onrender.com]

Note:
Recommended browser: Chrome (FCM token storage issues may occur in Bing).
Ensure you click “Allow” when the browser prompts for notification permission.

Code

Source Code Repository:
[https://github.com/Maheswari-23/TTConnect]

How I Built It
Frontend

  • React
  • Vite
  • CSS

Backend

  • Node.js
  • Express.js
  • Custom middleware for route protection

Database

  • MongoDB Atlas

Authentication

  • JWT for secure session management
  • bcrypt for password hashing

Notifications

  • Firebase Cloud Messaging (FCM) for real-time push notifications

Impact

  • TTConnect improves workplace community engagement by:
  • Structuring informal recreational activities
  • Ensuring fair player rotation
  • Reducing coordination overhead
  • Automating scheduling and queue handling

It transforms an unstructured break-time activity into a system-driven, community-focused experience.

Top comments (0)