Skip to content
← Back to projects

Http Client Course OpenWeatherMap

The skeleton application for the Laravel framework.

Laravel Logo

Build Status Total Downloads Latest Stable Version License

#About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

#Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, Laracasts can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

#Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Partners program.

#Premium Partners

#Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

#Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

#Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

#License

The Laravel framework is open-sourced software licensed under the MIT license.

#Laravel Weather App

A simple Laravel application that displays the current weather for London, UK using the OpenWeatherMap API.

#Features

  • Real-time weather data for London
  • Beautiful, responsive UI with Tailwind CSS
  • Dark mode support
  • Comprehensive weather information including:
    • Temperature and "feels like" temperature
    • Weather description with icons
    • Humidity and atmospheric pressure
    • Wind speed and direction
    • Sunrise and sunset times
    • Visibility and cloud cover
  • Error handling for API failures

#Setup Instructions

  1. Clone the repository:

    git clone <repository-url>
    cd openweathermap
    
  2. Install dependencies:

    composer install
    npm install
    
  3. Environment configuration:

    cp .env.example .env
    php artisan key:generate
    
  4. Get OpenWeatherMap API Key:

  5. Configure environment variables: Add your API key to the .env file:

    OPENWEATHER_API_KEY=your_actual_api_key_here
    OPENWEATHER_BASE_URL=https://api.openweathermap.org/data/2.5
    
  6. Build assets:

    npm run build
    # or for development
    npm run dev
    
  7. Serve the application:

    php artisan serve
    

    The application will be available at http://localhost:8000

#Project Structure

  • app/Services/WeatherService.php - Handles OpenWeatherMap API communication
  • app/Http/Controllers/HomeController.php - Homepage controller
  • config/services.php - API configuration
  • resources/views/welcome.blade.php - Weather display view
  • routes/web.php - Application routes

#API Error Handling

The application includes comprehensive error handling:

  • Invalid API key (401 Unauthorized)
  • Invalid coordinates (400 Bad Request)
  • Rate limit exceeded (429 Too Many Requests)
  • Service temporarily unavailable (5xx errors)
  • Network timeouts and connection issues

When the API is unavailable, the application displays helpful error messages and setup instructions.

#Technologies Used

  • Laravel 11+ - PHP framework
  • Tailwind CSS - Styling framework
  • OpenWeatherMap API - Weather data provider
  • Vite - Frontend build tool

#License

This project is open-sourced software licensed under the MIT license.

New version available.