Here’s the README content formatted as a Markdown file:
This is a solution to the REST Countries API Challenge. This project demonstrates skills in building a responsive web application using React, including handling APIs, managing state, and implementing a theme switcher.
Users should be able to:
- See all countries from the API on the homepage
- Search for a country using an
input
field - Filter countries by region
- Click on a country to see more detailed information on a separate page
- Click through to the border countries on the detail page (I need to work on that)
- Toggle the color scheme between light and dark mode
This screenshot shows the homepage with a list of countries, the search and filter options, and an example of the detail page for a selected country.
- I show up on time.
- I do my prayers.
- I do the work.
- One thing at a time.
- Next day, I repeat.
The process is about showing up daily and doing the work, over and over again.
I also keep a .md file that I think the problem, keep to-dos organized. It's a VSCode extension that helps me to keep everything in it's place.
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
- React - JS library
- Tailwind CSS - For styling
- REST Countries API - For fetching country data
- React Router - For routing between pages
The importance of sitting down and do my thing: study, code, repeat.
The programming thing? I got hands-on experience with handling API requests, setting up a React routing system, and solving bugs. I ended up writing some spaghetti code, but you know what? It works! The code isn't perfect, but today I'm better than yesterday.
Handling API calls and managing state:
useEffect(() => {
async function fetchCountry() {
try {
const response = await fetch(
`https://restcountries.com/v3.1/name/${countryName}`
)
const data = await response.json()
setCountry(data[0])
} catch (error) {
console.log("Error fetching country data:", error)
}
}
fetchCountry()
}, [countryName])
Implementing dark/light mode with Tailwind CSS:
<button onClick={toggleTheme} className="bg-white dark:bg-dark-blue">
Toggle Theme
</button>
Keep doing my thing. Keep beating resistence.
- Tailwind CSS Documentation - The official Tailwind CSS documentation was essential in quickly setting up and customizing the app's design.
- React Router Documentation - Helped me understand how to manage navigation and routing between the country list and detail pages.
- Website - Personal Website
- Frontend Mentor - @yourusername
- GitHub - @yourusername
- Linkedin - @yourusername
Huge thanks to Steven Pressfield for writing The War of Art, which inspired me to push through resistance and keep creating, and to Prof. Lúcia Helena for her philosophy teachings that continuously guide my thinking and approach to learning.