- Python 3.10 or higher + PIP
- Azure CLI, and an Azure Subscription
- Visual Studio Code IDE
-
Clone the repository.
-
Log into the Azure CLI:
- Check your login status using:
az account show
- If not logged in, use:
az login
- To specify a tenant, use:
az login --tenant 16b3c013-0000-0000-0000-000000000
- Check your login status using:
-
Create a Resource Group:
- You can create it either through the Azure Portal or the Azure CLI:
az group create --name <resource-group-name> --location EastUS2
- You can create it either through the Azure Portal or the Azure CLI:
-
Deploy the Bicep template:
- You can use the Bicep extension for VSCode (Right-click the
.bicep
file, then select "Show deployment plane") or use the Azure CLI:az deployment group create -g <resource-group-name> -f deploy/macae-dev.bicep --query 'properties.outputs'
- Note: You will be prompted for a
principalId
, which is the ObjectID of your user in Entra ID. To find it, use the Azure Portal or run:You will also be prompted for locations for Cosmos and Open AI services. This is to allow separate regions where there may be service quota restrictionsaz ad signed-in-user show --query id -o tsv
- You can use the Bicep extension for VSCode (Right-click the
-
Create a
.env
file:- Navigate to the
src
folder and create a.env
file based on the provided.env.sample
file.
- Navigate to the
-
Fill in the
.env
file:- Use the output from the deployment or check the Azure Portal under "Deployments" in the resource group.
-
(Optional) Set up a virtual environment:
- If you are using
venv
, create and activate your virtual environment for both the frontend and backend folders.
- If you are using
-
Install requirements - frontend:
- In each of the frontend and backend folders -
Open a terminal in the
src
folder and run:pip install -r requirements.txt
- In each of the frontend and backend folders -
Open a terminal in the
-
Run the application:
- From the src/backend directory:
python app.py
- In a new terminal from the src/frontend directory
python frontend_server.py
- Open a browser and navigate to
http://localhost:3000
- To see swagger API documentation, you can navigate to
http://localhost:8000/docs
You can debug the API backend running locally with VSCode using the following launch.json entry:
{
"name": "Python Debugger: Backend",
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}/src/backend",
"module": "uvicorn",
"args": ["app:app", "--reload"],
"jinja": true
}
To debug the python server in the frontend directory (frontend_server.py) and related, add the following launch.json entry:
{
"name": "Python Debugger: Frontend",
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}/src/frontend",
"module": "uvicorn",
"args": ["frontend_server:app", "--port", "3000", "--reload"],
"jinja": true
}