Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - REST Countries API with color theme switcher solution

This is a solution to the REST Countries API with color theme switcher challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

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
  • Toggle the color scheme between light and dark mode

Screenshot

Desktop preview

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties for dark/light mode
  • Flexbox
  • CSS Grid
  • Mobile-first workflow with Tailwindcss
  • React - JS library

What I learned

I learned so many things in this challenge :

  • create components and composable with ReactJs
  • structure this challenge through Github Project kanban
  • use svg as component
  • lazy load card component on countries list
  • manage env variable
  • dark mode toggle

Continued development

To improve this project, it will be nice to use Typescript and try unit testing for react component.

Useful resources

  • VueJs developers guide to react - This helped me for multiple situations. I'm currently learning ReactJs and it was more easy to compare some behavior with VueJs.
  • Object-fit - The documentation of TailwindCss is just amazing. I was faced with this problem very quickly for displaying flags.
  • Heroicons - Beautiful hand-crafted SVG icons, by the makers of Tailwind CSS.

Getting started

requirement

You need to create .env file with the following content :

REACT_APP_COUNTRIES_API_URL=https://restcountries.com/v3.1

This application is based on the latest REST COUNTRIES version, but you can change to v2.

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

Author

Acknowledgments

Thanks Frontendmentor for this really cool challenge ❤️

About

Discover countries of the world

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages