IFRCGo / go-frontend

MIT License
21 stars 5 forks source link

Waffle.io - Columns and their card count

IFRC GO Frontend

This repository contains the user interface of the IFRC GO.

Installation and Usage

The steps below will walk you through setting up a development environment for the frontend.

Install Project Dependencies

To set up the development environment for this website, you'll need to install the following on your system:

Install Application Dependencies

If you use nvm, activate the desired Node version:

nvm install

Install Node modules:

yarn install

Usage

Environment variables

All the environment variables are stored in .env file in the project's base directory. Currently there are 4 environment variables:

Environment variables for sentry:

Sample .env file

REACT_APP_MAPBOX_ACCESS_TOKEN=<your_mapbox_token>
REACT_APP_API_ENDPOINT=https://goadmin-stage.ifrc.org/

Starting the app

yarn start

Compiles the sass files, javascript, and launches the server making the site available at http://localhost:3000/ The system will watch files and execute tasks whenever one of them changes. The site will automatically refresh since it is bundled with livereload.

Another possibility is to use a docker image for local development; it can be started via: docker-compose up This will arrange all steps concerning yarn install and yarn start; this is the recommended way.

Deployment

Deploy a branch to surge.sh for testing and preview

We use surge.sh to deploy directly from a branch to test new features and fixes. To do this:

Once the testing is over, remember to teardown:

If it says you don't have permissions to deploy, it likely means someone has deployed this branch already. You can chose to create another URL, or create a new branch, or get in touch with that person.

Possible error(s)

Prepare to deploy for production

To prepare the app for deployment run:

yarn build

This will package the app and place all the contents in the build directory. The app can then be run by any web server.

Managing SVG Icons

For icons, we use collecticons-processor to build a custom font, which is then used on the frontend via CSS classes.

To add an icon: