Pixel Placer

Created for the EdgeDB Hackathon (June 12, 2024)

The Team

Description

Pixel Placer is a collaborative digital canvas where multiple users can unleash their creativity together. However, there's a unique twist: pixels are a limited resource where users can only hold five at a time, with one pixel being added to their bank every thirty seconds. For Pixel Placer, we utilized EdgeDB for handling user identity and authentication, as well as for persisting canvas data to determine pixel placement. We implemented EdgeDB constraints on the Pixel type to ensure uniqueness in X and Y coordinates. Additionally, EdgeDB managed the relationship between users and their Pixel Bank, which tracked the number of available pixels and the last time a pixel was awarded to a user.

Challenges

At the time of the hackathon, Vercel does not support websocket connections, which adds a unique challenge to a "live updating" project like this one. Our workaround? Delta updates! We keep track of the last time a pixel was updated in the database, and we have the client send a "from" timestamp, which we use in the database query to only return pixels that have been updated since the client last requested them.

Links