This project consists of a Svelte application with it's supporting development, testing, and deployment tools. The application was requested by Norsk institutt for naturforskning and is designed to let them view and interact with their environmental data, as they previously have had to use excel sheets for this purpose. The project is indended to integrate with their infrastructure, however it is still possible to run it locally with test data.
The application uses SvelteKit to deliver a single page application. It utilizes client side hydration to dynamically update the webpage with environmental data as the user navigates the web application.
The application can either be used with the test docker compose in this repostory, or used in a custom docker compose with upload, authentication, and postgrest services.
- The machine running docker compose has to have Docker Desktop (or optionally just Docker engine if using linux), and Docker compose installed.
This is to set up the application with basic testing data. The upload functionality does not actually upload any files.
- First clone Interactive-Database-for-Environmental-Data into a directory using
git clone <url>
- Then run the command
docker compose up --build -d
to build and run the Svelte application
See usage for how to use the application.
This is how to set up the application as it was intended to be used.
-
Create a docker compose in a Git repository which has the following services:
- A service for authentication following our authentication documentation
- A Postgres database with the following schema
- A PostgREST endpoint
- An upload service following our upload documentation
- A service which uses the Dockerfile in the root of this repository. Can for example be called frontend.
- A proxy service which takes all the requests and routes them to the correct service based on their endpoints
-
Add this repo (link) as a submodule to your Git repository, placing it in a folder compatible with the service which should use the dockerfile. For example
/frontend/
. This should enable your docker compose to access the Dockerfile in the root of this repository. (Git submodules guide) -
(Optional) If you want to use custom endpoints for the different services, configure the following envrionment variables:
VITE_POSTGREST_URL=<postgrest endpoint>
VITE_UPLOAD_URL=<upload endpoint>
VITE_AUTH_URL=<auth endpoint>
-
Then run the command
docker compose up --build -d
to build and run the Svelte application and the other services it uses -
Add the SQL views outlined in the PostgREST API documentation to the Postgres database. This will ensure that PostgREST exposes the required endpoints for the application.
-
Upload your excel files containing your data in the web application following the schema in the upload documentation
To use the application simply visit the website on the following which applies:
http://localhost
for accessing locallyhttp://<your-ip>
for accessing by ip addresshttp://<your-domain>
for accessing by domain
If the application was set up for testing, you can log into the website with the following credentials:
- Username:
admin
- Password:
admin
If needed, the user guide can be found here
- Kavishnayan Nadarajah
- Kevin Nikolai Mathisen
- Carl Petter Mørch-Reiersen
- Martin Solevåg Glærum