A web-based implementation of the SAFAD model developed by Röös et al. (2024, in press) to benchmark environmental impacts of diets.
Every time a change is made on the main branch, the website is deployed to safad.se, thanks to the service Netlify.
From GitHub.com: Go to src/default-input-files
and, in the top-right corner, press the "Add File" button and select "Upload
files". You will then be redirected to a page where you can upload the new files
which will replace the old files. Remember that the name of the file is
important, as is the order of the columns in the file. Files that you do not
upload will remain unchanged (e.g. if you upload SAFAD IP Recipes.csv
, that
file will be replaced, and all other files remain unchanged).
From CLI: Update the file in ./src/default-input-files/
, stage, commit and
push.
The version consists of two component: one "major" and one "minor" version,
separated by a period. Example: 2.34
, where 2
is the major and 34
is the
minor version.
The major version is defined explicitly, while the minor version is increased by 1 each time a commit is made, starting from a specific date.
To change it, you will need to edit the file vite.config.ts
, where the
variables VERSION_MAJOR
(a number) and VERSION_MINOR_COUNT_SINCE
(a date)
can be defined. You can do this directly from github.com, using the built-in
editor (go to the file and press the edit-button in the
top-right corner, which is a pen-icon).
The project relies on extensive processing of the input data, some of which can
be found in the ./data-preprocessing/
directory. The majority, however, are
internal R-scripts and excel documents, as described in the above-mentioned
paper.
The implementation of the website, along with the input
files can be found in the ./src/
directory, with the main logic being inside the ./src/lib/
folder.
Some important files are:
One way to better understand what is going on in each file may be to look at the
test files (same names, but ending with .test.ts
instead of just .ts
).
The front-end uses Vue as the main framework, together with TypeScript. These tools all require a working installation of node and a package-management system (e.g. npm, included when installing node).
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
npm install
npm run dev
npm run build
npm run test