This is the UI for Kodo Kojo project
kodokojo-ui
is a licensed under GNU General Public License v3.
You want to contribute? You are very welcome!
Chat with us on Gitter.
Please read following commit message policy and contributing policy.
- NodeJS (see package.json file for version).
- Consider using nvm to switch node version in development easily.
- Docker 1.8 or newer.
- jq.
- A working build of kodokojo project.
The UI is tested on Firefox and Chrome
Firefox |
Chrome |
Safari |
---|---|---|
last version | last version | last version |
thanks to @godban for the badge generator
You have to set some environment variables.
For Mac users with Docker Toolbox, setup DOCKER_HOST environment variable:
$ eval $(docker-machine env default) // mount docker env variables
For Windows users, you may do something like (not sure of the command, please PR if it is not correct):
> docker-machine env
You can set environment variables for toggle features (optional).
SIGNUP_ENV=true
RECAPTCHA_ENV=<site key>
TOS_ENV=<terms of service uri>
WAITING_LIST_ENV=true
CRISP_ENV=<site key>
Set variables locally, and run:
$ npm run build:configuration
$ docker run -p 8080:80 -d -e BACK_HOST="0.0.0.0" -e BACK_PORT="1234" -e <VARIABLE_ENV>=<value> kodokojo/kodokojo-ui:<version>
Some feature are customizable from environment variables.
By default it set to 'debug'. You can change it by setting:
LOG_LEVEL_ENV=<level>
Level can be one of the following:
- silly: no logs
- debug: all logs
- info: info and above
- warn: warn and above
- error: just error logs
First install npm packages, build development files into static/, start webpack dev server on localhost:3000.
$ NODE_ENV=development npm install
$ npm run start:dev
Then open ui project in browser.
$ open http://localhost:3000
If you want to test production build
$ npm run start:prod
Then open ui project in browser.
$ open http://localhost:3000
You can use API_PROTOCOL_ENV
and API_HOST_ENV
to use an external Kodo Kojo backend api dns.
$ export API_PROTOCOL_ENV=https://
$ export API_HOST_ENV=kodokojo.mydomaine.com
$ npm run start:custom
Then open ui project in browser.
$ open http://localhost:3000
Like custom environment (see above) but with production build:
$ npm run start:local
Then open ui project in browser.
$ open http://localhost:3000
To connect the frontend to mocked backend. We use kodokojo-mocks for this. Configurations are in mocks/
folder.
First start mock server in a terminal:
$ npm run start:server:mock
Then start kodokojo-ui in an other terminal:
$ npm run start:mock
Finally, open ui project in browser:
$ open http://localhost:3000
Except with custom and mock configurations, you will need to run Kodo Kojo backend to be able to test and develop locally.
To start the cluster locally, you have to go to kodokojo/kodokojo folder and start docker-compose:
$ docker-compose -f src/test/resources/docker/full/docker-compose.yml up -d
Then to start cluster located to an AWS, you have to go to kodokojo/kodokojo folder and start docker-compose (please be sure your docker-compose file is properly configured):
$ docker-compose -f src/test/resources/docker/aws/docker-compose.yml up -d
Please refers to proper documentation for explanation details.
Build production docker image of the front release.
Note: works on OSX and Linux. For Windows users you have to run the build.sh script manually.
$ npm run build:docker
It build the project, then put static/ content into /delivery/target/kodokojo-ui-<version>.tar.gz and finally build the docker image with Nginx server (kodokojo/kodokojo-ui).
Build and run styleguide.
$ npm run styleguide
Then open your browser.
$ open http://localhost:9001
$ npm run license
Run tests.
$ npm test
Run tests in watch mode.
$ npm run test:watch
Run coverage.
$ npm run coverage
$ open ./coverage/lcov-report/index.html
Patch
$ npm run release:patch
Minor
$ npm run release:minor
Major
$ npm run release:major
❤️ Thanks to all Open source projects which made such project possible!