Wordle Game
In the previous chapter, we added authentication and authorization to a Convex-backed app. In this chapter we switch to a frontend-only app with a small stack, so we can focus on two skills this coursebook has not covered yet: using an AI coding assistant (GitHub Copilot) and writing unit tests with Vitest.
The starter is a Wordle clone that mostly works. We planted a bug in the guess-evaluation logic, in the rule for coloring duplicate letters. We will use Copilot to understand the codebase, debug that bug, write tests that confirm the correct behavior, and add a new feature without reintroducing regressions. We will also build a discipline for using AI responsibly: what to prompt, what to review, what to paste, and when not to use it at all.
Getting Started
Go to the wordle repository and click “Use this template” → “Create a new repository” to create your own copy.
Clone your repository to your computer:
git clone <your-repo-url> wordle
cd wordle
code .
Install dependencies and start the dev server:
pnpm install
pnpm dev
You should see a Wordle-style board with a QWERTY keyboard underneath. That is the starter running. Try a few guesses. You may or may not notice the bug yet; we will find it together in a later section.
If you get stuck at any point, you can view the complete solution on the master branch of the original repository.
Learning Outcomes
- Set up GitHub Copilot in VS Code, including student access, account settings, and sign-in
- Use Copilot’s different modes (chat, #-mentions, slash commands, inline chat, agent mode) to explore, understand, and navigate an unfamiliar codebase
- Apply a review discipline to AI-generated explanations and code changes rather than accepting them at face value
- Use Copilot to diagnose and fix a bug, and verify the fix manually in the browser
- Write and run unit tests with Vitest, including using Copilot to generate test cases that guard against regressions
- Direct Copilot to implement a new feature test-first, and review the resulting diff
- Place Copilot within the broader landscape of AI coding tools and agentic development practices
Sections
- AI Coding Assistants
- Claim Copilot Student
- Configure Copilot on GitHub
- Sign In to Copilot in VS Code
- Open the Chat View
- Attach Files with #-Mentions
- What Copilot Sees
- Ask About useMemo Three Ways
- Play
APPLEAgainstSPEED - Ask Copilot to Fix It
- Why Tests
- Set Up Vitest
- Ask Copilot to Write the Test Cases
- Add Word Validation
- Beyond Copilot