Skip to content

daltonscharff/spell-together

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spell-together

Compete to see who can create the most words using letters from the hive in this multiplayer modification of The New York Times Spelling Bee.

Requirements

Daily Tasks

The production version of this application requires the following daily tasks to be run. These are executed via cron on Supabase.

Load the day's puzzle

Completed by running the load-puzzle function.

Delete puzzles older than 7 days

delete from
  puzzle
where
  date < current_date at time zone 'UTC' - interval '7 days';

Delete rooms which have not been played in 7 days

delete from
  room
where
  id in (
    select
      room_id
    from
      most_recent_correct_guess
    where
      room_created_at < current_date at time zone 'UTC' - interval '7 days'
      AND (
        found_at < current_date at time zone 'UTC' - interval '7 days'
        OR found_at is null
      )
  );

How to Run

1. Server and Database

Provides a Postgres database and a RESTful API.

  1. Make sure Docker is running
  2. Run supabase start

2. Serverless Functions

Scrape puzzle data from the official spelling bee game.

  1. Create a .env.local file
# supabase/.env
ENVIRONMENT=production
  1. Run supabase functions serve load-puzzle --env-file ./supabase/.env to get the function running locally
  2. Run the following cURL request to trigger the function:
curl --request POST 'http://localhost:54321/functions/v1/load-puzzle' \
  --header 'Authorization: Bearer <SUPABASE_SERVICE_ROLE_KEY>' \
  --header 'Content-Type: application/json'

3. Client

  1. Change into the web/ directory
  2. Run yarn install to install dependencies
  3. Create a .env.local file:
# web/.env.local
REACT_APP_SUPABASE_URL=http://localhost:54321  # Supabase API URL
REACT_APP_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1N...  # Supabase anonymous public key
  1. Run yarn start

About

A multiplayer version of The New York Times Spelling Bee.

Topics

Resources

Stars

Watchers

Forks