This repository contains the source code of the frontend of the INCIT-EV Decision Support System (DSS). The backend code can be found in this repository.
It has been developed as part of the INIT-EV project.
In order to get this project up and running, you first need to set up the DSS backend.
- You can run all the necessary components of the DSS locally using Docker Compose:
git clone https://github.com/LINKS-FCC/INCIT-EV_DSS.git
cd backend/dss/docker
docker-compose up -d
The DSS backend is composed of four main components:
dss-backend
: this is the API the frontend uses to perform simulations.dss-integration
: the simulation engine. Only the backend can perform requests to it.mongo-db
: the database used to stored users, projects and analyses.mongo-express
: optional component to ease external access to the database.
The frontend only interacts with the dss-backend
component, which should be available at
http://localhost:5000 . However, to work properly, the DSS database needs to be initialized.
More info about this can be found in the here in the backend repository.
- You can now set the needed environment variables for the frontend to run locally:
export DSS_BACKEND_BASE_URL="http://127.0.0.1:5001/"
export NEXTAUTH_URL="http://127.0.0.1:3000/"
export NEXTAUTH_SECRET="<your_secret>"
The NEXTAUTH_SECRET is used to encrypt the session token. You can generate a random string using the following command:
openssl rand -base64 32
- You are now ready to build the frontend using whatever package manager you prefer. For example, using yarn:
cd src/frontend
yarn install
yarn build
yarn dev run
Alternatively, you can use the provided docker container:
docker run \
-it \
-p 3000:3000 \
-e DSS_BACKEND_BASE_URL=$DSS_BACKEND_BASE_URL \
-e NEXTAUTH_URL=$NEXTAUTH_URL \
-e NEXTAUTH_SECRET=$NEXTAUTH_SECRET \
ghcr.io/atos-research-and-innovation/incitev-dss-frontend:latest
You can now access the DSS frontend at http://localhost:3000 .