An open source Wordle leaderboard application built with React and Firebase Firestore.
Important: don't break it
To test the application locally:
npm run devThis will:
- Generate the version info
- Start the Vite dev server
The app will be available at http://localhost:5173 (or another port if 5173 is busy - check the terminal output).
This Node.js script allows administrators to perform basic database administration tasks on the Firestore database via command line interface.
- Node.js (version 14 or higher)
- Firebase project with Firestore enabled
- Valid
.envfile with Firebase credentials
-
Ensure your
.envfile contains the required Firebase configuration:VITE_API_KEY=your_api_key VITE_AUTH_DOMAIN=your_project.firebaseapp.com VITE_PROJECT_ID=your_project_id VITE_STORAGE_BUCKET=your_project.appspot.com VITE_MESSAGING_SENDER_ID=your_sender_id VITE_APP_ID=your_app_id VITE_MEASUREMENT_ID=your_measurement_id -
Install dependencies:
(sudo) npm install firebase-tools
-
Make the script executable (optional):
chmod +x dba-script.js
Basic syntax:
node dba-script.js <command> [arguments]node dba-script.js collectionsLists all available collections in the database.
node dba-script.js show <collection> [limit]Display documents from a collection (default limit: 10).
Examples:
node dba-script.js show scores 5 # Show first 5 score records
node dba-script.js show scores # Show first 10 score recordsnode dba-script.js get <collection> <documentId>Retrieve a specific document by its ID.
Example:
node dba-script.js get scores iezD4TXVt4CQh62EnNPenode dba-script.js search <collection> <field> <operator> <value> [limit]Search for documents matching specific criteria.
Supported operators: ==, !=, <, <=, >, >=, array-contains, in, array-contains-any
Examples:
node dba-script.js search scores name == "John Doe"
node dba-script.js search scores guesses > 3
node dba-script.js search scores date == "2025-07-09"
node dba-script.js delete scores iezD4TXVt4CQh62EnNPenode dba-script.js add <collection> '<jsonData>'Add a new document to a collection.
Example:
node dba-script.js add scores '{"name":"Jane Smith","guesses":4,"date":"2025-07-11"}'node dba-script.js update <collection> <documentId> '<jsonData>'Update an existing document.
Example:
node dba-script.js update scores iezD4TXVt4CQh62EnNPe '{"guesses":2}'node dba-script.js delete <collection> <documentId>Delete a document from the collection.
Example:
node dba-script.js delete scores iezD4TXVt4CQh62EnNPenode dba-script.js count <collection>Count total documents in a collection.
Example:
node dba-script.js count scoresnode dba-script.js helpDisplay help information and command usage.
-
First, search for suspicious records:
node dba-script.js search scores name == "John Doe" -
Review the results and note the document IDs
-
Delete the unwanted records:
node dba-script.js delete scores <documentId>
node dba-script.js search scores date == "2025-07-11" 20node dba-script.js search scores guesses == 1node dba-script.js search scores guesses > 5The scores collection contains documents with the following structure:
{
"name": "Player Name",
"guesses": 3,
"date": "2025-07-09",
"dnf": false,
"wordleNumber": "1234"
}name(string): Player's nameguesses(number): Number of guesses taken (1-6, or 7+ for DNF)date(string): Date in YYYY-MM-DD format (New Zealand timezone)dnf(boolean): True if player did not finish (DNF)wordleNumber(string|null): Wordle puzzle number (extracted from pasted results or estimated for manual entries)
The annual_winners collection stores yearly champions and is displayed in the Annual Champions table on the Leaderboard tab.
{
"year": 2025,
"name": "Champion Name",
"average": 3.69,
"b_average": 2.81
}year(number): The calendar yearname(string): Winner's full nameaverage(number): Average guesses for the year (calculated from all scores)b_average(number|null): B-average for the year (optional, can be null if not applicable)
To add a new annual winner:
node dba-script.js add annual_winners '{"year":2026,"name":"Jane Smith","average":3.45,"b_average":2.67}'To update an existing winner:
# First, find the document ID
node dba-script.js show annual_winners
# Then update using the document ID
node dba-script.js update annual_winners <documentId> '{"average":3.50}'The training_scores collection stores unlimited practice game results.
{
"name": "Player Name",
"guesses": 4,
"isoDate": "2026-01-16T12:34:56.789Z",
"dnf": false,
"wordleNumber": null,
"hardMode": false,
"trainingMode": true
}name(string): Player's nameguesses(number): Number of guesses takenisoDate(string): ISO 8601 timestampdnf(boolean): True if player did not finishwordleNumber(number|null): Always null for training modehardMode(boolean): Hard mode settingtrainingMode(boolean): Always true for training scores
When scores are submitted, the application automatically posts to Microsoft Teams with:
- Player name and score
- Hostname/computer information
- DNF status (automatically detected for scores > 6)
- No hostname data is stored in the database for privacy
- All dates are calculated using New Zealand (Pacific/Auckland) timezone
- This script uses the client-side Firebase SDK with your project credentials
- Ensure your
.envfile is properly secured and not committed to version control - The script respects Firestore security rules defined in
firestore.rules - Regular backups are recommended before performing bulk operations
- Connection timeout: Large collections may cause timeouts when listing all documents
- Permission denied: Check your Firestore security rules
- Invalid credentials: Verify your
.envfile contains correct Firebase configuration - Document not found: Ensure the document ID is correct and exists in the collection
This is a React + Vite application using Firebase Firestore for data storage.
src/- React application source codepublic/- Static assetsdba-script.js- Database administration scriptfirestore.rules- Firestore security rulesfirestore.indexes.json- Firestore indexes configuration