A fully responsive and modern React application that lets users explore country data using the REST Countries API. Users can search for countries, filter by region, view detailed information, and manage favorites with session-based login.
- 🔎 Search for countries by name
- 🌍 Filter by region
- 🗣️ View details: capital, population, region, flag, and languages
- ⭐ Favorite countries after logging in
- 🧭 Navigation bar for easy access
- 🎨 Responsive UI built with Tailwind CSS
- 🔐 User login & signup with session management
- ⚙️ Component-based architecture using React functional components
- React (with functional components and hooks)
- Tailwind CSS for styling
- REST Countries API for data
- Local Storage / Session state for authentication and favorites
-
Clone the repository
git clone https://github.com/your-username/rest-countries-app.git cd rest-countries-app -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open in browser
Visit: http://localhost:5173
npm run build
npm run previewThis will generate the production build and serve it for preview at http://localhost:4173.
GET /all?fields=...– Fetch all countries with limited fields for performanceGET /name/{name}?fields=...– Search country by nameGET /region/{region}?fields=...– Filter countries by regionGET /subregion/{subregion}?fields=...– Filter countries by subregionGET /currency/{currency}?fields=...– Filter countries by currencyGET /lang/{language}?fields=...– Filter countries by languageGET /capital/{capital}?fields=...– Filter countries by capitalGET /alpha/{code}– Fetch full details by code
Data used includes:
- Country Name
- Capital
- Population
- Region
- Subregion
- Flags
- CCA3 Code
- Borders
- Currencies
- Languages
- Top-Level Domain (TLD)
- Users can sign up, log in, and log out
- Logged-in users can save favorite countries (stored in local/session storage)
├── App.jsx
├── main.jsx
├── components/
│ ├── Navbar.jsx
│ ├── CountryCard.jsx
│ ├── CountryGrid.jsx
│ ├── FilterBar.jsx
│ ├── FilterControls.jsx
│ ├── SearchBar.jsx
│ ├── CountryDetail.jsx
│ ├── Favorites.jsx
│ └── Icons.jsx
├── pages/
│ ├── Home.jsx
│ ├── Login.jsx
│ └── Signup.jsx
├── index.css
└── tailwind.config.js
📌 Hosted on: https://rest-countries-api-frontend-delta.vercel.app