Skip to main content

Week 8

Last week, we built a cart on our own computers. This week, we're working on a practice copy of the real Blueprint website, and the cart turns into a merch page.

What we're building

A Store page on the practice copy of the Stevens Blueprint website. It shows merch, lets you pick a size, and adds things to a cart. It starts with made-up products, so it works with no setup. Later tickets connect it to our Fourthwall store, so it shows real products and prices and sends the cart to checkout.

Fourthwall is the service that runs the store. It holds the products and takes the payment. Our page only shows the products and builds the cart. It never shows a card form.

The shop is called Test. Right now it has four products: the Material Study Tote, the Riverside Studio Hoodie, the Dot Matrix Tee and the Hudson Standard Tee. I'll add more, so don't write code that expects four.

Changes here do not go to the live site at sitblueprint.com. The practice copy is a private repo: blueprint-learn/techteam-merch-page.

Set up

Do this before the meeting if you can. The first time takes a while because things download.

Step What to do
1 Get into the repo. It's private, so open the invite email from GitHub and accept it first, or the clone fails. Then run git clone https://github.com/blueprint-learn/techteam-merch-page.git and cd techteam-merch-page.
2 Install Deno. The site runs on Deno 2. On a Mac run brew install deno. On Windows run irm https://deno.land/install.ps1 | iex in PowerShell. Run deno --version. It should say 2.something.
3 Install Node from nodejs.org. Run node -v to check. We only use it for Prettier, the code formatter.
4 In the repo folder, run deno task serve, then open http://localhost:3000. If you see the Blueprint site, it works. Leave it running while you work. Press Ctrl+C when you're done.
5 In a second terminal in the same folder, run npm ci. You only do this once.

The Store page is at http://localhost:3000/store/. If it's not there, run git switch main && git pull.

If something breaks, ask the person next to you first. Then ask me.

The token. Only tickets #29 to #33 need the Fourthwall token. I'll give it to you when they open. Copy .env.example to .env.local, fill in the three values, and restart deno task serve. Without a token, the page still builds and shows the made-up products. Never commit .env.local, and never paste the token in an issue, a PR or a chat.

How a ticket works

Every change is one ticket (a GitHub issue), one branch and one pull request (PR).

  1. Open the Issues tab and pick a ticket whose "Depends on" tickets are merged. Skip any with the needs-fourthwall-token label until I say the token exists. Assign the ticket to yourself. Keep one open ticket at a time.
  2. Make a branch from main and call it issue-<issue number>-<short-name>, like issue-24-format-money. Run git switch main, then git pull, then git switch -c issue-24-format-money.
  3. Do what the ticket says. Every acceptance line has to be true when you finish.
  4. Run npm run format:write, then commit and push your branch. The prettier check on your PR fails if you skip it.
  5. Open a PR and write Closes #<issue number> in it, so the ticket closes when it merges. Copy the acceptance lines from the issue into the PR and tick the ones you tried.
  6. Add me (@Nishit-Sharma) as the reviewer. I'm the only reviewer. I try it and check each acceptance line, then I approve it or ask for changes.
  7. Once I approve, I merge it. Then run git switch main && git pull before your next ticket.

A few rules:

  • Never commit the Fourthwall token or any password.
  • Don't change deno.lock, package-lock.json or _config.ts unless the ticket says to.
  • Don't open PRs against stevensblueprint/blueprint_website from here.
  • Stuck for more than 10 minutes? Ask me.

The tickets

Each ticket is a GitHub issue with a scope of work, acceptance criteria and a "Depends on" list. Read the issue for the details. The sizes are my guesses, and I haven't timed them. "Pair" means two people. There is no #28.

# Ticket Size Depends on Needs the token
#24 Build the size picker M Nothing No
#25 Finish the product card: price, missing picture, long names, empty page M #24 No
#26 Move the cart into a component and add the estimated subtotal M Nothing No
#27 Add quantity buttons, a limit of 10 and cart messages M #26 No
#29 Fetch live products with listProducts() M (pair) Nothing Yes
#30 Show live products on the page, with the fixtures as the fallback L (pair) #29, #25 Yes
#31 Add the cart requests to fourthwall.js M (pair) #29 Yes
#32 Make the cart on the page use the real Fourthwall cart L (pair) #31, #30, #27 Yes
#33 Send the cart to Fourthwall checkout M #32 Yes

The ones that depend on nothing and don't need the token are #24 and #26. The token tickets wait until I say the token exists.

Teams

I'll post the teams and tickets here.