A modern weather tracking application built with React, Vite, and Supabase authentication.
- 🌤️ Real-time weather data for any city worldwide
- 📅 3-day weather forecast
- 🗺️ Interactive weather map with click-to-explore
⚠️ Weather alerts and warnings- 🔐 User authentication with Supabase
- 📊 Detailed weather metrics (temperature, humidity, wind, pressure, etc.)
- 🎨 Dynamic backgrounds based on weather conditions
- Frontend: React 19, React Router v7
- Build Tool: Vite 7
- Authentication: Supabase
- Maps: React Leaflet
- API: OpenWeather API
- Styling: Custom CSS with glassmorphism effects
- Node.js (v16 or higher)
- npm or yarn
- Supabase account
- OpenWeather API key
- Clone the repository:
git clone https://github.com/cbsk-49/WeatherApp.git
cd WeatherApp- Install dependencies:
npm install- Set up environment variables:
- Copy
.env.exampleto.env - Get your Supabase anon key:
- Go to https://supabase.com/dashboard
- Select your project
- Settings → API
- Copy the
anonpublickey
- Update
.envwith your keys:
- Copy
VITE_OPENWEATHER_API_KEY=your_openweather_api_key
VITE_SUPABASE_URL=https://ykloznldvabceeorfsxm.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key-
Enable Email Authentication in Supabase:
- Go to Authentication → Providers in your Supabase dashboard
- Enable Email provider
-
Start the development server:
npm run devThe app will be available at http://localhost:5173
- Click "Sign In" in the header
- Create an account with your email and username
- Verify your email (check spam folder if needed)
- Sign in with your credentials
- Your username will appear in the header: "Welcome, [username]!"
- Enter a city name in the search box on the home page
- Click "Get Weather" to see current weather
- View detailed metrics including temperature, humidity, wind, and more
- Navigate to the Forecast page
- Enter a city name to see a 3-day forecast
- View high/low temperatures and weather conditions
- Navigate to the Maps page
- Click anywhere on the map to get weather for that location
- View markers for previously clicked locations
- Use "Center on Last Click" to refocus the map
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
WeatherApp/
├── public/ # Static assets
├── src/
│ ├── assets/ # Images and media
│ ├── contexts/ # React contexts (AuthContext)
│ ├── lib/ # Utilities and configurations
│ │ └── supabaseClient.js
│ ├── pages/ # Page components
│ │ ├── About.jsx
│ │ ├── Alerts.jsx
│ │ ├── Auth.jsx
│ │ ├── Forecast.jsx
│ │ ├── Header.jsx
│ │ ├── Maps.jsx
│ │ └── WeatherCard.jsx
│ ├── App.jsx # Main app component
│ ├── main.jsx # App entry point
│ └── index.css # Global styles
├── .env # Environment variables (not in git)
├── .env.example # Example environment file
└── package.json
- Never commit
.envfile to version control - Keep your API keys secure
- The
.gitignorefile excludes.envby default
Pull requests are welcome! For major changes, please open an issue first.
MIT
- Weather data provided by OpenWeather
- Authentication powered by Supabase
- Maps powered by Leaflet