teleport/web/README.md
Alexey Kontsevoy 43d2a39a21 Teleport V5 (#185)
* New Top Nav (#136)
* Moves AuthConnectors/TrustedClusters/Roles to the Dashboard Top Nav
* Add feature to allow user in context to perform operations on other users (#137)
* Added List/Create/Update/Delete/Reset user functionality
* Added enterprise api endpoint to OSS config
Co-authored-by: Alexey Kontsevoy <biz.kovoy@gmail.com>

* Fix handling of feature flags (#138)
* Prevent closing when there is an error with deleting user (#142)
* Alexey/v5nav (#155)
* Touch Ups (#157)
* Create a story for Teleport App (#158)
* Add Application Launcher (AAP) (#162)
* use publicAddr and clusterName URL parameters to launch apps. (#169)
* Update sideNav styles and ssh input box (#170)
* [teleport] Implement add node dialog (#165)
* [teleport] Change NodeJoinToken prop expires to expiry (#176)
* Remove empty state from NodesList (#179)
* [teleport] Add -f flag to add node curl command (#180)
* [teleport] Add app session chunk and start events (#181)
* Add Application Dialog
* Delete Force
Co-authored-by: Lisa Kim <lisa@gravitational.com>
2020-11-09 17:02:33 -05:00

3.2 KiB

Gravitational Web Applications and Packages

This mono-repository contains the source code for the web UIs of the following projects: Teleport Gravity

The code is organized in terms of independent yarn packages which reside in the packages directory.

Getting Started

You can make production builds locally or you can use Docker to do that.

Local Build

Make sure that you have yarn installed on your system since this monorepo uses the yarn package manager.

Then you need download and initialize these repository dependencies.

$ yarn install

To build the Teleport web UI

$ yarn build-teleport

To build the Gravity web UI

$ yarn build-gravity

The resulting output will be in the /packages/{package-name}/dist/ folders respectively.

Docker Build

To build all packages

$ make all

To build the Teleport web UI

$ make packages/teleport/dist

To build the Gravity web UI

$ make packages/gravity/dist

Development

To avoid having to install a dedicated Teleport or Gravity cluster, you can use a local development server which can proxy network requests to an existing cluster.

For example, if https://example.com:3080/web is the URL of your cluster UI then:

To start your local Teleport development server

$ yarn start-teleport --target=https://example.com:3080/web

To start your local Gravity development server

$ yarn start-gravity --target=https://example.com:3080/web

This service will serve your local javascript files and proxy network requests to the given target.

Keep in mind that you have to use a local user because social logins (google/github) are not supported by development server.

Unit-Tests

We use jest as our testing framework.

To run all jest unit-tests:

$ yarn run test

To run jest in watch-mode

$ yarn run tdd

Interactive Testing

We use storybook for our interactive testing. It allows us to browse our component library, view the different states of each component, and interactively develop and test components.

To start a storybook:

$ yarn run storybook

This command will open a new browser window with storybook in it. There you will see components from all packages so it makes it faster to work and iterate on shared functionality.

Setup Prettier on VSCode

  1. Install plugin: https://github.com/prettier/prettier-vscode
  2. Go to Command Palette: CMD/CTRL + SHIFT + P (or F1)
  3. Type open settings
  4. Select Open Settings (JSON)
  5. Include the below snippet and save:

// Autoformat on save
"editor.formatOnSave": false,

// Specify prettier configuration file
"prettier.configPath": ".prettierrc",

"[javascript]": {
    "editor.formatOnSave": true
},

"[javascriptreact]": {
    "editor.tabSize": 2,
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},

"[html]": {
    "editor.tabSize": 2,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
}