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.
The production version of this application requires the following daily tasks to be run. These are executed via cron on Supabase.
Completed by running the load-puzzle function.
delete from
puzzle
where
date < current_date at time zone 'UTC' - interval '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
)
);Provides a Postgres database and a RESTful API.
- Make sure Docker is running
- Run
supabase start
Scrape puzzle data from the official spelling bee game.
- Create a
.env.localfile
# supabase/.env
ENVIRONMENT=production
- Run
supabase functions serve load-puzzle --env-file ./supabase/.envto get the function running locally - 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'
- Change into the
web/directory - Run
yarn installto install dependencies - Create a
.env.localfile:
# web/.env.local
REACT_APP_SUPABASE_URL=http://localhost:54321 # Supabase API URL
REACT_APP_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1N... # Supabase anonymous public key
- Run
yarn start- the application should be available at http://localhost:3000