Loading video player…

Finding Your Way Around a Codebase You Didn't Write (Overview)

It’s your first morning on the small tech team at The Second Draft, an independent bookshop. Grace owns the shop. She isn’t a developer, and she has a question for you: “How does a discount code actually get applied to an order? A customer says her code didn’t work.”

The answer is in code you didn’t write. Ada wrote most of it before she moved to another job, and Quill, the team’s AI coding agent, proposes changes when someone asks. Nobody expects you to have the whole picture yet.

This course takes you through your first days at the shop. By the end, you’ll answer Grace’s question with a one-page explanation she can hand the next new hire. Along the way, you’ll find the code behind something you can see on screen and follow one order from a click to the file where it’s stored. You’ll also check an explanation of code before you repeat it, whether it comes from a teammate, a README, or an AI assistant.

Why This Matters

You might be here because you’ve joined a team whose codebase is bigger than anything you’ve written. Or you might be starting to work with AI agents and want to understand, and own, the code they hand back. Either way, you’ll need to answer one question about any explanation you give. Can you put your name on it?

That question runs through this course and the four that follow it on the path, all set in the same repository. This first course explores a shop that works. In later courses, you’ll debug it, test a new feature, and review proposed changes. Across the path, you judge Ada’s older code and Quill’s changes the same way, by whether you can explain the code and back that up with a check.

What You’ll Learn

By the end of this course, you’ll be able to explain how a feature of an unfamiliar codebase works, from the user’s action to the stored data, naming the files, the functions, and the rules the code relies on. You’ll also check that explanation, including one from Code Mentor, against the code and a run.

The course is one path through the shop, from your first run to Grace’s answer:

  1. Getting Your Bearings: Run the shop, search for the code behind what you see, choose how closely to read, and check Code Mentor’s explanations claim by claim.
  2. Following a Feature Through the Code: Trace one order from a click to a stored file, map the shop’s modules, follow one price to the screen, and find the rules its data must follow.
  3. Project: Explaining a Discount to Grace: Use everything from the first two sections to answer Grace’s question about discount codes.
  4. Reviewing What You’ve Learned: Test yourself across the course, then put together the routine you can take to the next codebase.

In the project, you’ll trace a discount code from the staff desk’s order form to the stored order and list the rules it relies on. You’ll ask Code Mentor to explain those rules, check every claim in its answer, and write Grace her page. Then Edsger, a senior colleague, will read your page with you and ask the questions the next new hire would. You won’t change any code.

The Second Draft is small, with about 1,200 lines in 58 files. However, it’s built like a production codebase, with several authors, a readable history of code changes in Git, and notes that aren’t always up to date. Every answer you give about it ends in something you checked, such as a line you found, a run you made, or a stored record.

Where the Code Comes From

The code is The Second Draft’s GitHub repository, realjs/second-draft-books. You’ll clone it in the next lesson, which walks you through every command, and you’ll work in that copy for the rest of the course. There’s no code download for this course, so you don’t need to look for one.

How the Course Works

Most lessons are text that you read alongside your own copy of the shop, running it as you go. Four more videos show what’s easier to watch than to read: searching the code for something you can see, asking Code Mentor and checking its answer, tracing one order through the code, and following one price to the screen. Below each video, a short text holds its key points.

After most lessons comes an exercise. You type answers into an editor in the browser and click Run Tests to check them. When a test fails, its message is a clue to what to look at again, so run the tests early and often. Full screen gives the editor more room. The first exercise walks you through all of this.

Two quizzes check your understanding, one after the first section and one near the end. You’ll also keep a map, a notes file that starts with one question and grows into your picture of the whole shop.

Code Mentor, RealJS’s AI mentor, is your reading partner. Buttons in the lessons open it with a question ready to edit or send. You’ll treat its answers like a colleague’s notes. They’re useful, and you’ll check them against the code and a run before you rely on them.

What You Should Know Already

You don’t need anything beyond JavaScript basics: functions and return values, if blocks, for...of loops, arrays and objects, including lists of records, and modules with import and export.

You should be able to run a script with Node.js, read an error message, use console.log(), and check a result against one you worked out by hand.

If any of that feels shaky, Functions in JavaScript and Records With Objects cover most of it.

You’ll need Node.js 22 or later, as the shop’s README asks, along with Git, a terminal, a code editor, and a browser. The examples use Node.js 26. You don’t need other Git experience, a debugger, or any testing background.

If you’ve never opened a codebase this size, that’s the situation this course is built for. Every new part of the shop arrives with a named place to start. To check whether you’re ready, press the button below:

Your first job at The Second Draft is to run the shop before you read any of its code. Next comes Start From Something That Works, where you’ll clone the shop’s repository, start it, and place your first order as staff would.

Download

Course Slides (.pdf)

2.3 MB

Become a Member to join the conversation.