Country Info Card
A small browser exercise that turns API data into a readable country information card.
Where to start
A new heading needs new data
Read the simulated search test and follow what changes when the request fails.
- Why I built it
- I built this coursework exercise to practice taking an API response and turning it into something readable.
- How I used or tested it
- With simulated responses I checked a new search, blank input and a failed request. The exercise still needs a visible error when a request fails.
- What I changed
- I routed the first load and later searches through the same function, so a new country changes the data as well as the heading.
The problem
An API response is useful to a program, but a user needs an understandable result and a clear path when it fails.
What I built
JavaScript coursework using external API requests, JSON and dynamic page updates.
A decision I made
Keep a small interface so the data flow from request to rendered card is easy to explain.
What I can show
The exercise is described in the existing portfolio. No independently verified public deployment is linked.
Known limits
A coursework example, not a production service.
What went wrong and what changed
Changing the search could change only the heading
What I changed: The search button now trims the input, ignores blanks, and sends the new country through the same data-loading function as the initial card.
How I checked: A simulated data test checked the default card, a changed country, blank input, and a failed request. The old card stays on screen if the request fails. This was not a live API test.
What I’m still solving
Show a visible error or retry message when the network request fails. Right now the error is logged, but the page does not explain it to the reader.
Skills in this project: Tracing UI state · fetch handling · comparing before and after