Svelte Seedling Nursery — Svelte

Build Mbak Wuri's nursery site in Svelte and SvelteKit, then watch villagers' phones open it. 16 levels, played right in the browser with nothing to install.

What the levels ask

  1. Ms. Wuri is building her nursery’s first site. Fill the hole in <h1> so the phone writes Ngudi Tuwuh Seedling Nursery, taking the nursery’s name from the variable nursery.
  2. Photos rarely load on Grandma Marni’s old phone, so the text that stands in for a photo (alt) must be there. Fill the <img> attributes from the variables src and alt, then make the link go to /seedlings/chilli using the variable id.
  3. Ms. Wuri writes the seedling’s description with <b> for the words that matter. In a review, Bagas wrote his name as <b>BAGAS</b> for fun. Make the description show its bold words, and the reviewer’s name show exactly as it was typed.
  4. App uses SeedlingCard.svelte three times. Chillies and tomatoes are sold per polybag, so App sends no unit for them; sengon is sold per tree. Fill the props line in SeedlingCard.svelte so all three cards write the right unit.
  5. Only 26 polybags of tomatoes are left. The card reads 26 polybags in stock at 20 or more, Only 14 polybags left under 20, and Sold out at zero. Fill the two conditions of the {#if} block, then watch Mr. Tono and Grandma Marni order 6 each and the neighbourhood head buy the rest.
  6. Each row of Mr. Tono’s basket keeps its own number in the Row component. He cuts the tomatoes to 5, then takes the rows out one by one. Fill the holes in {#each} so each seedling keeps its own number, and the empty basket says it is empty.
  7. The site moves to SvelteKit: every page is a file in src/routes, and the menu is set once in the layout. Choose where the catalogue file goes so it lives at /seedlings, and fill the layout so the page being opened shows under the menu.
  8. Every seedling needs its own page, without three folders: load in +page.js reads the seedling’s code from params.id. Name the seedling page’s folder so /seedlings/chilli and /seedlings/tomato open, and the made-up address /seedlings/chilli/reviews still answers 404.
  9. The seedling page now has a link, See another seedling. Fill the line in <script> that decides which seedling is shown, so the heading is always the one in the address: when Mr. Tono taps that link, and on Grandma Marni’s old phone.
  10. Father’s stock book only opens with the key STOCK_BOOK_KEY. The new key lives in the server environment of Ms. Wuri’s laptop, declared in src/env.js. Choose the catalogue’s load file and the way to get the key, so the stock shows without the key ever being seen in the browser.
  11. While Ms. Wuri has the catalogue open, Mr. Tono orders 30 chillies from home and the stock book changes. The Refresh stock button has to run the catalogue’s load again, without loading the whole page again. Fill the mark in load and the button’s action.
  12. Grandma Marni’s old phone runs no JavaScript, so the form still has to be sent and the page has to show the result. On Mr. Tono’s phone the order must arrive without loading the whole page again. The action order is already in +page.server.js. Fill the <form> attributes.

And more, 16 levels in all.