This is an enhanced clone project (forked from here) of the popular word guessing game we all know and love. Made using React, Typescript, Tailwind, Node.js, Express, and Mongoose.
YouTube video explaining my 15 variants (100k+ views!)
YouTube video compacting the above video to 90 seconds (no commentary)
- GitHub: Create an empty repository for the new game
- Terminal: Clone this repository as an independent copy: see below
- Terminal: Run
npm install --legacy-peer-deps
- MongoDB Atlas: Create a new project and cluster under that project: tutorial
- .env: Set
MONGODB_URI
to the cluster URI - Heroku Dashboard: Click
New
>Create new app
to create app - Terminal: Follow
Deploy
instructions in Heroku App Dashboard to connect IDE terminal to app: tutorial - .env: Update
REACT_APP_GAME_NAME
,REACT_APP_GAME_DESCRIPTION
- public/manifest.json: Update
name
,short_name
- src/services/scores.js: Update
baseUrl
- src/lib/share.ts: Update
gameUrl
- src/components/modals/InfoModal.tsx: Update tutorial and GitHub link in InfoModal (JSX Element)
- src/constants/: Update files
- Heroku App Dashboard: Under the settings tab, update the config vars
REACT_APP_GAME_NAME
,REACT_APP_GAME_DESCRIPTION
,MONGODB_URI
,NODE_ENV=production
- Terminal: Commit files (except
MONGODB_URI
in .env file) and rungit push heroku main
Advanced variant changes (such as adding a new language or new rules) will involve changing more components.
git clone https://github.com/Compsciler/Wordle-With-Score-Database.git <game name>
cd <game name>
git remote -v
git remote rename origin upstream
git remote add origin <new remote GitHub URL>
git remote -v
git push -u origin main
- Terminal: Run
cd wordlistgenerator
- (Optional) If using different word lists, use arraytojsonfile.js or another method to create json files of the word lists (constants/combinedwordlist.json is NYT list merged with roughly the first half of the word list currently in use)
- main.py: Write
get_word_list()
function and optionally modify other properties of the file - Terminal: Run
python3 main.py
to get a JSON file of the new word lists - src/constants/: Update src/constants/wordlist.ts and src/constants/validGuesses.ts with the arrays from the new JSON files
- src/constants/validGuesses.ts: Delete file
- src/constants/validChars.ts: Update
VALID_CHARS
- src/components/keyboard/Keyboard.tsx: Uncomment
isValidKey()
function,if (isValidKey(key))
block (and delete previous block), andVALID_CHARS
import - src/lib/words.ts: Uncomment
isWordInWordList
andisValidWord
functions (and delete oldisWordInWordList
function),isValidKey
import
Terminal:
- Run
git fetch upstream
- If on separate branch, run
git checkout main
- Commit changes or run
git stash
- Run
git merge upstream/main
and resolve any merge conflicts - If ran
git stash
for Step 3, rungit stash pop
If you only want to merge a specific upstream commit, for Step 4 instead run git cherry-pick <commit hash> --no-commit
After downloading and opening MongoDB Compass:
- Enter the URI of the MongoDB instance to connect to and click "Connect"
- Click the Databases tab >
myFirstDatabase
>scores
- Click the "Export Collection" icon and export the full collection and all fields to a JSON file (and enter output filename)
Backing up from the terminal (not tested): look into mongodump or mongoexport here: tutorial
MongoDB ObjectId to Timestamp Converter
- Click the Charts tab > "Explore Charts"
- Click the Data Sources side tab > "Add Data Source", and add the collection from your cluster
- Click the Dashboards side tab > "[Your Name]'s Dashboard" > "Add Chart"
- Click "Choose a Data Source", and add your source
- Customize your chart
- Average score by word (treats loss as a score of the maximum number of guesses):
- Chart Type: Column (Grouped)
- X Axis:
solutionIndex
/solution
- Y Axis:
guesses
(Array reductions: array length, Aggregate: mean)
- Average score by word (treats loss as a score of the maximum number of guesses):
This game previously used Rebrandly to create shareable links for each game. The source and destination URLs can be edited in case a game server becomes overloaded and a new game server URL is used. The Rebrandly link dashboard also displays link analytics. Note that support for custom domains and URL parameters requires additional fees.
Clone the repository and perform the following command line actions:
cd Wordle-With-Score-Database
npm install
npm start
In a new terminal:
node ./src/server/index.js
docker build -t reactle:dev -f docker/Dockerfile .
docker run -d -p 3000:3000 --name reactle-dev reactle:dev
Open http://localhost:3000 in browser.
docker build --target=prod -t reactle:prod -f docker/Dockerfile .
docker run -d -p 80:8080 --name reactle-prod reactle:prod
Open http://localhost in browser. See the entry in the FAQ below about requirements for sharing of results.
Bigramle: Words made of 2-letter bigrams
Bigramle+: Words made of 2-letter bigrams (but harder)
Caesardle: Caesar shifted words
Codle: Special-character heavy code
Is That Even a Word? le: Words not in the NYT solution list
Metalloidle: Words made using nonmetal and metalloid elemental symbols
Notwordle: Wordle with 5 very different hints
Numerle: 5-digit numbers, with a binary search aspect
Phone Numble: Phone numbers
Repeatle: Words with duplicate letters
Subredditle: Subreddits
Usernamle: Usernames
Verticle: Vertical guessing mechanics
Worwordle: Fused words (e.g.: FRESH + SHEEP = FRESHEEP)
Worwordle+: Fused words (e.g.: SIREN + RENEW = SIRENEW)
The default configuration is for solutions and guesses of length five, but it is flexible enough to handle other lengths, even variable lengths each day.
To configure for a different constant length:
- Update the
WORDS
array in src/constants/wordlist.ts to only include words of the new length. - Update the
VALID_GUESSES
array in src/constants/validGuesses.ts to only include words of the new length.
To configure for variable lengths:
- Update the
WORDS
array in src/constants/wordlist.ts to include words of any of the variable lengths desired. - Update the
VALID_GUESSES
array in src/constants/validGuesses.ts to include words of any of the variable lengths desired.
Note that guesses are validated against both the length of the solution, and presence in VALID_GUESSES.
- In .env:
- Update the title and the description
- Set the
REACT_APP_LOCALE_STRING
to your locale
- In public/index.html:
- Update the "You need to enable JavaScript" message
- Update the language attribute in the HTML tag
- If the language is written right-to-left, add
dir="rtl"
to the HTML tag
- Update the name and short name in public/manifest.json
- Update the strings in src/constants/strings.ts
- Add all of the five letter words in the language to src/constants/validGuesses.ts, replacing the English words
- Add a list of goal words in the language to src/constants/wordlist.ts, replacing the English words
- Update the "Settings" modal in src/components/modals/SettingsModal.tsx
- Update the "Info" modal in src/components/modals/InfoModal.tsx
- Update the statistics migration components modal in:
- To ensure that migration codes are unique to your application, update the Blowfish encryption key and initialization vector with random 30 character and 8 character strings in src/constants/settings.ts
- If the language has letters that are not present in English update the keyboard in src/components/keyboard/Keyboard.tsx
- If the language is written right-to-left, prepend
\u202E
(the unicode right-to-left override character) to the return statement of the inner function ingenerateEmojiGrid
in src/lib/share.ts
This repository includes support for Google Analytics or Plausible Analytics, but, by default, this is disabled.
To enable Google Analytics:
- Create a Google Analytics 4 property and obtain the measurement ID (of the format
G-XXXXXXXXXX
) - In .env, add
REACT_APP_GOOGLE_MEASUREMENT_ID=G-XXXXXXXXXX
Keep in mind that your region might have legislation about obtaining a user's consent before enabling trackers. This is up to downstream repos to implement.
To enable Plausible Analytics:
- Create a new website with Plausible Analytics with a given domain, e.g.
example.app
- In .env, add
REACT_APP_PLAUSIBLE_DOMAIN=example.app
For mobile and wearable devices and smart TVs, sharing of results is initially attempted using the Web Share API. For other devices or when sharing to the Web Share API fails, the results are written to the clipboard. Both these methods will succeed only in a secure context, which require you to implement the HTTPS protocol when hosting this repo on a public domain.