The Weather API is used to collect the weather data from multiple places. You'll have access to the humidity and temperature instantaneous of the places.
This project uses the technologies above to make all work. For the database was used the TinyDB to manage a simple JSON file that saves the weather data for each request.
To make the API was using the FastAPI. A web framework for building fast and reliable APIs.
For the weather data was use the OpenWeather API.
In this project, since the API make requests for 168 cities was use the AIOHTTP for asynchronous HTTP requests.
In the end, to make it all very easy to work with as used the already known Docker to make isolated environments that can be executed in any machine!
This API has simple functionality. For the GET it receives the User ID for the POST request and returns the number of cities already completed. The POST request returns the JSON database file with the user ID and the weather data of the 168 cities.
Follow the next steps very careful.
1° Clone the repository to your desktop.
git clone https://github.com/JohnnyNovaes/weatherAPI.git
2° Register into the OpenWeather API for the API KEY.
3° Put the API KEY from OpenWeather API into the file apiKEY.txt.
4° Build the docker image using the Dockerfile.
docker build -t myimage .
5° Run a container with the image created.
docker run -d --name mycontainer -p 80:80 myimage
6° Type into your browser: 0.0.0.0/docs.


