Skip to content

Commit

Permalink
Add command for running frontend via nox (ethyca#689)
Browse files Browse the repository at this point in the history
* Add command for running frontend via nox

* Fix linting and formatting

* Update readme

* Update clients/admin-ui/README.md

Co-authored-by: Thomas <[email protected]>

Co-authored-by: Thomas <[email protected]>
  • Loading branch information
allisonking and ThomasLaPiana authored May 24, 2022
1 parent 9fa0ce5 commit 94425fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The types of changes are:

* Replaced `make` with `nox`
* Removed usage of `fideslang` module in favor of new [external package](https://github.com/ethyca/fideslang) shared across projects
* Added starting up the frontend server to `nox`

### Docs

Expand Down
7 changes: 5 additions & 2 deletions clients/admin-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ Admin UI for managing Fidesctl.

1. Run `nox -s api` in top-level `fides` directory
2. In a new shell, `cd` into `clients/admin-ui`, install via `npm install`, then run `npm run dev`.

- Alternatively, can run `nox -s admin_ui` to do both the install and run steps.

3. Navigate to `http://localhost:3000/`.

## Preparing for production

To view a production version of this site, including the backend:

1. Run `npm prod-export`. This will
1. Export the static site to `out/`
1. Copy the build from `out/` to the folder in the backend which will serve static assets at `/`
1. Export the static site to `out/`
1. Copy the build from `out/` to the folder in the backend which will serve static assets at `/`
1. Run `nox -s api` in the top-level `fides` directory.
1. Navigate to `http://localhost:8000`
10 changes: 10 additions & 0 deletions noxfiles/dev_nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ def api(session: nox.Session) -> None:
session.run(*run_in_background, external=True)


@nox.session()
def admin_ui(session: nox.Session) -> None:
"""Spin up the frontend server in development mode"""
npm_install = ("npm", "install")
npm_run = ("npm", "run", "dev")
with session.chdir("clients/admin-ui"):
session.run(*npm_install, external=True)
session.run(*npm_run, external=True)


@nox.session()
def cli(session: nox.Session) -> None:
"""Spin up a local development shell."""
Expand Down

0 comments on commit 94425fc

Please sign in to comment.