Skip to content

A beautiful, minimalistic weather application that provides real-time weather information for any city worldwide. Built with React, TypeScript, and Tailwind CSS.

Notifications You must be signed in to change notification settings

atharv-hacking/sky-cue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cb07932Β Β·Β Β· Jul 28, 2025

History

2 Commits
Jul 28, 2025
Jul 28, 2025

Repository files navigation

WeatherNow - Modern Weather App

A beautiful, minimalistic weather application that provides real-time weather information for any city worldwide. Built with React, TypeScript, and Tailwind CSS.

WeatherNow App

✨ Features

  • City Search: Enter any city name to get current weather information
  • Dynamic Backgrounds: Background changes based on weather conditions (sunny, cloudy, rainy, snowy)
  • Temperature Unit Toggle: Switch between Celsius and Fahrenheit
  • Detailed Weather Info: Temperature, humidity, wind speed, pressure, visibility, and more
  • Responsive Design: Works perfectly on desktop, tablet, and mobile devices
  • Modern UI: Clean, minimalistic interface with beautiful gradients and animations
  • Error Handling: Graceful error messages for invalid cities or API issues
  • Demo Mode: Works with demo data when no API key is provided

πŸš€ Technologies Used

  • React 18 - Modern React with hooks
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first CSS framework
  • Vite - Fast development build tool
  • shadcn/ui - Beautiful UI components
  • Lucide React - Modern icon library
  • OpenWeatherMap API - Weather data provider

πŸ“¦ Installation & Setupetup

Prerequisites

  • Node.js 16+ and npm installed
  • OpenWeatherMap API key (optional for demo mode)

Quick Start

  1. Clone the repository

    git clone YOUR_GIT_URL>gt;
    
    cd YOUR_PROJECT_NAME>gt;
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Open your browser Navigate to http://localhost:8080 to see the app

Getting Live Weather Data

To use live weather data instead of demo data:

  1. Get an API key

  2. Update the API key

    • Open src/services/weatherService.ts
    • Replace 'demo_key' with your actual API key:
    const API_KEY = 'your_actual_api_key_here';

🎨 Design System

The app features a comprehensive design system with:

  • Weather-themed gradients for different conditions
  • Semantic color tokens for consistent theming
  • Responsive typography and spacing
  • Smooth animations and transitions
  • Glass-morphism effects for modern aesthetics

Color Themes

  • Sunny: Warm yellows and oranges
  • Cloudy: Cool grays and blues
  • Rainy: Deep blues and grays
  • Snowy: Light blues and whites
  • Clear: Bright blues and whites

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ components/           # Reusable UI components
β”‚   β”œβ”€β”€ ui/              # shadcn/ui components
β”‚   β”œβ”€β”€ SearchBar.tsx    # City search input
β”‚   β”œβ”€β”€ WeatherCard.tsx  # Main weather display
β”‚   └── TemperatureToggle.tsx  # Unit toggle button
β”œβ”€β”€ services/            # Business logic
β”‚   └── weatherService.ts # Weather API integration
β”œβ”€β”€ pages/               # Route components
β”‚   β”œβ”€β”€ Index.tsx        # Main weather app page
β”‚   └── NotFound.tsx     # 404 page
β”œβ”€β”€ hooks/               # Custom React hooks
β”œβ”€β”€ lib/                 # Utility functions
└── index.css           # Global styles & design system
tem
esign system

πŸ”§ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Run ESLint

🌐 API Integration

The app integrates with the OpenWeatherMap API to fetch real-time weather data:

  • Current Weather: Get current conditions for any city
  • Error Handling: Proper error messages for API failures
  • Rate Limiting: Respects API rate limits
  • Demo Mode: Fallback demo data when API is unavailable

API Endpoints Used

  • GET /weather - Current weather data by city name

πŸ“± Features in Detail

Dynamic Backgrounds

The app automatically changes its background gradient based on the current weather condition:

  • Clear skies β†’ Sunny gradient (yellows/oranges)
  • Cloudy β†’ Cloudy gradient (grays/blues)
  • Rain/Drizzle β†’ Rainy gradient (deep blues)
  • Snow β†’ Snowy gradient (light blues/whites)
  • Thunderstorm β†’ Stormy gradient (dark blues/grays)

Weather Information Displayed

  • Current temperature with "feels like" temperature
  • Weather description and icon
  • Humidity percentage
  • Wind speed (km/h)
  • Atmospheric pressure (hPa)
  • Visibility distance (km)

Responsive Design

  • Mobile-first approach
  • Adapts to all screen sizes
  • Touch-friendly interface
  • Optimized loading states

πŸš€ Deployment

Using Lovable

  1. Open your Lovable Project
  2. Click "Share" β†’ "Publish"
  3. Your app will be deployed automatically

Manual Deployment

  1. Build the project: npm run build
  2. Deploy the dist folder to your hosting platform
  3. Configure your hosting to serve index.html for all routes

Hosting Platforms

  • Vercel: Automatic deployments from Git
  • Netlify: Drag & drop deploymentment
  • GitHub Pages: Free static hosting
  • Firebase Hosting: Google's hosting platform

πŸ”’ Environment Variables

Currently, the app uses a hardcoded API key for simplicity. For production use:

  1. Create a .env file (not included in this template)
  2. Add your API key: VITE_WEATHER_API_KEY=your_key_here
  3. Update the service to use: import.meta.env.VITE_WEATHER_API_KEY

πŸ› οΈ Customization

Adding New Weather Conditions

To add support for new weather conditions:

  1. Update getBackgroundClass() in Index.tsx
  2. Add new gradient classes in tailwind.config.ts
  3. Define gradient colors in index.css

Styling Modifications

  • Modify design tokens in src/index.css
  • Update Tailwind config in tailwind.config.ts
  • Customize components in their respective files

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Commit: git commit -m 'Add some feature'
  5. Push: git push origin feature-name
  6. Submit a pull request

πŸ“„ License

This project is open source and available under the MIT License.

πŸ’‘ Future Enhancements

  • 5-day forecast display
  • Geolocation support for current location
  • Weather alerts and notifications
  • Multiple cities management
  • Historical weather data
  • Weather maps integration
  • Dark/light mode toggle
  • Offline support with cached data

πŸ†˜ Troubleshooting

Common Issues

Weather data not loading

  • Check your internet connection
  • Verify your API key is correct
  • Check browser console for errors

App not starting

  • Ensure Node.js 16+ is installed
  • Delete node_modules and run npm install
  • Check for port conflicts (default: 8080)

Styling issues

  • Clear browser cache
  • Check for CSS conflicts
  • Verify Tailwind CSS is properly configured

Built with ❀️ using modern web technologies. Enjoy using WeatherNow!

About

A beautiful, minimalistic weather application that provides real-time weather information for any city worldwide. Built with React, TypeScript, and Tailwind CSS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages