Frontend app (React) for the JDH journal: journal issues, write and read scholar publication on digital history
yarn install
make run-dev
Makefile contains a couple of useful commands that inject local environmental variable:
run-dev:
REACT_APP_GIT_TAG=$(shell git describe --tags --abbrev=0 HEAD) \
REACT_APP_GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) \
REACT_APP_GIT_REVISION=$(shell git rev-parse --short HEAD) \
yarn start
In development environment, to add a PROXY api different than http://localhost
add the REACT_APP_PROXY as env variable (it can be stored in a local .env.development
file)
We use docker c2dhunilu/journal-of-digital-history The repo contains the built files and it is shipped automatically to docker hub with the github actions. See the docker-stack repo on how we do use the frontend app in production: docker-compose.yml#L83
The frontend app uses bootstrap with Reactbootstrap. The main stylesheet is at ./src/styles/index.scss
and import all variables defined in the ./src/styles/_variables.scss
as CSS variables.
Then every component has its own module.scss (read the documentation on react scss module) that has access to the css variables e.g. var(--gray-100)
;
Fonts are loaded with WebFontLoader in ./src/index.js: Fira sans and Fira Mono