Skip to content

veraPDF/verapdf-webapp-gui

Repository files navigation

GUI for veraPDF web application

Cloning sources

GUI repository uses submodules with server code and pdf.js code.

To initiate and update submodules use:

git submodule update --init

If you pass --recurse-submodules to the git clone command, it will automatically initialize and update each submodule in the repository.

If you run git submodule update --remote --recursive, Git will go into your submodules and fetch and update for you.

Dev environment

Prerequisites

Node (latest) + yarn (latest)

Preparation

Install dependencies:

yarn install

Build backend services and run them in docker as described in server's README, section Running in docker.

Running dev server

Runs the app in the development mode:

yarn start

Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

To execute unit tests run:

yarn test

This will launch the test runner in the interactive watch mode.
See the section about running tests for more information.

Using pdf.js submodule

To run the app using pdfjs submodule instead of yarn dependency add an environment variable USE_PDFJS_FROM_SOURCES=true to your start configuration.

To switch back to the pdfjs yarn dependency remove the environment variable or set USE_PDFJS_FROM_SOURCES=false.

Running in Docker

Prerequisites

Install Docker on your machine

Build sources

Build backend services:

cd ./server
mvn clean install

Build production ready static content:

yarn install
yarn run build

Run service stack

Run stack on a local machine:

cd server/.docker/
docker-compose -f docker-compose.yml -f ../../.docker/docker-compose.staging.yml up -d --build

In this case default values for environment variables will be used which are defined in server/.docker/.env file.

Wiki

If you want to setup a server serving the application you can use utility scripts. For the reference on available scripts please consult with Scripts reference.

We have certain code convensions for GUI development which are described at Code conventions wiki page.