Giter VIP home page Giter VIP logo

countries-discovery's Introduction

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 ❤️

countries-discovery's People

Contributors

geminii avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.