A modern full-stack weather application that provides real-time weather forecasts using OpenWeatherMap API. The application consists of a Spring Boot backend and a React frontend.
- Real-time weather data fetching
- City-based weather search with country code support
- Caching for improved performance
- Error handling and resilience patterns
- Reactive programming with Spring WebFlux
- Modern UI with React
- Swagger API documentation
- Spring WebFlux for reactive programming
- Caffeine caching
- Circuit breaker pattern
- Structured logging
- OpenAPI/Swagger documentation
- Modern React with hooks
- Responsive design
- Error handling
- Loading states
- TypeScript support
- Java 17+
- Node.js 16+
- Maven 3.6+
- OpenWeatherMap API key
- Clone the repository:
git clone https://github.com/yourusername/weather-app.git
cd weather-app/backend- Configure environment variables:
Create
application.properties:
openweathermap.api.key=your_api_key
openweathermap.base.url=https://api.openweathermap.org/data/2.5/weather- Build and run:
mvn clean install
mvn spring-boot:runThe backend will start at http://localhost:8080
- Navigate to frontend directory:
cd ../frontend- Install dependencies:
npm install- Start the application:
ng serveThe frontend will start at http://localhost:4200
Access the Swagger UI at: http://localhost:8080/swagger-ui.html
curl -X POST http://localhost:8080/api/weather/current \
-H "Content-Type: application/json" \
-d '{"city":"London"}'spring.cache.type: Cache provider (default: caffeine)spring.cache.caffeine.spec: Cache specificationlogging.level.root: Logging level
- apiUrl: Backend API URL (http://localhost:8080/api/weather/forecast)
cd backend
mvn testcd frontend
npm testdemo/
├── backend/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ └── resources/
│ │ └── test/
│ ├── pom.xml
│ └── README.md
├── frontend/
│ ├── src/
│ │ ├── app/
│ │ ├── environments/
│ ├── package.json
└── README.md
- CSRF protection
- API key validation
- Request validation
- Error handling
- Rate limiting
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE.md file for details
- Ganesh - YourGithub
- OpenWeatherMap API for weather data
- Spring Boot team for the amazing framework
- Angular team for the frontend framework
Ganesh - iamganeshbiradar@gmail.com
Project Link: https://github.com/bee-rather/demo