2020-08-10 17:29:12 -04:00
# Boundary UI Monorepo
2020-10-14 08:37:11 -07:00

2020-04-20 16:40:27 -04:00
2020-08-10 17:29:12 -04:00

2020-04-23 14:33:38 -04:00
2020-04-20 16:40:27 -04:00
This monorepo contains multiple projects, including UIs and addons, used by
2020-08-10 17:29:12 -04:00
Boundary.
2020-04-20 16:40:27 -04:00
2020-04-23 12:59:40 -04:00
This top-level repository provides limited common tasks, such as installation
and commit assistance. However, most tasks must be executed from within a
subproject, e.g. running or testing.
2020-07-08 17:03:20 -04:00
2020-04-23 12:59:40 -04:00
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Prerequisites ](#prerequisites )
- [Installation ](#installation )
2020-04-23 14:05:49 -04:00
- [Yarn Commands ](#yarn-commands )
2020-04-23 12:59:40 -04:00
- [Contributing ](#contributing )
- [Branching ](#branching )
- [Building ToC ](#building-toc )
2020-11-17 11:15:42 -05:00
- [Building Admin UI for Production ](#building-admin-ui-for-production )
2020-06-26 11:49:38 -04:00
- [Building with a Container ](#building-with-a-container )
2021-01-25 12:06:15 -05:00
- [Building Desktop UI for Production ](#building-desktop-ui-for-production )
2021-05-03 12:42:55 -07:00
- [Connect Boundary UI to Boundary local instance ](#connect-boundary-ui-to-boundary-local-instance )
- [For admin ](#for-admin )
- [For desktop ](#for-desktop )
2020-04-23 12:59:40 -04:00
- [Committing ](#committing )
2020-04-23 14:03:59 -04:00
- [License Checking ](#license-checking )
2020-04-23 12:59:40 -04:00
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2020-04-20 16:40:27 -04:00
## Prerequisites
You will need the following things properly installed on your computer.
* [Git][git]
* [Node.js][node]
2022-04-26 17:06:10 -07:00
* Supported versions:`v12` , `v14` and `v16` .
2021-04-30 17:16:21 -04:00
* **Apple Silicon Users**: if you experience problems building or running
2022-04-26 17:06:10 -07:00
Boundary UIs, try Node v14.
2020-04-20 16:40:27 -04:00
* [Yarn][yarn] installed globally
2020-04-24 11:56:52 -04:00
* [Google Chrome][chrome]
* [Firefox][firefox]
2020-04-20 16:40:27 -04:00
[git]: https://git-scm.com/
[node]: https://nodejs.org/
[yarn]: https://classic.yarnpkg.com/lang/en/
2020-04-24 11:56:52 -04:00
[chrome]: https://google.com/chrome/
[firefox]: https://firefox.com/
2020-04-20 16:40:27 -04:00
[yarn-workspaces]: https://classic.yarnpkg.com/en/docs/workspaces/
## Installation
* `git clone <repository-url>` this repository
2020-08-10 17:29:12 -04:00
* `cd boundary-ui`
2020-04-20 16:40:27 -04:00
* `yarn install`
2020-04-23 14:05:49 -04:00
## Yarn Commands
List of available project commands. `yarn run <command-name>`
2020-07-29 17:07:28 -04:00
| Command | Description |
|---------------------|---|
2020-11-17 11:15:42 -05:00
| build | Builds Admin UI. |
2020-07-29 17:07:28 -04:00
| test | Runs tests in CI mode. |
| commit | Replaces `git commit` , ensures compliance, audit, lint, and test checks pass before commit is allowed and normalizes commit messages across authors. |
| lint | Runs ember-template-lint on all of the hbs, js, and sass files. |
| compliance:audit | Checks for issues using `yarn audit` with moderate and above criticality.|
| compliance:licenses | Checks that all dependencies have OSS-compatible licenses. |
| doc:toc | Automatically generates a table of contents for the README file. |
2020-04-23 14:05:49 -04:00
2020-04-20 16:40:27 -04:00
## Contributing
### Branching
2020-10-07 15:42:43 -04:00
We follow [GitHub Flow][github-flow].
2020-04-20 16:40:27 -04:00
2020-04-23 12:59:40 -04:00
### Building ToC
To autogenerate a ToC (table of contents) for this README,
2020-04-23 16:58:11 -04:00
run `yarn doc:toc` . Please update the ToC whenever editing the structure
2020-04-23 12:59:40 -04:00
of README.
2020-11-17 11:15:42 -05:00
### Building Admin UI for Production
2020-06-24 11:33:20 -04:00
2020-11-17 11:15:42 -05:00
See ui/admin/README.md Building for Production for more information on how to
build the Admin UI. Be sure to set build-related environment variables as
necessary for your target environment, as described in the Admin UI readme.
2020-06-24 12:07:29 -04:00
2020-11-17 11:15:42 -05:00
To quickly produce a production build of Admin UI, run from this folder:
2020-06-24 12:07:29 -04:00
```bash
yarn install
2020-07-29 17:07:28 -04:00
yarn build
2020-06-24 12:07:29 -04:00
```
2020-11-17 11:15:42 -05:00
Assets are saved to `ui/admin/dist/` .
2020-06-24 11:33:20 -04:00
2020-06-26 11:49:38 -04:00
#### Building with a Container
2020-07-29 17:07:28 -04:00
Optionally, you may build the UI within a container. Execute the following command:
2020-06-26 11:49:38 -04:00
```bash
2020-06-29 18:07:43 -04:00
docker-compose -f docker-compose-embedding.yml run build
2020-06-26 11:49:38 -04:00
```
2020-11-17 11:15:42 -05:00
Assets are saved to `ui/admin/dist/` .
2020-06-26 11:49:38 -04:00
2021-01-25 12:06:15 -05:00
### Building Desktop UI for Production
See ui/desktop/README.md Building for Production for more information on how to
build the Desktop UI. Be sure to set build-related environment variables as
necessary for your target environment, as described in the Desktop UI readme.
To quickly produce a production build of Desktop UI, run from this folder:
```bash
yarn install
yarn build:ui:desktop
```
2021-06-01 10:20:25 -04:00
In windows, UI is generated using docker to provide a stable UI across platforms.
```cmd
yarn install
docker-compose -f docker-compose-embedding.yml run build-desktop-production
yarn build:ui:desktop:app
```
2021-01-29 16:23:56 -05:00
To provide a signing identify for macOS build, use `BOUNDARY_DESKTOP_SIGNING_IDENTITY`
2021-06-01 10:20:25 -04:00
environment variable to set signing certificate name (e.g Developer ID Application: * (* )) when building desktop app using `yarn build:ui:desktop:app` .
2021-01-29 16:23:56 -05:00
2021-01-25 12:06:15 -05:00
Assets are saved to `ui/desktop/electron-app/out/make/` .
2021-02-23 17:01:11 -05:00
DMG packaged desktop UI is available at asset location as `boundary.dmg` .
2021-06-01 10:20:25 -04:00
EXE archived desktop UI is available at asset location under `zip` folder.
2021-01-25 12:06:15 -05:00
2021-05-03 12:42:55 -07:00
### Connect Boundary UI to Boundary local instance
This describes how to connect local Boundary UI to your local instance of Boundary.
2021-05-03 14:03:43 -07:00
This assumes you already have up and running a Boundary dev instance in your local environment with a listener `127.0.0.1:9200` (default behaviour). [Learn how to start a local Boundary dev instance ](https://learn.hashicorp.com/tutorials/boundary/getting-started-dev?in=boundary/getting-started#start-a-dev-environment ).
2021-05-03 12:42:55 -07:00
#### For admin
This assumes you are within `boundary-ui/ui/admin` .
You will need to turn `off` mirage, tell the UI where to find Boundary and run it: `$ ENABLE_MIRAGE=false API_HOST=http://localhost:9200 yarn start` .
Following terminal instructions, open in your browser: `http://localhost:4200/` .
2021-05-03 14:03:43 -07:00
Once you open the UI you will see the login screen, authenticate using generated admin login name and password.
2021-05-03 12:42:55 -07:00
#### For desktop
This assumes you are within `boundary-ui/ui/desktop` .
You will need to turn `off` mirage and run it: `$ ENABLE_MIRAGE=false yarn start:desktop` .
2021-05-03 14:13:52 -07:00
In login screen, authenticate using generated admin login name and password.
2021-05-03 12:42:55 -07:00
2021-05-03 14:03:43 -07:00
Enter the origin of your Boundary dev instance, by default is: `http://localhost:9200` .
2021-05-03 12:42:55 -07:00
2020-04-20 16:40:27 -04:00
### Committing
Instead of the default `git commit` , we prescribe a custom command that ensures
linting and other checks pass before a commit may be completed. It also ensures
that all contributors author consistent commit messages. To get started with a
2020-04-23 16:58:11 -04:00
commit, stage your files as usual. Then run `yarn commit` and follow the
2020-04-20 16:40:27 -04:00
on-screen instructions to author your message.
2020-04-23 14:03:59 -04:00
#### License Checking
2020-12-14 12:29:32 -05:00
The licenses of dependencies are checking against an allowlist before every
2020-04-23 14:03:59 -04:00
commit. This helps catch undesirable licenses sooner (e.g. GPL). If your
2020-12-14 12:29:32 -05:00
commit fails due to a non-allowlisted license, you may add it to the allowlist
2020-04-23 14:03:59 -04:00
in `package.json` _as long as it is not a GPL variant or UNLICENSED_ .
The change will be verified upon PR. GPL variants and UNLICENSED dependencies
will not be accepted.
2020-04-20 16:40:27 -04:00
[github-flow]: https://guides.github.com/introduction/flow/