Shipping a complete app, the capstone

Advanced · 4 min

Launch Taskboard with a definition of done, a release order, a smoke test for each tier, a rollback plan and a first-week watch list.

Before thisA security review before launchContinuous integration for a full-stack repoObservability across layersFrom requirements to a buildable plan

ByteByteGo · 4 min

Shipping a complete app, the capstone

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by ByteByteGoReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • Launching is a sequence of reversible steps, so write the release order and the rollback for each step before launch day instead of during it.
  • Define done as observable behaviour, such as a user signing up, paying and finding their data after a reload, not as a list of finished tickets.
  • A post-deploy smoke test that exercises the health route, a page and a write-then-read through the database proves the tiers are connected, and it must fail loudly when they are not.
  • Know your rollback for each tier: the previous build for code, and a restore or an expand-and-contract schema for data, since code rollbacks are easy and data rollbacks are not.
  • After launch, watch error rate, latency and the job queue for the first week, and treat what real users hit as the input to your next plan.

What the capstone is

By now Taskboard has most of what a real product has: a plan, a monorepo, a typed API, a data layer, sign-in, an interactive client, tests, CI, a deployed three-tier setup, backups and observability. The capstone is not another feature. It is the act of putting it in front of real users on purpose, without improvising.

The core problem of a launch is that many correct parts must come together in the right order, once, while someone is watching. Launch days go badly when people try to remember things. They go well when the plan is written down and mostly dull.

1. Define done as behaviour

“All tickets closed” is not done. Write a handful of sentences that are true of a working product, and check them in production:

  1. A new visitor can sign up, receive the welcome email, and sign in.
  2. A signed-in user can create a project, add tasks, comment and attach a file.
  3. After a reload, on another device, their data is still there.
  4. A second user cannot see the first user’s project.
  5. A user can upgrade to the Team plan and the plan changes within a minute.
  6. If the API restarts mid-session, the user stays signed in.

Each sentence maps to a lesson and a test you already have: sign-up and sessions, forms and optimistic updates, authorization, payments with webhooks, background email. The browser tests from end-to-end tests with Playwright are these sentences made executable.

2. Freeze, then walk the gates

A few days before launch, stop adding features and run through the gates. Each is a lesson in this roadmap:

Gate Evidence
Tests pass on a clean machine CI is green on main (CI lesson)
Security pass done, findings fixed The checklist in a security review before launch
Staging mirrors production Same code, own database and keys (environments)
Domain and certificate valid The padlock, with an expiry alert set
A backup has been restored A drill, with the date written down (backups)
Alerts reach a person Trigger one on purpose (observability)
Migrations are safe to apply live Expand and contract (zero-downtime)
Production secrets exist only in production Checked in the host settings

If a gate is red you decide, in daylight, whether to fix or to accept the risk and write it down. That decision is the point.

3. The release order

A first launch is the same as any deploy, with more care. For Taskboard:

  1. Take a backup or snapshot of the production database. Even an empty one proves the mechanism.
  2. Apply migrations as their own step.
  3. Deploy the API. Wait for the health check.
  4. Deploy the client.
  5. Run the smoke test.
  6. Only then announce.

The order matches deploying the three tiers: data first, then API, then the client that depends on it.

4. A smoke test you can run in ten seconds

A health endpoint proves a process is up. After a deploy you want to know the tiers are wired together. I wrote a small script that checks three things, and ran it against a local copy of Taskboard:

// smoke.ts — node/tsx smoke.ts https://staging.taskboard.example
const steps = [
  ["health", async () => { const r = await fetch(base + "/health"); if (!r.ok) throw new Error(String(r.status)); }],
  ["home page serves html", async () => { /* content-type includes text/html */ }],
  ["write then read through the database", async () => {
    const title = "smoke-" + Date.now();
    const w = await fetch(base + "/api/projects/1/tasks", { method: "POST",
      headers: { "content-type": "application/json" }, body: JSON.stringify({ title }) });
    if (w.status !== 201) throw new Error("write " + w.status);
    const rows = await (await fetch(base + "/api/projects/1/tasks")).json();
    if (!rows.some((t) => t.title === title)) throw new Error("row not found");
  }],
];

With the server up it printed three ok lines and exited 0. With the server stopped, all three printed FAIL ... fetch failed and the exit code was 1. That exit code is what lets CI or a deploy script stop and roll back automatically. In your real setup, point it at a dedicated smoke-test project and sign in with a test account, because writing into a user’s real project is not acceptable. The full set of journeys stays with the browser tests. The smoke test is the quick tripwire that runs after every deploy.

5. Know how to go back

Decide the rollback for each tier before you need it.

  • Client. Redeploy the previous build. Static hosts usually keep prior deployments and promote one with a click.
  • API. Redeploy the previous image or commit. This works only if the schema is compatible with both versions, which is exactly what expand and contract gives you.
  • Database. There is no rewind for rows written since the release. If a migration was destructive, your options are restoring from backup (losing what came after) or a fix-forward. That is why the destructive step comes in a later release, and why step 1 above is a backup.
  • Third parties. A webhook endpoint that is down will be retried by the provider (see payments and webhooks), so a short rollback loses nothing as long as your handlers are idempotent.

Feature flags give a fifth option: ship the code switched off and turn it on separately, so the rollback is a setting. See feature flags in practice.

6. The first week

Launch is the beginning of learning, not the end. Keep the dashboards open and check, each morning:

  • Error rate and slowest endpoints. Anything new is a bug real users found.
  • Oldest waiting job in the queue, and failed jobs. A growing queue is a worker problem (background work).
  • Database connections and slow queries (first bottlenecks).
  • The funnel: how many sign-ups reach a first task. If most do not, that is a product problem no amount of infrastructure will fix.
  • Support messages. Put the request id (from the error screen) in every bug report, as set up in the observability lesson.

Write down each incident in a short note: what happened, how you found it, what you changed. After a month those notes are your real backlog, and they will differ from the list you made in from requirements to a buildable plan.

What to do with what you built

You now have the skeleton of any web product: the same pieces appear in a booking site, a marketplace or an internal tool. To go deeper, pick the layer where you felt least sure and read its home roadmap: frontend, backend, API design or system design. And keep one habit from this whole roadmap: when something breaks, ask which seam it crossed. That question finds most bugs faster than any tool.

What the video covers

ByteByteGo’s “How Big Tech Ships Code to Production” is about four and a half minutes and three years old. By its title it gives a short overview of how large companies release code, which supports the release-order and rollback ideas in sections 3 and 5 at a much bigger scale than Taskboard needs. I could not read a transcript, so I cannot say which release practices it names. It is a weak, high-level fit for a capstone, since I found no focused video on launching a small full-stack app that I was confident in. Fireship’s “7 Ways to Deploy a Node.js App” is linked as a survey of hosting options, though it is five years old.

Where this fits

This is the last lesson of the roadmap. You started with what a full-stack developer does and followed one request from browser to database and back. You end with an app that is tested, deployed, watched and ready to change. Go back to what a full-stack developer does to see how much of it you can now explain, or pick the next feature and run the loop again.

Check yourself

  1. 01Why write the rollback plan before launching?

    Under pressure you will pick the fastest-looking action, which can make things worse. Having a rehearsed step for each tier, such as redeploying the last build, removes the decision.

  2. 02Which tier is hardest to roll back, and why?

    The database. Code goes back by redeploying an old build, but data written since the release, or a dropped column, cannot be undone without a restore, which is why schema changes use expand and contract.

  3. 03What does the smoke test in this lesson check that a health endpoint does not?

    That a page is served and that a write goes through the API into the database and comes back, which proves the client host, the API and the database are wired together.

  4. 04What should you watch in the first week?

    The error rate, response latency, the oldest waiting background job and the signup-to-first-task journey, because those show the problems real traffic finds first.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark