Your challenge is to build a website with React.js that pulls country data from the REST Countries API and displays it like the designs.
Required Goals for Version 1 of the project:
- Mobile responsive application build with React.js/Vite
- Code on Github and deployed to a Netlify URL
- Countries data is pulled from the REST Countries API
- As a user, I can see all countries from the API on the homepage, with data displayed about each country
- As a user, I can submit a form with my information
- As a user, I can click on a country to see more detailed information on a separate page
Stretch goals for the project (not required for assignment completion)
- As a user, I can search for a country using an
inputfield - As a user, I can filter countries by region
- As a user, I can toggle the color scheme between light and dark mode
- As a user, I can click through to the bordering countries on the detail page
NOTE: Sometimes the REST Countries API can go down. We've added a data.json file with all the country data. You should use this as a backup, if the API responds with an error.
- Designs: You will need to use this Figma file for the designs
- Style Guide: Refer to the
style-guide.mdfile for info about the color palette, fonts, and design. - API: You will use the REST Countries API to get the country data and flag images
- Work on one feature at a time. Finish one feature first before you move onto the next thing. As a metaphor, if we are making dinner, we should start with making each dish before we get hung up on choosing the plates and dinnerware. Otherwise we'll have a bunch of nice plates but no food on the table!
- Look through the designs to start planning out how you'll tackle the project. This step is crucial to help you think ahead for CSS classes to create reusable styles.
- Write out the base styles for your project, including general content styles, such as
font-familyandfont-size. - Start adding styles to the top of the page and work down. Only move on to the next section once you're happy you've completed the area you're working on.
- Fork this Github repo into your own Github account, then clone your new Github repo into your local machine. You can use this fork and clone guide to help you.
- In the terminal, use
cdto navigate to your new local repo called countries-api-project. - In the terminal, inside your countries-api-project repo, create a
version-1folder. You can do this by running the commandmkdir version-1. Thisversion-1folder is where you will code your Countries API project! - In the terminal,
cdinto theversion-1folder, and then create a new React project with Vite - In the terminal, inside the
version-1folder, install React Router package usingnpm install react-router - Push code to Github
- In App.jsx file, set up Routes for each page (Home page, SavedCountries page, Country page) using react-router. You can use this react-router guide to help you
- In the
srcfolder, create apagesfolder and set up page components for each page (Home page, SavedCountries page, Country page) - Don't forget to push your code to Github!
- On the Home page, display country data from the data.json file
- Style the country data according to the Figma designs
- Don't forget to push your code to Github!
- On the Home page, create API call that pulls countries data from the REST Countries API using useEffect
- Display data from API call on the Home page, instead of displaying data from data.json
- Create the Header component, which will be displayed on each page.
- Style the Header component
- Clicking on "Where in the world?" should link to the Home page, and clicking on "Saved Countries" should link to the SavedCountries page.
- Create the Saved Countries Page
- On the Saved Countries page, create the Form so that the user can submit their profile information
- Style the Form according to the designs
- We will create this page together as a class, so you do not need to create this page until the time comes.
- Deploy your completed project to Netlify via your Github repo
- Create the search bar on the Home page
- Filter countries by region
- Dark Mode