A React + Redux Toolkit project built with Vite and Tailwind CSS, consuming a REST API (GitHub raw JSON) to display detailed country information. It is designed with production-grade practices such as modular foldering, Redux slices, reusable components, and theming.
- 🌑 Dark / Light Mode toggle (persisted in localStorage)
- 🔍 Search & Filter countries by name and region
- 📄 Country detail page with extended info (flag, population, region, borders, etc.)
- 📱 Responsive design with Tailwind CSS
- 🗄 Redux Toolkit for global state management
- ⚡ Optimized Vite setup for fast builds and development
src/
├── app/
│ └── store.js # Redux store configuration
│
├── features/ # Redux slices (domain logic)
│ ├── countries/countriesSlice.js
│ ├── inputValues/inputValueSlice.js
│ └── theme/themeSlice.js
│
├── components/ # Reusable UI components
│ ├── Header/
│ │ ├── Header.jsx
│ │ └── ThemeBtn.jsx
│ ├── Backbtn.jsx
│ ├── Card.jsx
│ ├── CountryDetails.jsx
│ ├── Dropdown.jsx
│ ├── Flag.jsx
│ ├── InputText.jsx
│ └── Index.js
│
├── pages/ # Page-level components
│ ├── Country.jsx
│ └── Home.jsx
│
│
├── App.jsx # Root component with routes/layout
├── index.css # Global styles
└── main.jsx # React root
- ⚛️ React – Library
- 🎛 Redux Toolkit – Global state management
- 🖌 Tailwind CSS – Utility-first styling
- 🌐 GitHub Raw JSON API – Country data source
- 🧭 React Router – Client-side routing
- 🎨 Font Awesome – Icon library
- ⚡ Vite – Lightning-fast dev server and build tool
# Clone the repository
git clone https://github.com/abhi-zero/rest-countries-api.git
cd rest-countries-api
# Install dependencies
npm install # or yarn / pnpm
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
Data is served from GitHub raw JSON:
https://raw.githubusercontent.com/abhi-zero/countries-api/main/db.json
Screenshots of the application here to showcase features and UI.
Light | Dark |
---|---|
![]() |
![]() |
![]() |
![]() |
- 📄 Expand country detail page with maps & weather
- 📱 Convert to PWA (offline caching)
- 🎨 Add unit-tested design system (button, card, input)
- Fork the repository
- Create a feature branch (
feature/your-feature
) - Commit & push changes
- Open a Pull Request
Special thanks and shoutout to Frontend Mentor – an amazing platform that provides frontend challenges and design files for developers to practice real‑world projects – for supplying the original design and inspiration for this project.
Licensed under MIT License – free to use & modify.
💡 Note: This project already follows production practices (Redux slices, modular components, theming).