Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A responsive front-end application built with React and Vite for exploring, searching, and filtering country data from the REST Countries API.

License

Notifications You must be signed in to change notification settings

jessicaccp/country-explorer

Repository files navigation

Country Explorer

Netlify Status

📍 Live Demo

A responsive front-end application built with React and Vite for exploring, searching, and filtering country data from the REST Countries API.

Table of Contents

Features

  • Dynamic Search & Filtering: Implements client-side search by country name and filtering by geographical region.
  • Multi-criteria Sorting: Allows users to sort the dataset by name, population, and area in both ascending and descending order.
  • Client-side Pagination: Efficiently handles and displays a large dataset with a smart pagination component.
  • Detailed Country View: Features a dedicated route for each country displaying comprehensive data, including calculated metrics like population density.
  • Responsive Design: A mobile-first, fully responsive layout built with Tailwind CSS, ensuring a consistent user experience.
  • Theming: User-selectable dark/light mode with preference persistence in the browser's localStorage.
  • Comprehensive Test Suite: Includes unit and integration tests built with Vitest and React Testing Library to ensure component reliability and functionality.

Tech Stack

  • Frontend: React.js, React Router
  • Styling: Tailwind CSS
  • Build Tool / Dev Environment: Vite
  • Testing: Vitest, React Testing Library, JSDOM, User Event
  • HTTP Client: Axios

Getting Started

Follow these instructions to get the project running on your local machine.

Prerequisites

  • Git
  • Node.js (v18.x or newer)
  • npm (v9.x or newer)

Configuration & Installation

  1. Clone the repository:

    git clone https://github.com/jessicaccp/country-explorer.git
    cd country-explorer
  2. Install the required dependencies:

    npm install
  3. Set up your environment variables: Rename the .env.local.example file to .env.local. The default values provided are sufficient to run the application.

    # On macOS / Linux
    mv .env.local.example .env.local
    
    # On Windows (Command Prompt)
    rename .env.local.example .env.local

Running the Application

  1. Start the development server:

    npm run dev
  2. Open your browser and navigate to http://localhost:5173.

Running Tests

To run the complete test suite, execute the following command:

npm run test

License

This project is distributed under the MIT License. See the LICENSE file for more information.

About

A responsive front-end application built with React and Vite for exploring, searching, and filtering country data from the REST Countries API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published