Skip to content

innoTUgrid/backend

Repository files navigation

Backend services for innoTUgrid

The backend consists of multiple independent services each providing different functionality.

how to run this code (docker)

Remove any existing containers and volumes:

docker compose down -v

Pull our prebuilt image from ghcr.io:

docker compose pull

Run the containers:

docker compose up -d

how to run this code locally

  1. start the container running the database detached from the terminal
docker compose up -d db
  1. if running it for the first time or after recreating the database ...
./scripts/init-db.sh
  1. then: docker compose up -d

drop database e.g. in case initial data has been updated and needs to reinitialize (see step 2. above)

  1. remove the database container
docker compose down db -v
  1. then start the database container detached from the terminal
docker compose up db -d
  1. then run the initialization script
./scripts/init-db.sh

finally check ping endpoint in terminal ...

curl -X GET localhost:3000

... or call it via a browser and remember to stay caffeinated ;-)

localhost:3000

optionally access the database to run SQL queries directly

  1. access the database container
docker exec -it timescaledb bash
  1. log into database (replace environemnt variables with parameters found in .env file)
psql -U ${POSTGRES_DB_USER} -d ${POSTGRES_DB_NAME}

check API documentation

Open the documentation/inno2grid_api_documentation.yaml using the Online Swagger Editor. If you want to run API calls from Swagger you might need to run it locally. Follow the Swagger Docs to set up a localhost using Docker.

About

backend services for a microgrid data API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors