Skip to content

Commit 2a5b8b8

Browse files
docs: Add local development setup guide and update deployment documentation
1 parent e68d475 commit 2a5b8b8

File tree

3 files changed

+124
-4
lines changed

3 files changed

+124
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Follow the quick deploy steps on the deployment guide to deploy this solution to
7272
[Click here to launch the deployment guide](./docs/DeploymentGuide.md)
7373
<br/><br/>
7474

75+
**For Local Development:**
76+
- [Local Development Setup Guide](docs/LocalDevelopmentSetup.md) - Comprehensive setup instructions for Windows, Linux, and macOS
77+
7578
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/document-generation-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/document-generation-solution-accelerator) | [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvZG9jdW1lbnQtZ2VuZXJhdGlvbi1zb2x1dGlvbi1hY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==) |
7679
|---|---|---|
7780

docs/DeploymentGuide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
244244
7. You can now delete the resources by running `azd down`, if you are done trying out the application.
245245
> **Note:** If you deployed with `enableRedundancy=true` and Log Analytics workspace replication is enabled, you must first disable replication before running `azd down` else resource group delete will fail. Follow the steps in [Handling Log Analytics Workspace Deletion with Replication Enabled](./LogAnalyticsReplicationDisable.md), wait until replication returns `false`, then run `azd down`.
246246

247+
248+
> **Note:** To set up and run the application locally for development, see the [Local Development Setup Guide](./LocalDevelopmentSetup.md).
249+
247250
### 🛠️ Troubleshooting
248251
If you encounter any issues during the deployment process, please refer [troubleshooting](../docs/TroubleShootingSteps.md) document for detailed steps and solutions
249252

Lines changed: 118 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Local Debugging Setup
1+
# Local Development Setup Guide
22

33
Follow the steps below to set up and run the **Document-Generation-Solution-Accelerator** locally.
44

@@ -42,10 +42,14 @@ Choose a location on your local machine where you want to store the project file
4242
code .
4343
```
4444

45-
## Local Setup/Debugging
45+
## Local Setup/Deplpoyment
4646

4747
Follow these steps to set up and run the application locally:
4848

49+
## Local Deployment:
50+
51+
You can refer the local deployment guide here: [Local Deployment Guide](https://github.com/microsoft/document-generation-solution-accelerator/blob/main/docs/DeploymentGuide.md)
52+
4953
### 1. Open the App Folder
5054
Navigate to the `src` directory of the repository using Visual Studio Code.
5155

@@ -58,6 +62,17 @@ Navigate to the `src` directory of the repository using Visual Studio Code.
5862
provisioned using `azd provision` or `azd up`, a `.env` file is automatically generated in the `.azure/<env-name>/.env`
5963
file. To get your `<env-name>` run `azd env list` to see which env is default.
6064

65+
> **Note**: After adding all environment variables to the .env file, update the value of **'APP_ENV'** from:
66+
```
67+
APP_ENV="Prod"
68+
```
69+
**to:**
70+
```
71+
APP_ENV="Dev"
72+
```
73+
74+
This change is required for running the application in local development mode.
75+
6176
### 3. Start the Application
6277
- Run `start.cmd` (Windows) or `start.sh` (Linux/Mac) to:
6378
- Install backend dependencies.
@@ -124,13 +139,112 @@ cd src/frontend
124139
npm install
125140
npm run build
126141

127-
# Run the backend API
142+
# Run the backend API (Windows)
128143
cd src/
129144

130145
start http://127.0.0.1:50505
131146
call python -m uvicorn app:app --port 50505 --reload
147+
148+
# Run the backend API (MacOs)
149+
cd src/
150+
151+
open http://127.0.0.1:50505
152+
python -m uvicorn app:app --port 50505 --reload
153+
154+
# Run the backend API (Linux)
155+
cd src/
156+
157+
xdg-open http://127.0.0.1:50505
158+
python -m uvicorn app:app --port 50505 --reload
159+
132160
```
133161

134162
> **Note**: Make sure your virtual environment is activated before running these commands. You should see `(.venv)` in your terminal prompt when the virtual environment is active.
135163
136-
The App will run on `http://127.0.0.1:50505/#/` by default.
164+
The App will run on `http://127.0.0.1:50505/#/` by default.
165+
166+
## Troubleshooting
167+
168+
### Common Issues
169+
170+
#### Python Version Issues
171+
172+
```bash
173+
# Check available Python versions
174+
python3 --version
175+
python3.12 --version
176+
177+
# If python3.12 not found, install it:
178+
# Ubuntu: sudo apt install python3.12
179+
# macOS: brew install [email protected]
180+
# Windows: winget install Python.Python.3.12
181+
```
182+
183+
#### Virtual Environment Issues
184+
185+
```bash
186+
# Recreate virtual environment
187+
rm -rf .venv # Linux/macOS
188+
# or Remove-Item -Recurse .venv # Windows PowerShell
189+
190+
uv venv .venv
191+
# Activate and reinstall
192+
source .venv/bin/activate # Linux/macOS
193+
# or .\.venv\Scripts\Activate.ps1 # Windows
194+
uv sync --python 3.12
195+
```
196+
197+
#### Permission Issues (Linux/macOS)
198+
199+
```bash
200+
# Fix ownership of files
201+
sudo chown -R $USER:$USER .
202+
203+
# Fix uv permissions
204+
chmod +x ~/.local/bin/uv
205+
```
206+
207+
#### Windows-Specific Issues
208+
209+
```powershell
210+
# PowerShell execution policy
211+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
212+
213+
# Long path support (Windows 10 1607+, run as Administrator)
214+
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
215+
216+
# SSL certificate issues
217+
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org uv
218+
```
219+
220+
### Azure Authentication Issues
221+
222+
```bash
223+
# Login to Azure CLI
224+
az login
225+
226+
# Set subscription
227+
az account set --subscription "your-subscription-id"
228+
229+
# Test authentication
230+
az account show
231+
```
232+
233+
### Environment Variable Issues
234+
235+
```bash
236+
# Check environment variables are loaded
237+
env | grep AZURE # Linux/macOS
238+
Get-ChildItem Env:AZURE* # Windows PowerShell
239+
240+
# Validate .env file format
241+
cat .env | grep -v '^#' | grep '=' # Should show key=value pairs
242+
```
243+
244+
## Related Documentation
245+
246+
- [Deployment Guide](DeploymentGuide.md) - Instructions for production deployment.
247+
- [Delete Resource Group](DeleteResourceGroup.md) - Steps to safely delete the Azure resource group created for the solution.
248+
- [App Authentication Setup](AppAuthentication.md) - Guide to configure application authentication and add support for additional platforms.
249+
- [Powershell Setup](PowershellSetup.md) - Instructions for setting up PowerShell and required scripts.
250+
- [Quota Check](QuotaCheck.md) - Steps to verify Azure quotas and ensure required limits before deployment.

0 commit comments

Comments
 (0)