Files
threshold-ui/README.md
T

229 lines
8.3 KiB
Markdown
Raw Normal View History

2020-08-10 17:29:12 -04:00
# Boundary UI Monorepo
2020-10-14 08:37:11 -07:00
![](boundary.png)
2020-08-10 17:29:12 -04:00
![Validate Monorepo](https://github.com/hashicorp/boundary-ui/workflows/Validate%20Monorepo/badge.svg)
2020-04-23 14:33:38 -04:00
This monorepo contains multiple projects, including UIs and addons, used by
2020-08-10 17:29:12 -04:00
Boundary.
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).
## Prerequisites
You will need the following things properly installed on your computer.
* [Git][git]
* [Node.js][node]
* Supported versions: `v18` and `v20`.
* [Yarn][yarn] installed globally
* [Google Chrome][chrome]
* [Firefox][firefox]
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
## Installation
* `git clone <repository-url>` this repository
2020-08-10 17:29:12 -04:00
* `cd boundary-ui`
* `yarn install`
2020-04-23 14:05:49 -04:00
## Yarn Commands
List of available project commands. `yarn run <command-name>`
| Command | Description |
|---------------------|---|
| build | Builds Admin UI for production. |
| 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
## Contributing
### Branching
We follow [GitHub Flow][github-flow].
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.
### Building Admin UI for Production
See [Admin UI README](ui/admin/README.md#building-for-production) for more information on how to
build the Admin UI for production. Be sure to set build-related environment variables as
necessary for your target environment, as described in the [Environment Variables](ui/admin/README.md#environment-variables) section of README.
To quickly produce a production build of Admin UI, run from this folder:
```bash
yarn install
yarn build
```
Assets are saved to `ui/admin/dist/`.
#### Building with a Container
Optionally, you may build the UI within a container. Execute the following command:
```bash
docker-compose -f docker-compose-embedding.yml run build
```
Assets are saved to `ui/admin/dist/`.
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
```
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-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
### Connect Boundary UI to Boundary local instance
This describes how to connect local Boundary UI to your local instance of Boundary.
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://developer.hashicorp.com/boundary/tutorials/get-started-community/community-get-started-dev)
#### 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.
#### 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.
2022-07-27 10:25:01 -07:00
Enter the cluster URL of your Boundary dev instance, by default is: `http://localhost:9200`.
### 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-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.
[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/