Skip to content

Forecasto is a Weather app created using Spring Boot Application. Integrate the Weather API from Rapid API seamlessly into your Spring Boot application. Access weather forecast summaries and hourly details for any city with ease. Deployed on Railway app for efficient and reliable performance.

Notifications You must be signed in to change notification settings

Bhasker23/Forecasto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Forecasto - Weather API Integration with Spring Boot

This Spring Boot project integrates the Weather API from Rapid API and exposes RESTful APIs to retrieve weather forecast data for any city.

Project Overview 🖥️

This project provides a simple backend server built with Spring Boot that integrates with the Weather API from Rapid API. It includes the following features:

  • Header-based authentication with a random client ID and client secret.

  • Exposes RESTful APIs to get the weather forecast summary and hourly forecast details of any city.

  • Uses RestTemplate for making HTTP requests to the Weather API endpoints.

  • Project Deployment:

Prerequisites 🛠️

Before running this project, make sure you have the following:

  • Java Development Kit (JDK) 11 or higher installed.
  • Maven installed (if you are not using an IDE that manages dependencies).

Configuration ⚙️

  • application.properties: Contains configuration properties such as Rapid API host, key, and API URLs.

Project Structure

  • src/main/java: Contains Java source code.
    • com.forecasto: Main package for the project.
      • Forecasto.java: Main Spring Boot application class.
      • ForecastoConfig: Contains configuration classes (WeatherApiConfig.java).
      • ForecastoController: Contains RESTful controller classes (WeatherController.java).
      • ForecastoService: Contains service classes (WeatherApiService.java).
  • src/main/resources: Contains application properties and static resources.
    • application.properties: Configuration properties file.

Dependencies

  • Spring Boot Starter Web: For building web applications with Spring Boot.
  • Spring Boot Starter Test: For testing Spring Boot applications (optional).
  • Rapid API Java SDK: For integrating with the Weather API from Rapid API.

Getting Started 📋🖋️

1. Clone the repository:

git clone https://github.com/your-username/your-repo-name.git

2. Navigate to the project directory:

cd your-repo-name

3. Configure Rapid API credentials:

  • Open the application.properties file located in src/main/resources and replace the placeholders your-rapidapi-host and your-rapidapi-key with your actual Rapid API host and key.
  • To access the Rapid API, credentials (host and key) must be provided in the properties file.

 spring.application.name=Forecasto
 rapidApi.host={add-your-host-Name}
 rapidApi.key={add-your-key}
 rapidApi.url.forecastSummary=https://forecast9.p.rapidapi.com/rapidapi/forecast/
 rapidApi.url.hourlyForecast=https://api.openweathermap.org/data/2.5/forecast?q=
 openWeatherApi.Key=1204d1db8a4c17b9fc0a1f4902ede7a6

4. Build the project:

If you are using Maven, run the following command:

mvn clean install

5. Run the project:

mvn spring-boot:run

6. Access the APIs:

Once the project is running, you can access the following endpoints:

7. Additional Information:

  • Rapid API Free Tier Limit: Reacting to the free tier limit, you need to provide your Rapid API credentials (host and key) in the properties file for API access.

Please ensure that the Rapid API credentials are correctly configured in the properties file and replace "Delhi" with the desired location when making API requests.

Contributing ✌

Contributions to this project are welcome. You can contribute by:

  • Reporting issues or suggesting improvements through GitHub Issues.
  • Forking the repository and creating pull requests for new features or bug fixes.

License

This project is licensed under the MIT License. Screenshot (1095) Screenshot (1097)

👨‍💻 Happy Coding 💻 🖱️

Design and Developed by Bhasker ❤️

---

About

Forecasto is a Weather app created using Spring Boot Application. Integrate the Weather API from Rapid API seamlessly into your Spring Boot application. Access weather forecast summaries and hourly details for any city with ease. Deployed on Railway app for efficient and reliable performance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published