https://github.com/logancyang/weather-competition
A weather scoring and comparison app for a list of cities, built with FastAPI and deployed on Heroku.
https://github.com/logancyang/weather-competition
fastapi
Last synced: 14 days ago
JSON representation
A weather scoring and comparison app for a list of cities, built with FastAPI and deployed on Heroku.
- Host: GitHub
- URL: https://github.com/logancyang/weather-competition
- Owner: logancyang
- Created: 2020-08-10T21:17:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-18T04:03:24.000Z (over 3 years ago)
- Last Synced: 2025-07-04T02:43:58.555Z (10 months ago)
- Topics: fastapi
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## City Weather Competition
This is a weather comparison app for a list of cities, built with FastAPI, Poetry, deployed on Heroku.
### How to get more cities from AccuWeather
Find API key in `.env` on ec2.
```
curl -X GET "http://dataservice.accuweather.com/locations/v1/cities/search?apikey=&q="
```
### How to deploy: EC2 for scheduled jobs
ssh into ec2 and go to the repo,
```
# Start the python environment
poetry shell
# Find the running processes
ps -ef | grep python
# Kill the existing ones
kill -9
# Start new ones
nohup python -u -m weather_competition.scheduled_job &
nohup python -u scheduled_email/send_email.py &> emaillog.out &
```
### How to deploy: Heroku for backend service
Go to Heroku https://dashboard.heroku.com/apps/dragon-weather/deploy/github, make sure to manually deploy master branch.
### How to test Heroku deploy
```
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET https://dragon-weather.herokuapp.com/compete24h\?apikey\=\&city_ids\=348181
```