Skip to content

jack-richards/energy-data-visualisation-api

Repository files navigation

energy-data-centre-visualisation

Back-end Application

https://github.com/jack-richards/energy-data-visualisation-api

Front-end Application

https://github.com/jack-richards/energy-data-visualisation-ui

Getting started

Prerequisites

Clone the repositories

git clone https://github.com/jack-richards/energy-data-visualisation-api.git
git clone https://github.com/jack-richards/energy-data-visualisation-ui.git

Download the dataset

You have to download and unzip the dataset files provided as part of the paper:

Canet, A., Qadrdan, M., Jenkins, N. et al. Spatial and temporal data to study residential heat decarbonisation pathways in England and Wales. Sci Data 9, 246 (2022). https://doi.org/10.1038/s41597-022-01356-9

It has a section on the data/files (which this project requires) and where to download them.

Once acquired, you must unzip and place the files into the /data directory. After, set the DATA_DIR environment variable to equal /data.

You may prefer setting it up on the environment variable your IDE, or you can do it on the command line:

On Linux/MacOS:

export DATA_DIR=/data

On Windows:

$env:DATA_DIR = "/data"

Install dependencies for the frontend

cd into the frontend directory, then run:

pnpm install

Set environment variables for the frontend

For the contact form to work you will need to set the following .env variables with valid values:

NUXT_MAILHOST=?
NUXT_MAILPORT=587
NUXT_MAILUSER=?
NUXT_MAILPASSWORD=?
NUXT_CONTACTMAIL=?

Run the frontend

cd into the frontend directory, then run:

pnpm dev

You can then access the frontend at http://localhost:3000.

Run the frontend in production mode

cd into the frontend directory, then run:

pnpm build
node .output/server/index.mjs

You can then access the frontend at http://localhost:3000.

Install dependencies for the backend

cd into the backend directory, then run:

pip install -r requirements.txt

Set environment variables for the backend

Assuming you have already set the DATA_DIR environment variable, you must also set the following environment variables:

  • REDIS_URI - The URI of the Redis server, for example, redis://localhost:6379.

Initialise the database

Assuming you have already set the DATA_DIR and REDIS_URI environment variables set,

cd into the backend directory, then run:

python initialise_csv.py

Run the backend

Assuming you have already set the DATA_DIR and REDIS_URI environment variables set,

cd into the backend directory, then run:

uvicorn main:app --reload

This will start the backend server on port 8000 while binding to localhost.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages