Skip to content
WebDev Path

Weather or movie search app

Let users search a public API (weather, movies or books) and see results with loading and error states.

  • JavaScript
  • Fetch API
  • CSS

The project for module 2, JavaScript. It proves: dom work, async code and handling real-world failures.

Who it's for

  • As a user, I can search and see results without reloading
  • As a user, I see a clear message when nothing is found
  • As a user, my last searches are remembered

Pick your version

Choose one theme, or your own idea. Same skills, but your portfolio won't look like everyone else's.

  1. Option A

    Weather for any city with Open-Meteo (no API key)

  2. Option B

    Book search with the Open Library API (no API key)

  3. Option C

    Country facts explorer with REST Countries (no API key)

Warm up first

Two short builds that practise the skills this project needs. About 3 hours in total.

Tip calculator

1 h

Enter a bill, a tip percent and the number of people, and see what each person pays.

  1. Build a form with three number inputs
  2. Recalculate on every input event
  3. Round money to 2 decimals and format it with Intl.NumberFormat
  4. Show a message for empty or negative values

Done when: The total updates as you type and never shows NaN.

  • Events
  • Numbers
  • Input validation

To-do list that remembers

2 h

Add, complete, delete and filter tasks, and keep them after a refresh.

  1. Keep tasks in an array of objects with id, text and done
  2. Render the list from the array every time it changes
  3. Save the array to localStorage after each change
  4. Add All, Active and Done filters

Done when: Refreshing the page keeps every task and its state.

  • Arrays
  • DOM rendering
  • localStorage

Build plan

7 steps in order. Each one ends with a clear check, so you always know when to move on.

  1. Call the API by hand

    Open the API URL in your browser and read the JSON. Find the fields you need.

    Done when: You can write down the exact path to every value you'll show, like data.current.temperature_2m.

    Stuck? Show a hint

    Install a JSON viewer extension, or paste the response into the browser console with console.log.

  2. Build the search form

    Add an input and a button. On submit, stop the page reload and read the value.

    Done when: Typing a city and pressing Enter logs it to the console.

    Stuck? Show a hint

    Listen for the form's submit event, not the button's click, so Enter works too.

  3. Fetch and show results

    Write an async function that fetches data and renders cards into the page.

    Done when: A real search shows real results without reloading.

    Stuck? Show a hint

    Build HTML with template literals, but put user text in with textContent, not innerHTML.

  4. Handle every state

    Show a loading message, an empty message and an error message.

    Done when: Turning off Wi-Fi in DevTools shows a friendly error, not a blank page.

    Stuck? Show a hint

    fetch only rejects on network errors. Check response.ok yourself for 404 and 500.

  5. Remember searches

    Save the last 5 searches in localStorage and show them as buttons.

    Done when: Refreshing the page keeps the history, and clicking one searches again.

    Stuck? Show a hint

    localStorage stores strings only. Use JSON.stringify and JSON.parse.

  6. Split into modules

    Move API calls, rendering and storage into separate files with import and export.

    Done when: main.js is short and only wires the pieces together.

    Stuck? Show a hint

    Use <script type="module"> so the browser understands import.

  7. Ship it

    Deploy and write a README with what it does, the API used, and one thing you'd improve.

    Done when: A live URL works on your phone.

    Stuck? Show a hint

    Mention a problem you solved, like handling empty results. That's what interviewers ask about.

Requirements

Tick each one when it's done. Saved to your account.

Go further

Optional. One of these makes your project stand out from the tutorial version.

  • Debounced search as you type
  • Unit conversion or favorites

Starter kit

Free APIs, tools and docs for this project.

Submit

Tick the 5 remaining requirements to submit.