Skip to content

Latest commit

 

History

History
 
 

web_console

Fedlearner™ Web Console

the web console of Fedlearner.

Prerequisites

  • Concepts
    • api: the website REST API
    • components: common react components used for pages
    • libs: common libs such as LRU cache and Kubenetes client
    • middlewares: common middlewares of REST API
    • models: database ORMs
    • pages: the website pages
    • public: static files
    • services: RPC caller
    • tests: test suites
    • utils: common utilities
  • Environment
    • only use Maintenance LTS or Active LTS version of Node.js
    • always lock the version of dependencies
    • use package-lock.json to manage dependencies
    • always setup dependencies with npm ci
    • remember to update package-lock.json for new dependencies by npm i
    • use MySQL 5.6+ version (or MariaDB 10.0+ version)
  • Config
    • use server.config.js to config environment variables
    • K8S_HOST: the hostname of Kubernetes api server
    • K8S_PORT: the port of Kubernetes api server
    • use .env.development to maintain browser environment config for development
    • use .env.production to maintain browser environment config for production
  • Contribution

Development

make sure local-hosted database was setup

npm ci
npm run dev

then open site at http://127.0.0.1:1989.

Deployment

make sure Docker and remote-hosted database were setup

npm run build:image
docker run --rm -it -p 1989:1989 -e DB_HOST=[database host] DB_USERNAME=[database username] DB_PASSWORD=[database password] fedlearner-web-console

Testing

npm run test

for testing with coverage report:

npm run cov

Release

release action should only be executed by maintainers

make a new release with tagged commit, m.m.p must follow semver standard:

# make sure you are at master branch
npm run release -- --release-as m.m.p
git push origin master --tags

then create a new release at Github with latest content from CHANGELOG.md.