Skip to content

mrpawarGit/Global-Explorer-Dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🌍 Global Explorer Dashboard

An interactive React web application that allows users to explore countries worldwide, view detailed information, real-time weather conditions, and local news from multiple external APIs.

🎯 Overview

Global Explorer Dashboard is a modern, responsive web application built with React that provides comprehensive information about 250+ countries. Users can search, filter, and explore countries with real-time weather data, interactive maps, and local news integration.

✨ Features

βœ… Current Features

  • Country Explorer: Browse through 250+ countries with smart pagination
  • Advanced Search: Search countries by name or capital city with real-time filtering
  • Responsive Grid Layout: Adapts seamlessly to all screen sizes (mobile, tablet, desktop)
  • Country Cards: Display flag, name, capital, region, and population
  • Detailed Country View:
    • Large flag display with official country name
    • General information (capital, region, subregion, population, area)
    • Languages and currencies with symbols
    • Border countries display
    • Interactive map with location markers
  • Real-Time Weather: Current weather conditions for capital cities
    • Temperature, weather conditions, and descriptions
    • Wind speed, humidity, and "feels like" temperature
    • Weather icons from OpenWeatherMap
  • Latest News: Top 3 news headlines from each country
    • Article images, titles, and descriptions
    • Direct links to full articles
  • Interactive Map: Leaflet-powered maps showing country location
  • Smart Pagination: Pagination with ellipsis for better navigation
  • Loading States: Smooth loading indicators for all API calls
  • Error Handling: User-friendly error messages with retry options
  • Back Navigation: Easy navigation between pages

πŸ› οΈ Tech Stack

  • Frontend: React 18
  • Build Tool: Vite 5
  • Routing: React Router DOM v6
  • HTTP Client: Axios
  • Maps: React Leaflet + Leaflet.js
  • Styling: CSS3 (Custom styling with CSS Grid & Flexbox)
  • State Management: React Hooks (useState, useEffect, useMemo)

🌐 APIs Used

  1. REST Countries API - Country information

    • Endpoint: https://restcountries.com/v3.1/region/{region}
    • Data: Names, flags, capitals, populations, languages, currencies, borders, coordinates
    • Status: βœ… Active
  2. OpenWeatherMap API - Real-time weather data

    • Endpoint: https://api.openweathermap.org/data/2.5/weather
    • Data: Temperature, conditions, humidity, wind speed
    • Status: βœ… Integrated
  3. NewsAPI - Latest news headlines

    • Endpoint: https://newsapi.org/v2/top-headlines
    • Data: Top 3 headlines with images and links
    • Status: βœ… Integrated

πŸ“¦ Installation

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • OpenWeatherMap API key (free tier available)
  • NewsAPI key (free tier: 100 requests/day)

Setup Instructions

  1. Clone the repository

    git clone https://github.com/mrpawarGit/Global-Explorer-Dashboard
    cd global-explorer-app
  2. Install dependencies

    npm install
  3. Get API Keys

  4. Create environment file

    Create a .env file in the root directory:

    VITE_WEATHER_API_KEY=your_openweathermap_api_key_here
    VITE_NEWS_API_KEY=your_newsapi_key_here
  5. Start development server

    npm run dev
  6. Open browser

    Navigate to http://localhost:5173

πŸ“ Project Structure

global-explorer-dashboard/
β”œβ”€β”€ public/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ CountryCard.jsx          # Country card component
β”‚   β”‚   β”œβ”€β”€ CountryCard.css
β”‚   β”‚   β”œβ”€β”€ SearchBar.jsx            # Search input component
β”‚   β”‚   β”œβ”€β”€ SearchBar.css
β”‚   β”‚   β”œβ”€β”€ Pagination.jsx           # Pagination controls
β”‚   β”‚   β”œβ”€β”€ Pagination.css
β”‚   β”‚   β”œβ”€β”€ WeatherCard.jsx          # Weather display component
β”‚   β”‚   β”œβ”€β”€ WeatherCard.css
β”‚   β”‚   β”œβ”€β”€ NewsCard.jsx             # News headlines component
β”‚   β”‚   β”œβ”€β”€ NewsCard.css
β”‚   β”‚   β”œβ”€β”€ CountryMap.jsx           # Interactive map component
β”‚   β”‚   β”œβ”€β”€ CountryMap.css
β”‚   β”‚   β”œβ”€β”€ Spinner.jsx              # Loading spinner
β”‚   β”‚   β”œβ”€β”€ ErrorMessage.jsx         # Error display
β”‚   β”‚   └── Navbar.jsx               # Navigation bar
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Home.jsx                 # Main explorer page
β”‚   β”‚   β”œβ”€β”€ Home.css
β”‚   β”‚   β”œβ”€β”€ CountryDetails.jsx       # Detailed country view
β”‚   β”‚   β”œβ”€β”€ CountryDetails.css
β”‚   β”‚   └── Favorites.jsx            # Favorites page (coming soon)
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ countriesAPI.js          # Countries API service
β”‚   β”‚   β”œβ”€β”€ weatherAPI.js            # Weather API service
β”‚   β”‚   └── newsAPI.js               # News API service
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useCountries.js          # Custom hook for countries
β”‚   β”‚   └── useFavorites.js          # Custom hook for favorites
β”‚   β”œβ”€β”€ App.jsx                      # Main app component
β”‚   β”œβ”€β”€ App.css
β”‚   β”œβ”€β”€ main.jsx                     # Entry point
β”‚   └── index.css
β”œβ”€β”€ .env
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.js
└── README.md

πŸš€ Usage

Search Countries

Type in the search bar to instantly filter countries by name or capital city.

Browse Countries

Use pagination controls at the bottom to navigate through all 250+ countries.

View Country Details

Click on any country card to view:

  • Complete country information
  • Real-time weather for the capital
  • Latest news headlines
  • Interactive map with location

Navigate Back

Use the back button or browser navigation to return to the home page.

πŸ“œ Available Scripts

npm run dev          # Start development server at localhost:5173
npm run build        # Build optimized production bundle
npm run preview      # Preview production build locally
npm run lint         # Run ESLint for code quality

🎨 Key Features Explained

Smart API Integration

  • Fetches data from 5 regions in parallel for optimal performance
  • Graceful error handling for all API calls
  • Caching strategy to minimize redundant requests

Responsive Design

  • Mobile-first approach
  • CSS Grid for flexible layouts
  • Adapts to all screen sizes (320px - 4K)

Performance Optimization

  • React.lazy for code splitting
  • useMemo for expensive computations
  • Lazy loading for images
  • Optimized re-renders

πŸ› Known Issues

  • NewsAPI free tier has 100 requests/day limit
  • Some countries may not have news available in NewsAPI
  • Weather data requires valid capital city names

πŸ™ Acknowledgments

πŸ‘€ Author

Your Name


Made using React and Vite

About

An interactive React web application that allows users to explore countries worldwide, view detailed information, weather conditions, and local news from multiple external APIs.

Topics

Resources

Stars

Watchers

Forks

Contributors