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 -->
2023-07-12 13:53:39 -07:00
2023-08-16 14:58:14 -07:00
- [Boundary UI Monorepo ](#boundary-ui-monorepo )
- [Projects ](#projects )
- [Core (addons/core): ](#core-addonscore )
- [API (addons/api): ](#api-addonsapi )
- [Auth (addons/auth): ](#auth-addonsauth )
- [Rose (addons/rose) ](#rose-addonsrose )
- [Admin (ui/admin) ](#admin-uiadmin )
- [Desktop Client (ui/desktop) ](#desktop-client-uidesktop )
- [Prerequisites ](#prerequisites )
- [Optional Tooling ](#optional-tooling )
- [Installation ](#installation )
- [Yarn Commands ](#yarn-commands )
- [Contributing ](#contributing )
- [Branching ](#branching )
- [Building ToC ](#building-toc )
- [Building Admin UI for Production ](#building-admin-ui-for-production )
- [Building with a Container ](#building-with-a-container )
- [Building Desktop UI for Production ](#building-desktop-ui-for-production )
- [Connect Boundary UI to Boundary local instance ](#connect-boundary-ui-to-boundary-local-instance )
- [For admin ](#for-admin )
- [For desktop ](#for-desktop )
- [Committing ](#committing )
- [License Checking ](#license-checking )
2020-04-23 12:59:40 -04:00
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2023-07-10 09:00:43 -07:00
## Projects
This monorepo contains multiple projects.
### Core (addons/core):
Core features use by Boundary UI's, i.e i18n, helpers or components. [Project Readme ](addons/core ).
### API (addons/api):
The API data access layer for Boundary and all the related mocks. [Project Readme ](addons/api ).
### Auth (addons/auth):
Authentication layer for Boundary. [Project Readme ](addons/auth ).
### Rose (addons/rose)
Common styles and components shared by Boundary UIs. [Project Readme ](addons/rose ).
### Admin (ui/admin)
The Admin UI for Boundary. [Project Readme ](ui/admin ).
### Desktop Client (ui/desktop)
The desktop client UI for Boundary. [Project Readme ](ui/desktop ).
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]
2024-06-13 16:08:30 -04:00
* Supported versions: 'v18' and `v20` .
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
2023-07-12 13:53:39 -07:00
## Optional Tooling
Our team finds the following applications useful in day-to-day development
workflows. These are merely recommendations. We encourage you to use the tools
that best suit you and your personal style.
* [VS Code][vscode]: Code editor for building and debugging web applications
* [Warp][warp]: Terminal application for macOS
* [Homebrew][homebrew]: The missing package manager for macOS and Linux
* [Ember Inspector][ember-inspector]: Understand and debug Ember applications
* [Postman][postman]: Test and inspect APIs
2020-04-20 16:40:27 -04:00
## 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. |
| 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
2023-07-12 13:53:39 -07:00
docker-compose -f docker-compose-embedding.yml run build-desktop-production
2021-06-01 10:20:25 -04:00
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
2022-07-27 10:25:01 -07:00
Enter the cluster URL 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
2022-06-27 14:35:52 -04:00
We use `husky` and `lint-staged` to ensure linting and other checks pass before a
commit is completed. Simply do a `yarn install` to make sure the hooks are installed.
Use a normal `git commit` to go through the checks, if you need to skip these checks,
use `git commit --no-verify` to bypass them. However, a consistent commit message will
still be enforced even if you use `--no-verify` .
2020-04-20 16:40:27 -04:00
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/
2023-07-12 13:53:39 -07:00
[git]: https://git-scm.com/
[node]: https://nodejs.org/
[yarn]: https://classic.yarnpkg.com/lang/en/
[chrome]: https://google.com/chrome/
[firefox]: https://firefox.com/
[yarn-workspaces]: https://classic.yarnpkg.com/en/docs/workspaces/
[homebrew]: https://brew.sh
[warp]: https://www.warp.dev
[vscode]: https://code.visualstudio.com/
[ember-inspector]: https://guides.emberjs.com/release/ember-inspector/
[postman]: https://www.postman.com/downloads/