Skip to content

wxli0/app-ui

 
 

Repository files navigation

app-ui

Required software

Configuration

The following environment variables can be used to configure the server:

  • NODE_ENV : the environment mode, either production or development (default)
  • PORT : the port on which the server runs (default 3000)

Configure RethinkDB

  1. Download RethinkDB
  2. Start your RethinkDB server by following the steps here
  3. Go to src/server/database/config.js and modify the ip field to match your server address
  4. Start the project : npm run start or npm run watch, then the server will auto create all the required tables for you.

Run targets

  • npm start : start the server
  • npm stop : stop the server
  • npm run build : build project
  • npm run build-prod : build the project for production
  • npm run bundle-profile : visualise the bundle dependencies
  • npm run clean : clean the project
  • npm run watch : watch mode (debug mode enabled, autorebuild, autoreload)
  • npm test : run tests
  • npm run lint : lint the project

Running via Docker

Build the container. Here, app-ui is used as the container name.

cd app-ui
docker build --build-arg "NODE_ENV=production" -t app-ui .

Run the container:

docker run -it -p 12345:3000 -u "node" -e "NODE_ENV=production" --name "app-ui" app-ui

Notes:

  • The -it switches are necessary to make node respond to ctrl+c etc. in docker.
  • The -p switch indicates that port 3000 on the container is mapped to port 12345 on the host. Without this switch, the server is inaccessible.
  • The -u switch is used so that a non-root user is used inside the container.
  • The -e switch is used to set environment variables. Alternatively use --env-file to use a file with the environment variables.
  • References:

Testing

All files /test will be run by Mocha. You can npm test to run all tests, or you can run mocha -g specific-test-name (prerequisite: npm install -g mocha) to run specific tests.

Chai is included to make the tests easier to read and write.

Publishing a release

  1. Make sure the tests are passing: npm test
  2. Make sure the linting is passing: npm run lint
  3. Bump the version number with npm version, in accordance with semver. The version command in npm updates both package.json and git tags, but note that it uses a v prefix on the tags (e.g. v1.2.3).
  4. For a bug fix / patch release, run npm version patch.
  5. For a new feature release, run npm version minor.
  6. For a breaking API change, run npm version major.
  7. For a specific version number (e.g. 1.2.3), run npm version 1.2.3.
  8. Push the release: git push origin --tags

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.0%
  • CSS 14.6%
  • HTML 0.4%