diff --git a/docs/pages/usage/local_dev_guide.md b/docs/pages/usage/local_dev_guide.md new file mode 100644 index 00000000..949cf89f --- /dev/null +++ b/docs/pages/usage/local_dev_guide.md @@ -0,0 +1,93 @@ +--- +layout: page +title: Local Development Guide +permalink: /pages/usage/local-dev-guide/ +weight: 105 +--- + +## Prerequisites + +- [Python 3.9+](https://www.python.org/downloads/) +- [Node.js 18+](https://nodejs.org/) +- [pnpm](https://pnpm.io/installation) + +--- + +## Setup + +**Create a virtual environment (if required):** + +- ```bash + python -m venv .venv + ``` + +**Activate venv:** + +- PowerShell + + ```powershell + .\.venv\Scripts\Activate.ps1 + ``` + +- Bash + + ```bash + source .venv/bin/activate + ``` + +## API (Backend) + +Set environment variables (while the virtual environment is active): + +- PowerShell + + ```powershell + # Replace with your user folder or path to the repos + $env:AAZ_PATH = "/aaz" + $env:AAZ_SWAGGER_PATH = "/azure-rest-api-specs" + $env:AAZ_SWAGGER_MODULE_PATH = "/azure-rest-api-specs/specification" + $env:AAZ_CLI_PATH = "/azure-cli" + $env:AAZ_CLI_EXTENSION_PATH = "/azure-cli-extensions" + + $env:FLASK_APP="aaz_dev.app.app:create_app" + ``` + +- Bash + + ```bash + # Replace with your user folder or path to the repos + export AAZ_PATH="/aaz" + export AAZ_SWAGGER_PATH="/azure-rest-api-specs" + export AAZ_SWAGGER_MODULE_PATH="/azure-rest-api-specs/specification" + export AAZ_CLI_PATH="/azure-cli" + export AAZ_CLI_EXTENSION_PATH="/azure-cli-extensions" + + export FLASK_APP="aaz_dev.app.app:create_app" + ``` + +**Start application:** + +- ``` + flask run --reload --port 5000 + ``` + +## Frontend: + +- Install dependencies + + ``` + pnpm install + pnpm build:typespec + pnpm build:web + pnpm run bundle + + + cd src/web + pnpm install + ``` + +- Run front-end dev server (from `src/web`) + + ``` + pnpm run dev + ```