Skip to content

Latest commit

 

History

History
63 lines (39 loc) · 3.27 KB

README.md

File metadata and controls

63 lines (39 loc) · 3.27 KB

Secret Santa PWA

Carry out local and remote Secret Santa draws with your friends and family

The application has been built using the following technologies:

  • React
  • TypeScript
  • CSS-in-JS (styled-components)
  • Vite

Application

Progress Web Application (PWA) which allows you to carry out local and remote Secret Santa draws on iOS, Android and Desktop.

Local

Local draws are carried out and presented on the same device. Once the draw has been completed, each allocation is presented one after another with the device being passed around to each requested participant until everyone knows who they are Secret Santa for.

Remote

Remote draws are carried out on a single device with the resulting allocations being shared with each participant via an encrypted URL (using the Web Share API). When the encrypted URL is visited the participant is presented with a similar screen to a Local draw, where they can reveal who they are Secret Santa for. Being encrypted the user of the device who completed the draw (and tasked with sharing the results) is unable to snoop on each allocation. As all state about the allocation is stored with the URL there is no need for remote state persistence, and the application can remain a simple SPA deployed on GitHub Actions.

History

Each draw is persisted locally on the device using the Web Storage API. This allows the user to retrieve the results again after the draw has taken place. Going forward it may be beneficial to review other means of persisting state on the Web i.e. IndexedDB.

Snowfall

There is a small easter egg on the applications home screen. Using the DeviceMotionEvent when you shake the device, the amount and speed of the snow flawing increases. On iOS the user is required to given permission to the application to read this information, as such, they are required to click the small bottom-right phone icon (if it appears) before shaking the device.

Usage

Allocation

Local

Remote

Other Years

Interested in seeing how I over-engineered the problem of allocating Secret Santa's in other years?