This is a Python web application built with FastAPI that provides current weather information. The application utilizes a PostgreSQL database that contains a table with 25,000+ cities. Users can retrieve the following information for each city:
- Current clothing recommendations based on weather conditions (clothing information stored in MongoDB)
- Current weather and location information (from the PostgreSQL database, including population, timezone, region, country, etc.)
Before you proceed, please make sure you have the following installed on your machine:
- Docker: Install Docker
- Docker Compose: Install Docker Compose
- Clone this git repo
git clone https://github.com/MikhailKras/weather-buddy.git
- Change your working directory to the
weather-buddy
directory:
cd weather-buddy
-
Set enviroment variables in .env.prod
-
Build docker image:
docker compose --env-file .env.prod build app
- Up docker compose:
docker compose --env-file .env.prod up -d
After the successful process, you can access the Weather Buddy app by going to http://localhost:9999 in your web browser.
- User authentication with OAuth 2.0 and bearer JWT token
- Two-step registration process:
- Step 1: Choose city name
- Step 2: Input additional information (username, email, password)
- Email verification with synchronous SMTP using
smtplib
and Celery for asynchronous email tasks - Rate limiter for several endpoints with FastAPI-Limiter (using Redis)
- CSS styles and Bootstrap 5 framework for frontend
- JavaScript scripts for sending requests to the API
- Search history: Track and display user's search history for cities and coordinates
{
"_id": "64834ea1fda0d16eceebf0ca",
"temperatureRange": { "min": 10, "max": 15 },
"precipitation": {
"None": {
"UpperBody": {
"BaseLayer": { "clothingItems": ["Light long-sleeve shirt"] },
"MidLayer": { "clothingItems": ["Light jacket"] },
"OuterLayerShell": { "clothingItems": [] },
"Accessories": { "clothingItems": ["Hat"] }
},
"LowerBody": {
"BaseLayer": { "clothingItems": ["Light pants"] },
"MidLayer": { "clothingItems": [] },
"OuterLayerShell": { "clothingItems": [] },
"Accessories": { "clothingItems": [] }
},
"Footwear": { "clothingItems": ["Sneakers"] }
},
"Rain": {
"UpperBody": {
"BaseLayer": { "clothingItems": ["Light long-sleeve shirt"] },
"MidLayer": { "clothingItems": ["Raincoat"] },
"OuterLayerShell": { "clothingItems": [] },
"Accessories": { "clothingItems": ["Umbrella"] }
},
"LowerBody": {
"BaseLayer": { "clothingItems": ["Light pants"] },
"MidLayer": { "clothingItems": [] },
"OuterLayerShell": { "clothingItems": [] },
"Accessories": { "clothingItems": [] }
},
"Footwear": { "clothingItems": ["Waterproof sneakers"] }
}
}
}
This project is licensed under the MIT License - see the LICENSE file for details.