Country Scope is a modern web app that lets you explore countries of the world, search and filter by region, and view detailed information—all with a beautiful dark mode.
This project is a solution to the REST Countries API with color theme switcher challenge on Frontend Mentor.
- 🌐 See all countries from the REST Countries 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
- 🌓 Toggle the color scheme between light and dark mode
- ⚡ Fast, responsive, and mobile-friendly
- Solution URL: https://github.com/DemoStephen/Country-Scope
- Live Site URL: https://countryscope.vercel.app/
- Mobile-first workflow
- React
- Vite
- Tailwind CSS
- REST Countries API
- React Router
- Fetching and displaying data from a public API in React
- Implementing a theme switcher using React and Tailwind CSS
- Managing global state for theme and filters
- Routing with React Router for country detail pages
- Responsive design and accessibility best practices
const fetchCountries = async () => {
const response = await fetch("https://restcountries.com/v3.1/all");
const data = await response.json();
setCountries(data);
setLoading(false);
};function toggleTheme() {
const isDark = document.documentElement.classList.toggle("dark");
localStorage.theme = isDark ? "dark" : "light";
}- Improve accessibility, especially for keyboard navigation and screen readers
- Add unit and integration tests
- Enhance error handling for API requests
- Optimize performance for large datasets
- Frontend Mentor - @demostephen
- GitHub - demostephen
Thanks to the Frontend Mentor community for feedback and support!
