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 assuming you have access to data with the correct format.
The application uses sveltekit to deliver a client side rendered, single page application. It utilizes client side hydration to dynamically update the webpage with environmental data as the user navigates the web application.
There are two steps to set up the application. As the application depends on a postgres database with a mounted postgrest api for data access, this has to be installed first. Afterwards the application can be ran for testing or for deployment using nginx.
- The machine has to have Docker Desktop (or optionally just Docker engine if using linux), and Docker compose installed.
- If using windows, you have to have wsl2 installed.
- First clone fishboat-database into a linux environment using
git clone <url>
- Follow the
README
in the same git repo to configure the database. - Upload your excel files containing your data to localhost:8000. Only on file at a time! TODO: add example data
- Insert all the SQL views found in docs/PostgREST-API.md into Postgres by using the
data/SQL/
section on Hasura
- First clone Interactive-Database-for-Environmental-Data into a linux environment using
git clone <url>
- Create a file called
.env
with the following format:VITE_POSTGREST_URL=<postgrest url>
. The default postgrest url is localhost:8000/postgrest/. - (Optional) If your service runs on a domain, you can add another line to the
.env
file as follows:SERVER_NAME=<domainname>
. - Run the command
docker-compose up --build -d
to build and run the svelte application TODO: use docker compose instead of docker-compose
This is only meant for testing purposes
- First clone Interactive-Database-for-Environmental-Data into a linux environment using
git clone <url>
- Create a file called
.env.test
inclient/
with the following format:VITE_POSTGREST_URL=<postgrest url>
. The default postgrest url is localhost:8000/postgrest/. - Install all dependencies for the application by running the command
npm install
inclient/
. - Run the application with the command
npm run dev
inclient/
. The url the website is accesible by should be shown in the commandline.
To use the application simply visit the website on the following which applies:
http://<your-ip>:80
for accessing by ip addresshttp://<your-domain>:80
for accessing by domainhttp://localhost:80
for accessing locally
- Kavishnayan Nadarajah
- Kevin Nikolai Mathisen
- Carl Petter Mørch-Reiersen
- Martin Solevåg Glærum