@Paul Boon and everyone, would you benefit from some sort of installation guide for the SPA? I took a few notes while deploying to https://dev1.dataverse.org/spa/
This is what I have so far, very much a work in progress:
This is an opinionated guide that make the following assumptions:
git clone https://github.com/IQSS/dataverse-frontend.git
cd dataverse-frontend
git checkout develop
git pull
# adjust version as needed
export VERSION=v0.1.0
git checkout $VERSION
sudo yum install nodejs
npm install
cd packages/design-system && npm run build
cd ../..
cp .env.example .env
# edit .env, especially VITE_DATAVERSE_BACKEND_URL
vi .env
npm run build -- --base=/spa
cd deployment/payara
mvn package -Dversion=$VERSION
# replace with your server
scp target/dataverse-frontend.war rocky@dev1.dataverse.org:/tmp
/usr/local/payara6/glassfish/bin/asadmin deploy --name dataverse-frontend --contextroot /spa /tmp/dataverse-frontend.war
Especially the sudo yum install nodejs part is a work in progress. In practice, for now, I'm running npm commands on my Mac laptop.
@Philip Durbin π Looks elegant to deploy a war.
When you have Dataverse frontend with Apache (httpd) then alternatively you could deploy the frontend under the Apache webroot (default /var/www/html).
So after the building step you need to copy the dist folder to that apache webroot and rename it to /var/www/html/spa. Then the apache config must be changed; place the folowing in the config
ProxyPassMatch ^/spa !
Be sure to put it before the line for the AJP to Payara.
Then restart Apache:
sudo systemctl restart httpd
I do have Dataverse fronted with Apache. I think I might like your way better.
@Paul Boon before the build you have to configure a .env file, right?
Yes indeed, you have to set the VITE_DATAVERSE_BACKEND_URL correctly, thats what I did, but I start to think that might only be needed in a dev environmen?
BTW I was not to happy about building the application for each server specifically. But a workaround could be to build it wit some GUUID and the do some magical find and replace on the resulting files for each server.
Yeah, I wasn't too happy either. Hopefully we can find a solution.
I updated my draft installation guide above to mention the .env file.
@Paul Boon do you have auth working? For now I skipped all that. :sweat_smile:
Same for me, I looked into getting Keycloak to work on my VM, but it is kind of involved, using a Postgres db and a jar that connects with the Datavesre db to handle build-in autentication...
Have you played around with dev-env at https://github.com/IQSS/dataverse-frontend yet? That's what I'll try next.
That dev-env works, but with docker containers, and we run our stuff on servers and the development with Vagrant/Virtualbox VM's
Gotcha, non-Docker.
I guess that building the SPA can also be done with some container that has everything in place for building, but I am not to confident in my docker skills yet to try it out.
If you're not confident you can only imagine how I feel! :sweat_smile:
As for using the dev-env with another backend, I did try to connect the SPA to the backend on my Vagrant box, but ran into problems... think is was CORS, anyways it didn't work and I abondened the idea.
Right. Well, it sounds like you'd appreciate an installation guide for classic, non-Docker installations.
When I mentioned I took some notes yesterday @GermΓ‘n Saracca said they are open to a pull request. Maybe we can work together on it.
Sure, but if it means we have to figure out how to get that Keycloak working and also have that Filestorage (needs Minio S3) problem fixed there is a lot to do.
Yeah. No rush! :sweat_smile:
So, yum install nodejs didn't "just work" for me (see #troubleshooting > building the SPA on Rocky 9) so I switched to nvm (which worked fine) and made a few more tweaks. Here's my latest version of the installation guide.
This is an opinionated guide that make the following assumptions:
git clone https://github.com/IQSS/dataverse-frontend.git
cd dataverse-frontend
git checkout develop
git pull
# adjust version as needed
export VERSION=v0.1.0
git checkout $VERSION
# set up NVM: https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
# use node 19, for correct version see DEVELOPER_GUIDE.md in https://github.com/IQSS/dataverse-frontend
nvm install 19
nvm use 19
# install SPA dependencies
npm install
# build design system
cd packages/design-system && npm run build
cd ../..
# configure SPA. TODO: auth and OIDC. See docs/KEYCLOAK_DEPLOYMENT.md in https://github.com/IQSS/dataverse-frontend
cp .env.example .env
# change this to your Dataverse backend URL
export SITE_URL=https://demo.dataverse.org
sed -i "s|VITE_DATAVERSE_BACKEND_URL=http://localhost:8000|VITE_DATAVERSE_BACKEND_URL=$SITE_URL|" .env
# build SPA
npm run build -- --base=/spa
# build war file
cd deployment/payara
mvn package -Dversion=$VERSION
# deploy war file
/usr/local/payara6/glassfish/bin/asadmin deploy --name dataverse-frontend --contextroot /spa target/dataverse-frontend.war
Should we put containerization of the SPA including its build on the #ct meeting agenda?
I'm not actively working on that, but please feel free!
In this topic, I'm talking about non-Docker installations, so far anyway. :smile:
Last updated: Nov 01 2025 at 14:11 UTC