A Next.js application that provides an interactive interface for exploring country information. The application displays:
- List of countries with flags
- Detailed country pages
- Population data visualization
- Border countries exploration
- Next.js
- React
- TypeScript
- Tailwind CSS
- Recharts (for population data visualization)
- Node.js (v18.x or later)
- npm (v9.x or later)
- Clone the repository
git clone https://github.com/phpfc/country-info-frontend.git
cd country-info-frontend
- Install dependencies
npm install
Create a .env.local
file in the project root:
# Backend API Base URL
NEXT_PUBLIC_API_URL=http://localhost:3001
npm run dev
The application will be available at http://localhost:3000
.
npm run build
npm run start
- Responsive design using Tailwind CSS
- Dynamic routing for country details
- Interactive population data chart
- Border countries navigation
- Loading and error state management
app/
: Next.js app directorypage.tsx
: Countries list pagecountry/[code]/page.tsx
: Individual country details page
components/
: Reusable React componentsBorderCountries.tsx
: Border countries displayPopulationChart.tsx
: Population data visualization
lib/
: Utility functions and API clienttypes/
: TypeScript type definitions
The frontend consumes a local backend API that aggregates data from:
- Nager.Date API
- Countries Now API
- Fully responsive design
- Mobile and desktop friendly
- Consistent color scheme and typography
- Server-side rendering (SSR) for initial page load
- Client-side navigation
- Efficient data fetching and caching