Argiris Deligiannidis ec9ae3afb3
All checks were successful
continuous-integration/drone/push Build is passing
add nginx configs
2024-04-14 23:21:43 +03:00
2024-04-14 23:21:43 +03:00
2024-04-07 13:01:31 +03:00
2024-04-07 10:15:35 +00:00
2024-04-07 13:01:31 +03:00
2024-04-14 23:00:07 +03:00
2024-04-14 23:00:07 +03:00
2024-04-07 13:01:31 +03:00
2024-04-14 23:00:07 +03:00
2024-04-07 13:01:31 +03:00
2024-04-14 23:00:07 +03:00

weather_api

Overview

This API serves as a backend system for managing the location of the Open Meteo Weather dashboard. It includes functionalities for creating, updating, deleting and searching available locations.

Endpoints

  1. GET /locations:
    • Retrieve a list of all the locations stored in the database.
    • The locations configured by the user
  2. GET /locations/{id}:
    • Retriev weather data for the specified ID.
  3. POST /locations: Add a new location to the database.
  4. DELETE /locations/{id}:
    • Delete a location with the specified ID.
  5. GET /location/search:
    • Get available locations from Open Meteo using the Geolocation API they provide

Database Integration

  • Implemented SQLAlchemy connection with a Postgres database.
  • Implemented Models:
    • Location` model with id, name, latitude, and longitude.
    • Users model with
  • Database Tables:
    • locations
      • For location storing
    • users:
      • Prototype table for user information
    • config:
      • Storing of user selected locations for the Dashboard

Image

Installation

To run the API locally, follow these steps:

  1. Clone the repository.
  2. Deploy and activate a venv
  3. Install the necessary dependencies by running pip install -r requirements.txt.
  4. Set up the database connection in the config.py file.
  5. Run the application by executing uvicorn main:app --reload.
  • Or you can use the Dockerfile for creating a docker image.
    • Also there is a public image at git.argideli.com/argideli/weather_api:latest
Description
Weather API, Open Meteo API calls and Postgre database
Readme 71 KiB
Languages
Python 95.9%
Dockerfile 4.1%