Skip to content

This is a solution to the "REST Countries API with color theme switcher" challenge on Frontend Mentor challenges.

Notifications You must be signed in to change notification settings

MelvinAguilar/rest-countries

Repository files navigation

frontendmentor

REST Countries API with color theme switcher

Next.js 14 and Server Actions

Frontend Mentor Challenge

View Demo · Report Bug · Request Feature

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.

In this challenge, Rest Countries API can be used, but it has its limitations. For example, it doesn't support pagination, and if you use the filter, you can't use a query to search for specific elements. It's also not possible to retrieve the names of bordering countries using a single request. Therefore, I turned to the data.json provided with the challenge, created a database in MongoDB, and utilized Server Actions in Next.js to consume it.


Links


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 (optional)

My process

Built with

  • Tailwind CSS
  • TypeScript
  • Server Actions
  • MongoDB
  • Mongoose
  • Custom Hooks
  • Semantic HTML5 markup
  • Eslint

Useful resources

Author

Acknowledgments

Run the project

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

About

This is a solution to the "REST Countries API with color theme switcher" challenge on Frontend Mentor challenges.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published