Skip to content

costacis21/margera-weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructions for DB creation:

  1. Clone this repository:

    git clone https://github.com/costacis21/margera-weather.git
  2. Change directories:

    cd margera-weather
  3. Create a new python environment:

    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  4. Create a Meteomatics API account

  5. Create a .env file containing the following variables:

    METEOMATICS_USERNAME="YOUR-METEOMATICS-USERNAME"
    METEOMATICS_PASSWORD="YOUR-METEOMATICS-PASSWORD"
    DB_PATH="weather.db"
  6. Run script

    python create_db.py

Instructions for local hosting

  1. Move to app directory:

    cd weatherAPI/src/weatherapi/
  2. Run uvicorn webservice:

    uvicorn app.main:app --reload
  3. Open your browser and go to http://127.0.0.1:8000

  4. For documentations head to http://127.0.0.1:8000/docs

Instructions for hosting on gcp

> Requires google-cloud-sdk 
  1. Authenticate with gcloud and set variables

    gcloud auth login
    gcloud config set project PROJECT_ID
    gcloud config set run/region europe-north1
    gcloud auth configure-docker

    Must be in this directory weatherAPI/src/weatherapi/

  2. Deploy!

    gcloud run deploy sample --port 8080 --source .
  3. A link will be printed that points to the webservice. If you add /docs to the end of that link, it will prompt you with the relevant documentation

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors