Skip to content

SwevenSoftware/BlockCOVID-web

Repository files navigation

Build status codecov code style: prettier

BlockCOVID-web

Description

Web module for the project BlockCOVID. This module provides a web interface for the administrator of a running instance of the server module.

Usage

Prerequisites

This module requires an instance of the server module running. By default the client tries to redirect all API requests to localhost:8091, if you have an instance of the server module running somewhere else you should change the default proxy behaviour in nginx.conf, for example

location /api/ {
    proxy_pass http://my.api.server:8091;
}

redirects all API requests to my.api.server:8091

The latest version of npm is also necessary in order to test, build and run the server, a detailed guide on how to install it can be found here.

Building

The following process builds a static version of the server and deploys it through a docker container running a nginx web server. API redirection is handled through nginx, so configure it as described in the previous section. The steps to accomplish in order to run the application are

# Install the dependencies
npm install
# Build the static bundle
npm run build
# build and run the container
docker-compose up --build -d

A daemonized container will be created, running the application.

Development environment

npm run dev

Builds the bundled application for a development environment, do this instead of npm run build in the building process to run the development environment.

Dynamic development

npm start

Starts a serve server to test the application, this solution allows a dynamic recompiling of the application after every change.

Contributing

We adopt a Gitflow workflow. So in order to contribute to the application the steps are:

  • start from develop branch
  • git flow feature start [faeture name] (alternatively git checkout -b feature/[feature name])
  • implement the new feature and the corresponding tests
  • commit your changes
  • git flow feature publish [feature name] (alternatively git push -u origin feature/[feature name])
  • open a pull request describing your changes and addressing issues if necessary eventually an administrator will review your work and merge it in the develop branch.

pre-commit hook

Builds will fail if the code is not compliant with the prettier formatting. Therefore add this hook to git that prevents you from committing anything that is not correctly formatted

cp pre-commit.sh .git/hooks/pre-commit

text can be formatted with

npm run formatApply

About

Web client for the BlockCOVID project

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages