The Goal
Your team is building a web-based word game. Every day there is one secret five-letter word. A player gets six guesses. After each guess, every letter turns a color: green if it is in the right spot, yellow if it is in the word but in a different spot, gray if it is not in the word at all.
Players log in, play once a day, and build a win streak. An administrator manages the word list, the members, and the leaderboard.
You get the word tables. Everything else is yours to design and build: the pages, the other tables, the look, and the code.
At a glance
- Team: 2 people (a 3rd may be added)
- Time: 12 school days, ending in a live demo
- Built with: WebDNA on the server, plus your own HTML, CSS, and JavaScript. No outside libraries or frameworks.
- Lives in: your team folder on citicoding.org
You will build it in three parts
- UI: what the player and admin see. The game board, the on-screen keyboard, messages, login, stats, the leaderboard, admin pages, and at least two themes. Go →
- DNA / Data: the real game. Today's word, checking guesses on the server, saving every game, streaks, members, and the admin tools. Go →
- JavaScript: make it feel like a game. Typing on the real keyboard or the on-screen one, filling tiles, and coloring the keys. Go →
The one rule that shapes everything
The secret word must never reach the browser while a game is being played. Not in the page, not in a hidden field, not in a script, not in a cookie. The server checks every guess and sends back only the colors. When the game is over (win or lose), the server may reveal the word. If a player can find the answer with View Source, the game is broken.
Team Rules
Your team, your roles
Your team picks its own roles. One way to split it: one person leads the game page (board, keyboard, JavaScript), one leads the data (tables, scoring, streaks), and you both build admin pages. Any split works if everyone writes real code and can explain it.
If a third member joins your team, the project does not change. They join the team and pick up work you already have.
One team, one grade
The grade is per team. Everyone on the team gets the same score, so everyone owns the whole project, including the parts a teammate wrote.
Working in a shared folder
- Your teacher sets up your team folder. All your files live there.
- Agree on who edits which file. Two people saving the same file at the same time means one of them loses their work.
- Always download the newest copy from the server before you edit a file.
- Keep a backup of anything you are about to change.
AI rule for this project
No AI to write your code. You may use AI only to help you debug: to explain an error message or help you find why something you wrote does not work. You may not ask it to write a page, a feature, or a fix for you. On Demo Day, any member can be asked to explain any line.
0Start Here
- Find your team folder. Your teacher will give you the path once teams are set.
- In your team folder, make a folder called
databases. All of your tables go in there.
- Download wordle_tables.zip and unzip it. It holds three tables:
word.db, dailyword.db, and validwords.db. Upload all three into databases/.
- Do not open the tables in your editor and save them. If your editor changes line endings or tabs, WebDNA can stop reading the file. Messed one up? Download the zip again for fresh copies.
- Open your live URL in Chrome and keep it open the whole time. WebDNA only runs on the server, so always test the live page.
About apps
This handout names the job, not the app. “Upload” means sending files to the server over SFTP. “Your editor” means any plain-text editor.
Know Your Data
The answer list: word.db (1,000 words)
Every word that can be a puzzle answer. Field names are the exact spelling in the file.
| Field | What it holds |
| sku | Record number. WebDNA makes it. |
| title | The five-letter word, in capital letters, like ABACK |
| status | 1 = active, 0 = turned off. A turned-off word is never picked as an answer. |
| createdate | The day the row was added |
| moddate | The day the row was last changed |
The daily puzzle: dailyword.db (starts empty)
One row per day: which word is that day's puzzle. It comes with only its header row. Your game fills it.
| Field | What it holds |
| sku | Record number. WebDNA makes it. |
| r_word | The sku of a word in word.db, not the word itself |
| displaydate | The day this word is the puzzle, written like 11/08/2026 |
| status | 1 = active |
| createdate | The day the row was added |
| moddate | The day the row was last changed |
The two tables are linked, just like roster and district. In word.db, sku is the primary key. In dailyword.db, r_word is a foreign key that points at it. If today's row has r_word 457, look up sku 457 in word.db to get the word.
How today's word works
- Look for today's row in dailyword.db, by displaydate.
- Found it? Look up its r_word in word.db. That is today's word.
- Not there yet? This is the first visit of the day. Pick a random active word from word.db, one that has not been used on an earlier day, and add today's row. From now on, everyone gets that word today.
The valid-guess table: validwords.db
| Field | What it holds |
| sku | Record number |
| word | A real five-letter word, in capital letters |
About 8,600 real five-letter English words, including every word in word.db. A guess counts only if it is in this table. It is read-only: your pages search it but never change it.
The tables you design
Everything else is up to your team. You will need somewhere to keep, at least:
- Members: who can log in, and who is an admin.
- Games: which member played which day's word, and how it ended.
- Guesses: every guess in every game, so a game can be picked up again after a refresh.
- Streaks: each member's current win streak and best streak (or a way to work them out from the games).
Use the field-naming habits you already know: a sku in every table, status, createdate, moddate, and r_ for any field that points at a row in another table. Draw your data map before you build.
Watch your table names
Some names are reserved by WebDNA. A table named users.db will silently refuse to save anything. Give your tables names that start with something of your own, like wd_members.db.
How the Game Plays
The basics
- Every word is 5 letters. A player gets 6 guesses.
- A guess must be exactly 5 letters A to Z, and a real word. If it is not, show “Not in word list” and do not use up a guess.
- Every logged-in player gets the same word on the same day, and can play it once.
- Leave and come back (or press Refresh) mid-game, and the board is exactly where you left it.
- A win or a loss ends the day's game. A finished game can be looked at, but no more guesses are allowed.
- On a loss, reveal the word.
Coloring a guess, including repeated letters
Color a guess in two passes:
- Greens first. Any letter in the right spot is green. That letter of the answer is now used up.
- Then yellows. Go through the other letters left to right. A letter is yellow only if the answer still has an unused copy of that letter. Mark that copy used. Otherwise, gray.
This is why you can't just ask “is this letter in the word?” Your game must pass all three of these:
Answer ABIDE, guess SPEED. ABIDE has only one E, so only the first E is yellow.
SPEED
gray, gray, yellow, gray, yellow
Answer APPLE, guess PAPER. The middle P is green. The first P is yellow because APPLE still has a second P.
PAPER
yellow, yellow, green, yellow, gray
Answer SPEED, guess EERIE. SPEED has two Es, so two Es are yellow and the third is gray.
EERIE
yellow, yellow, gray, gray, gray
The keyboard remembers
Each on-screen key shows the best thing the player has learned about that letter: green beats yellow, yellow beats gray. A key that turned green never goes back to yellow.
Win streaks
- Win today's game and your streak goes up by one.
- Lose a game, or skip a day, and your streak goes back to 0.
- Keep each member's best streak too.
Testing mode: a new random word
You can't test a once-a-day game once a day. Build a way to start a new game with a random active word. Only admins can use it. A random-word game is practice: it never counts toward a streak or the leaderboard, and it never uses up the player's real game for today.
1UI: What the Player and Admin See
Goal: every page looks finished and is easy to use. A new player should know how to play without being told. The look is your team's choice.
Player pages
- Login. A login page with a username and password. Use made-up test passwords only, never a real one. Show a clear message for a wrong login.
- The board. A grid of 6 rows of 5 tiles. Filled tiles show their letter. Scored tiles show their color.
- The on-screen keyboard. All 26 letters plus Enter and Backspace, laid out like a keyboard. Keys show their best color.
- Messages. “Not in word list,” “Not enough letters,” a win message, and a loss message that shows the word. Messages must be easy to see and easy to tell apart.
- Stats. The player's current streak and best streak, where they can see them.
- Leaderboard. A page that lists members by current streak, highest first, with their best streak beside it.
- Practice is clearly practice. When an admin is playing a random-word game, the page says so, so nobody mistakes it for today's real game.
Themes
- At least two CSS themes (for example, light and dark, or two styles of your own) that a player can switch between.
- The choice sticks. Leave and come back, and the page is still in the theme the player chose.
- Colors still read. In every theme, green, yellow, and gray tiles are easy to tell apart, and text is easy to read.
Admin pages
- A clear admin area, with a menu to the three admin pages. Players never see a link to it.
- Words page. Find a word, see each word's status, and see the puzzle history (which word was used on which day).
- Members page. List every member with their admin setting and status.
- Leaderboard / streaks page. Every member's current and best streak, with admin controls.
Done with Part 1 when
- Login, board, keyboard, messages, stats, and leaderboard pages are all built and readable.
- At least two themes work, the choice is remembered, and tile colors read in each one.
- The three admin pages are built and easy to tell apart from player pages.
2DNA / Data: The Real Game
Goal: the server runs the game. It finds today's word, checks each guess, colors it, saves it, and keeps the streaks. JavaScript can't change the answer or the score.
The game
- Today's word. Follow How today's word works in Know Your Data. dailyword.db must never get two rows for the same day, and a word used on an earlier day is never picked again.
- Check the guess. On the server: exactly 5 letters A to Z (anything else is refused), and found in
validwords.db.
- Color the guess on the server, using the two-pass rule. All three example guesses from How the Game Plays must come out right.
- Save every guess with its colors, linked to the member's game for that day.
- Pick up where they left off. When the page loads, rebuild the board and keyboard from the saved guesses.
- One real game per day. A member who finished today's game can't start it again, and nothing they send can add a seventh guess.
- Keep the answer secret. View Source, cookies, and hidden fields never show the answer until the game is over.
- Refresh never repeats a guess. After a guess is saved, send the browser back to the game page.
Members and streaks
- Login. Check the username and password against your members table. Remember the logged-in member with cookies. Every game page needs a logged-in member. No login, no game.
- No duplicate usernames.
- Update the streak when a real game ends: win adds one, loss resets to 0, and a missed day resets to 0. Update the best streak when the current one passes it.
- Practice games never touch streaks.
Admin
- Admins only. Every admin page checks that the logged-in member is an admin. Typing an admin page's address as a regular player, or with no login, must not show it.
- Word list: add a word to word.db, edit one, and turn one off or back on. A word an admin types must be 5 letters A to Z. Update moddate on every change. Also show the puzzle history: each day in dailyword.db with its word.
- Members: add a member, edit one, make someone an admin (or not), turn a member off, and reset a password.
- Leaderboard / streaks: reset a member's streak, and remove a member from the leaderboard by turning them off.
- Random-word testing mode, as described in How the Game Plays.
Every page
- Encode what you save. A member name like O'Brien & Sons saves and comes back exactly as typed.
- Handle fields that were never sent. Open each page with nothing sent. No square-bracket names may show.
- Close your databases at the end of every page that uses them.
- View Source on every live page: no square brackets anywhere.
Done with Part 2 when
- Today's word comes from the table, and every member gets the same one.
- Non-words are refused without using a guess; all three color examples are right.
- Refresh restores the board and never repeats a guess; a finished game can't be replayed.
- The answer can't be found in View Source mid-game.
- Streaks and best streaks update correctly; practice games don't count.
- Admin pages are locked to admins and every admin tool works.
3JavaScript: Make It Feel Like a Game
Goal: playing feels quick and smooth. JavaScript handles typing and showing. It never decides the colors. Those come from the server.
Watch out
WebDNA reads your whole page before the browser does, JavaScript included. Anything in square brackets inside your script can be read as a WebDNA tag. Write your JavaScript so it needs no square brackets, or keep it in its own .js file.
- Type on the real keyboard. Letters fill the current row, Backspace removes one, and Enter sends the guess.
- Click the on-screen keyboard. It does exactly the same thing.
- Stop bad guesses early. A sixth letter is ignored. Enter with fewer than 5 letters shows “Not enough letters” and sends nothing. (The server still checks everything.)
- Color the keyboard from the colors the server sent back, using the best-color rule.
- No typing after the game ends.
- The browser console shows no red errors.
Done with Part 3 when
- The real keyboard and the on-screen keyboard both play the game.
- Short guesses are caught before sending; extra letters are ignored.
- Keys show their best color, and nothing can be typed after the game ends.
- No console errors.
Demo Day
On the last day, your team shows the game live, on the server, to the class. Plan for about 5 to 8 minutes. Every member presents part of it.
Show all of this
- Log in as a player and play today's game.
- Try a non-word and a 4-letter guess. Neither uses up a guess.
- Refresh in the middle of a game. The board comes back.
- Show your streak and the leaderboard.
- Prove the repeated-letter rule with one of the three example guesses (use testing mode or the admin word page to set it up).
- Log in as an admin and walk through the words, members, and streaks pages.
- Switch themes.
- Tell us one problem you hit and how your team solved it.
Then answer questions. Anyone on the team can be asked to explain any part of the code.
Grading
One grade for the whole team.
| Part | Points | What earns them |
| 1 · UI | 30 | Login, board, on-screen keyboard, clear messages, stats, leaderboard, practice label, two working themes that are remembered, three admin pages |
| 2 · DNA / Data | 50 | Today's word, valid-guess check, server-side coloring with repeated letters, saved and restored games, one game a day, secret answer, login, streaks, admin-only pages, word / member / streak tools, testing mode, encoded saves, no stray brackets |
| 3 · JavaScript | 15 | Real and on-screen keyboard input, early checks, keyboard colors, locked after game ends, no console errors |
| Demo | 5 | Live demo of every item in Demo Day; every member presents and can explain the code |
What this project proves
Technical Assessment (Web Development 2):
Program Skills: Design a relational database (4), Write and execute database queries (5), Validate and debug my own work (7), Write JavaScript that responds to a user (8), Present a technical decision to a client (10), Meet a deadline, and Collaborate without taking over.
Am I done? Check before Demo Day
- Every member of our team gets the same word today, and the answer is not in View Source.
- Non-words and short guesses are refused without using a guess.
- ABIDE/SPEED, APPLE/PAPER, and SPEED/EERIE all color correctly.
- Refresh brings the board back and never repeats a guess.
- A finished game can't be played again today.
- Streaks and best streaks are right; practice games don't count.
- The leaderboard lists members by current streak.
- A regular player can't open any admin page by typing its address.
- Admins can manage words, members, and streaks, and start a random-word practice game.
- Two themes work and the choice is remembered.
- The real and on-screen keyboards both work, and keys show their best color.
- No square brackets in View Source; no red errors in the console.
- Every member can explain every part of the code.