Alex packs for a few trips a year and always forgets something, whether it’s the phone charger or the swimsuit for a week at the beach. In this course, you build the tool that fixes this: a packing list in the browser where Alex ticks items off by category and sees at a glance what’s still missing.
You start from an empty folder, so before you write any code, you need a plan. In this lesson, you’ll write a one-paragraph pitch, sort Alex’s wishes by need, and sketch the page and the data behind it. You’ll follow this plan through the whole build, and you can reuse the method for a tool of your own. Start with the question every plan answers first: Who is the tool for, and what problem does it solve?
Pitch the Tool in One Paragraph
A tool without a pitch tends to grow in every direction, and you can’t tell which ideas belong. A pitch is a short paragraph that says who the tool is for, what problem it solves, how it solves it, and where it stops. Here’s Alex’s:
A packing list for Alex, who packs for a few trips a year and always forgets something. For each trip, the page lists what to bring, grouped into Clothes, Toiletries, Documents, and Gear. Alex ticks items off while packing and sees how many are packed in each category, so a missing passport stands out before Alex leaves. It runs and keeps its data in Alex’s browser, with no account, no backend, and nothing to install.
The first sentence names one person and one problem. The middle two say what the page does about it, and the last sets the limits, which matter as much as the rest.
No backend means no program of yours runs on a server. While you build, a local server only hands the files to the browser, where the logic runs and saved data stays.
The downside is that the list lives only in that browser on that computer, and clearing the browser’s site data erases it.
The paragraph is worth writing before any code, because the pitch is the test for every idea that comes up later. Say Alex asks for a weather forecast for each trip. A forecast needs data from an internet service, but the pitch keeps the tool in Alex’s browser, so the idea stays out. Without the pitch, you’d have to argue about it from scratch.
Open a notes file or take a sheet of paper, and write Alex’s pitch in your own words. Keep it handy, since the rest of the plan goes under it.
Sort Alex’s Wish List by Need
Alex has plenty of wishes, and building them all at once would mean nothing works for a long time. Here’s the full list:
- Add items to a trip
- Group items by category
- Tick an item off as packed
- See progress per category, such as
Clothes: 3 of 5 packed - Keep several trips and switch between them
- Start a new trip from a template, such as Weekend Away, Beach, or Camping
- Use keyboard shortcuts
- Keep everything after a reload
- Export a backup file and import it again
To decide what comes first, sort each wish into one of three groups. A must is a feature without which the tool doesn’t solve the pitch’s problem. A should is one Alex will miss soon, but the tool helps without it. A could makes the tool quicker or safer to use but isn’t needed for packing.
Alex’s must list includes a form to add items to one trip, category groups with a packed checkbox for each item, and a progress line per category. The shoulds are support for several trips, saving data after a reload, and templates. The coulds are keyboard shortcuts and the backup file. Shortcuts only speed up what the form and checkboxes already let Alex do from the keyboard. Add the three lists to your notes, under the pitch.
Isn’t saving a must? A reload empties the list, after all. But the must list only has to prove that ticking items off by category helps Alex pack, which you can check in one sitting. Saving also depends on the data’s shape, which changes when Alex gets several trips. It’s safer to add saving once the shape has settled.
The sorting also sets the order of this course. You build the must list first, one feature per graded exercise. Each exercise gives you a cut-down, single-file starter. Automated tests run it with Node.js, which runs JavaScript outside the browser. They use jsdom to stand in for a browser page and check what’s displayed.
Once a step passes, you copy its code into the matching file of your own project folder. You serve that folder and open it in Chrome or Edge, and step by step your project grows into Alex’s packing list.
With the must list working, you’ll use the browser’s debugger to find silent bugs that produce wrong numbers without an error message. Then you’ll grow the plan and add the should and could features, again one per step. Putting the packing list online and building your own tool come at the end, and both are optional.
Along the way, you’ll put together what you already know about forms, events, rendering from state, modules, and saving data. All you need is a current version of Chrome or Edge, a code editor, and a local server.
Want to practice sorting features?
Sketch the Page and Its Data
The must list says what the tool does, but not what Alex sees or what the code keeps track of. You’ll write the page so the data is the single source of truth and a render function draws the page from it. So you need both halves before you write any HTML.
Draw the page on paper as boxes, with no colors or styling. From top to bottom, Alex’s page has these parts:
- A heading: The trip’s name, such as Beach Week
- An add form: A field labeled Item for the item’s name, a dropdown labeled Category, and an Add button
- A group per category: A progress line such as
Toiletries: 1 of 2 packed, then one checkbox per item, labeled with the item’s name
Every part of that sketch has to come from somewhere in the data. One trip is an object with a name and an array of items, and each item has a name, a category, and a packed state. Here’s Beach Week with three of its items:
const trip = {
name: "Beach Week",
items: [
{
name: "Swimsuit",
category: "Clothes",
packed: true,
},
{
name: "Sunscreen",
category: "Toiletries",
packed: false,
},
{
name: "Passport",
category: "Documents",
packed: false,
},
],
};
Now match the sketch to the shape. The heading shows trip.name. Each checkbox’s label shows an item’s name, and whether it’s ticked comes from the item’s packed property. The groups come from the items’ category values. The four categories themselves are a fixed list that the form’s dropdown offers.
The progress line is the one part with no property of its own. Instead, the render function calculates the counts from the items every time it draws the page.
Why not store a packedCount too? Because then the same fact lives in two places. Tick a checkbox, forget to update the count, and the page says 0 of 2 packed while both boxes are ticked, without any error in the Console. That’s a silent bug, the kind you’ll hunt later in this course.
The picture below puts the sketch beside the data and draws a line from each part of the page to the data it shows:
Add your sketch and the shape to your notes, under the pitch. You’ll later store trip objects in an array to support several trips, but that’s a should feature, so it can wait.
For a check, the button below opens the mentor with a question already typed. It can’t see your paper, so before sending, list your sketch’s boxes top to bottom and paste your data shape. If the mentor identifies a part of the page with no data behind it, fix your notes before moving on.
Your plan now has a pitch, a sorted wish list, and a sketch of the page and its data, but it doesn’t tell you where to start typing. Even the must list needs a form, state, a render function, and modules, all working together on a served page. If you write all of that before running anything, a mistake anywhere means searching everywhere. So the plan has one last question: What’s the smallest thing that runs end to end, from the data to the page?
In Start a Walking Skeleton, you’ll answer it by building that thinnest working version from an empty folder.