Skip to content

Latest commit

 

History

History
125 lines (80 loc) · 4.9 KB

README.md

File metadata and controls

125 lines (80 loc) · 4.9 KB

Buildly React Template

Build Status Documentation Status Gitter

Buildly React Template is a React web application that implements the core features of the UI core, pre-configure to connect to Buildly Core.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

The web application was tested and built with the following versions:

  • node v16.14.2

  • yarn v1.17.3

  • You need to create .env.development.local file with the env variables (something as below). buildly-react-template |--.env.development.local

window.env={
    API_URL: "https://dev.example.com/",
    OAUTH_TOKEN_URL: "https://dev.example.com/oauth/token/",
    OAUTH_CLIENT_ID: "sjkghwty982092u1tjfwjit0348y82092utwgio",
    PRODUCTION: "false",
}
  • In case you want to run https we app version on your local, you need to have a certificate created for your localhost already. Modify package.json file to indicate the path to you certififcate and key in the scripts --> https:local

Installing

First of all, you need to have a Buildly Core instance up and running locally. Further detail about how to deploy Buildly Core locally, check its documentation.

To install the application you need to download and install its dependencies, so you have to navigate to the project folder and run the following command:

$ yarn install

Now, initialize and build the project

$ yarn run build:local

To run the web app:

$ yarn run start:local

To run the https web app:

$ yarn run https:local

Your Buildly React Template will be running locally and listening to the port 3000, so you can access it via your browser typing this address: 127.0.0.1:3000

Running the tests

To run tests using Jest:

$ yarn run test

Deployment

To deploy Buildly React Template on live, you can either use our Buildly React Template Docker image from Docker Hub or build your own image and host it somewhere, so it can be used with your deployment platform and/or tool.

Build Docker image

First you need to have the web app dependencies installed and the app initialized locally. And then you need to build it as a production application executing the following command:

$ yarn run build:prod

Now, you just need to build a Docker image and host it somewhere. Further info about how to build images, check Docker's documentation.

Configuration

The following table lists the configurable parameters of Buildly React Template and their default values. They can be updated in the Docker container via flags as below or configured as environment variables in Travis.

Parameter Description Default
API_URL Buildly Core URL ``
OAUTH_CLIENT_ID The client identifier issued to the client during Buildly Core deployment ``
OAUTH_TOKEN_URL Buildly Core URL used to authenticate users ``

Specify each parameter using -e, --env, and --env-file flags to set simple (non-array) environment variables to docker run. For example,

$ docker run -e MYVAR1 --env MYVAR2=foo \
    --env-file ./env.list \
    buildly/buildly-react-template

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Buildly - Initial work

See also the list of contributors who participated in this project.

License

This project is licensed under the GPL v3 License - see the LICENSE file for details