A responsive front-end application built with React and Vite for exploring, searching, and filtering country data from the REST Countries API.
- 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.
- Frontend: React.js, React Router
- Styling: Tailwind CSS
- Build Tool / Dev Environment: Vite
- Testing: Vitest, React Testing Library, JSDOM, User Event
- HTTP Client: Axios
Follow these instructions to get the project running on your local machine.
- Git
- Node.js (v18.x or newer)
- npm (v9.x or newer)
-
Clone the repository:
git clone https://github.com/jessicaccp/country-explorer.git cd country-explorer -
Install the required dependencies:
npm install
-
Set up your environment variables: Rename the
.env.local.examplefile 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
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:5173.
To run the complete test suite, execute the following command:
npm run testThis project is distributed under the MIT License. See the LICENSE file for more information.