A modern, interactive web application for exploring real-time COVID-19 statistics from over 200 countries worldwide. Built with React, Express, and styled with premium glassmorphism UI components.
π Live Features:
- Real-time COVID-19 data fetching from global sources
- Search and explore data by country
- Interactive, modern UI with smooth animations
- Responsive design for all devices
- Professional loading states and animations
- Features
- Tech Stack
- Project Structure
- Installation & Setup
- Running the Application
- Deployment
- API Documentation
- Website Components
- UI Highlights
- Author
- β‘ Real-Time Data β Live COVID-19 statistics updated continuously
- π Global Coverage β Data for 200+ countries and regions
- π Country Search β Search any country and view detailed statistics
- π Interactive Dashboard β Beautiful data visualization with charts and cards
- π¨ Modern UI β Glassmorphism design with smooth animations
- π± Responsive Design β Works seamlessly on desktop, tablet, and mobile
- βοΈ Loading States β Beautiful animated loading screen with blurred hero background
- π― Interactive Elements β Hover effects, animations, and smooth transitions
- Total Cases
- Active Cases
- Recovered Cases
- Deaths
- React
^19.2.0β UI library - Vite
^7.2.4β Build tool and dev server - CSS3 β Custom styling with glassmorphism, gradients, and animations
- Node.js β Runtime environment
- Express
^5.2.1β Web framework - Axios
^1.13.4β HTTP client for API calls - CORS
^2.8.6β Cross-origin request handling - dotenv
^17.2.3β Environment variable management
- COVID-193 RapidAPI β Real-time COVID-19 statistics
covitrack/
βββ backend/
β βββ server.js # Express server & API routes
βββ src/
β βββ components/
β β βββ Hero.jsx # Hero section with animations
β β βββ CountrySection.jsx # Country data search & display
β β βββ CountryCard.jsx # COVID stats card component
β β βββ InsightsSection.jsx # Global insights & info
β β βββ Footer.jsx # Site footer with credits
β β βββ LoadingScreen.jsx # Animated loading overlay
β βββ styles/
β β βββ hero-earth.css # Hero section styles
β β βββ country-section.css # Search section styles
β β βββ country-card.css # Stats card styles
β β βββ insights-section.css # Insights section styles
β β βββ footer.css # Footer styles
β β βββ loading.css # Loading screen styles
β βββ App.jsx # Main app component
β βββ index.css # Global styles & scrollbar
β βββ main.jsx # React entry point
βββ public/ # Static assets
βββ package.json # Project dependencies
βββ vite.config.js # Vite configuration
βββ README.md # This file
- Node.js (v16 or higher)
- npm or yarn package manager
- RapidAPI account with COVID-193 API access
git clone https://github.com/yourusername/covitrack.git
cd covitrack# Install all dependencies
npm installCreate a .env file in the root directory:
RAPID_API_KEY=your_rapidapi_key_hereTo get your RapidAPI key:
- Sign up at RapidAPI
- Subscribe to the COVID-193 API
- Copy your API key and paste it in the
.envfile
# Check if all dependencies are installed
npm listTerminal 1 - Start Backend Server:
cd backend
npm install express axios cors dotenv
node server.jsBackend will run on http://localhost:5000
Terminal 2 - Start Frontend Dev Server:
npm run devFrontend will run on http://localhost:5173 (or similar)
Frontend:
npm run buildCreates optimized build in dist/ directory
Backend:
node backend/server.js- Frontend (Vercel): Deployed on Vercel. Add your Vercel project URL here (e.g.
https://your-project.vercel.app). Ensure the Vercel project has theVITE_API_URLenvironment variable set to your backend URL. - Backend (Render): Deployed on Render β
https://covitrack.onrender.com.
Note: The frontend reads the backend base URL from the VITE_API_URL environment variable. In production, set VITE_API_URL in your Vercel project to https://covitrack.onrender.com (or your Render service URL).
GET /
- Description: Verify backend is running
- Response:
Backend is running β
GET /covid?country=CountryName
Parameters:
country(query, optional) β Country name (default: "India")- Example:
?country=United States,?country=Japan
- Example:
Response Success (200):
{
"country": "India",
"totalCases": 44543210,
"activeCases": 1234567,
"recovered": 42000000,
"deaths": 524200
}Response Error (404):
{
"error": "Country not found"
}Response Error (500):
{
"error": "Failed to fetch COVID data"
}Example Requests:
# Get India stats (default)
curl http://localhost:5000/covid
# Get specific country
curl http://localhost:5000/covid?country=Japan
# Get US stats
curl http://localhost:5000/covid?country=United%20States- Animated background with gradient effects
- Eye-catching title: "CoviTrack"
- Subtitle: "Explore real-time COVID-19 data from anywhere on Earth"
- Interactive "Explore Now" button with smooth scroll
- Scroll indicator animation
- Full-screen overlay with fixed positioning
- Blurred hero background image
- Dark semi-transparent overlay for contrast
- Animated loading circles with bouncing animation
- Subtle pulsing title and status dots
- Responsive on all screen sizes
- Beautiful dark gradient background with Unsplash image
- Interactive search bar with glassmorphism effect
- Input field for country name search
- Search button with gradient and hover effects
- Country data card displaying:
- Country name with "Live" badge
- 4-column stats grid (responsive)
- Total Cases, Active, Recovered, Deaths
- Color-coded stat cards with side accent bars
- Animated borders on top
- Real-time update indicator
- Dark purple gradient background with floating gradient orbs
- Animated grid pattern overlay for depth
- Three insight cards with:
- Global Coverage info (200+ countries)
- Real-Time Updates info
- Data Interpretation info
- Interactive cards with hover effects and glow
- Floating animated icons in each card
- Responsive grid layout
- Premium dark aesthetic with glassmorphism
- Three-column layout:
- Left: CoviTrack branding
- Center: Three feature cards with floating icons
- β‘ Real-time data
- π 200+ countries
- π Live updates
- Right: Made with β₯ by Angela Bera credit
- Interactive hover effects on feature cards
- Animated heartbeat effect
- Gradient accent line at bottom
- Copyright notice
- Responsive stacked layout on mobile
- Glassmorphism β Frosted glass effect with backdrop blur
- Smooth Animations β All transitions are buttery smooth
- Gradient Backgrounds β Modern multi-layer gradients
- Glow Effects β Subtle shadows and glows for depth
- Color Palette:
- Primary: Cyan (
#38bdf8), Purple (#8b5cf6) - Accent: Green (Scrollbar), Red (Heart)
- Dark theme: Navy/Dark Blue backgrounds
- Primary: Cyan (
- Animated Scrollbar β Sea-green glowing scrollbar with hover effects
- Search Bar β Glassmorphic input with focus states
- Buttons β Gradient backgrounds with transform hover effects
- Cards β Lift animation on hover with glow
- Loading Animation β Bouncing circles with pulsing effects
- Hero Title β Clickable with animation trigger
- Mobile-first approach
- Breakpoints: 768px, 900px, 1100px
- Flexible grid layouts
- Touch-friendly interactive elements
- Optimized typography sizes
Edit backend/server.js:
const response = await axios.get(
"https://covid-193.p.rapidapi.com/statistics", // Change this URL
{
headers: {
"X-RapidAPI-Key": process.env.RAPID_API_KEY,
"X-RapidAPI-Host": "covid-193.p.rapidapi.com",
},
}
);Edit color values in CSS files:
- Primary gradient:
#38bdf8to#8b5cf6 - Scrollbar:
#20c997to#10b981 - Backgrounds: Adjust gradient stops
- Country Section: Edit URL in
src/styles/country-section.css - Insights Section: Edit URL in
src/styles/insights-section.css
- Live COVID-19 statistics for any country
- Automatically refreshes data on app load
- Case-insensitive country search
- Smooth page transitions
- Animated loading states
- Interactive hover effects
- Professional color scheme
- Optimized typography
- Fast API responses (with caching potential)
- Optimized React components
- Vite's lightning-fast HMR (Hot Module Replacement)
- Minimal bundle size
# Check Node.js version
node --version
# Make sure dependencies are installed
cd backend
npm install
# Check if port 5000 is in use
# Change PORT in server.js if needed- Verify
.envfile exists in root directory - Check API key is correctly copied
- Ensure API key is valid and has access to COVID-193 endpoint
- Backend has CORS enabled by default
- If issues persist, check
cors()in server.js
- Ensure backend is running on
http://localhost:5000 - Check browser console for network errors
- Verify no firewall blocking requests
- React Documentation
- Express.js Guide
- Vite Documentation
- COVID-193 API Docs
- CSS Tricks β For glassmorphism and animations
Made with β€οΈ by Angela Bera