Skip to content

Commit 2408d1f

Browse files
reorder document
1 parent a53eee4 commit 2408d1f

File tree

1 file changed

+38
-37
lines changed

1 file changed

+38
-37
lines changed

documents/LocalDebuggingSetup.md

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,37 @@ If you don't have an existing environment, you must first deploy the Azure resou
103103
|-------------|-------|------|
104104
| `REACT_APP_API_BASE_URL` | `http://127.0.0.1:8000` | Frontend API base URL for local development |
105105

106-
## Manually Assign Roles
106+
## Running with Automated Script
107+
108+
For convenience, you can use the provided startup scripts that handle environment setup and start both services:
109+
110+
**Windows:**
111+
```cmd
112+
cd src
113+
.\start.cmd
114+
```
115+
116+
**macOS/Linux:**
117+
```bash
118+
cd src
119+
chmod +x start.sh
120+
./start.sh
121+
```
122+
123+
### What the Scripts Do
124+
125+
The startup scripts automate the complete local development setup:
126+
127+
- **Environment & Authentication**: Copies `.env` files from Azure deployment and handles Azure login
128+
- **Role Assignments**: Assigns required Azure permissions (SQL, Cosmos DB, Search, AI services)
129+
- **Dependencies**: Creates virtual environment and installs Python/npm packages
130+
- **Service Launch**: Starts both backend (port 8000) and frontend (port 3000) servers
131+
132+
> **Note**: The script includes a 30-second wait time for the backend to initialize before starting the frontend. However, sometimes it might take more time. If you see connection errors in the frontend initially, please wait a moment for the backend to become fully ready, then reload the frontend once the backend is available.
133+
134+
## Running Backend and Frontend Separately
135+
136+
### Manually Assign Roles
107137

108138
To run the accelerator locally when the solution is secured by RBAC, you need to assign roles to your principal ID. You can get your principal ID from Microsoft Entra ID.
109139

@@ -134,16 +164,16 @@ az cosmosdb sql role assignment create \
134164
--role-definition-id "00000000-0000-0000-0000-000000000002"
135165
```
136166

137-
### Setup Azure SQL Database Access
167+
#### Setup Azure SQL Database Access
138168

139-
#### Option 1: Set Yourself as SQL Server Admin (for single user scenarios)
169+
##### Option 1: Set Yourself as SQL Server Admin (for single user scenarios)
140170

141171
1. Go to your SQL Server resource in Azure Portal
142172
2. Under **"Security"**, click **"Microsoft Entra ID"**
143173
3. Click **"Set admin"** and search for your user account
144174
4. Select your user and click **"Save"**
145175

146-
#### Option 2: Create Database User with Specific Roles (recommended)
176+
##### Option 2: Create Database User with Specific Roles (recommended)
147177

148178
1. First, ensure you have admin access to the SQL Server (Option 1 above)
149179
2. Connect to your Azure SQL Database using SQL Server Management Studio or the Query Editor in Azure Portal
@@ -190,9 +220,9 @@ INNER JOIN sys.database_principals u ON drm.member_principal_id = u.principal_id
190220
WHERE u.name = @username;
191221
```
192222

193-
## Develop & Run the Backend API
223+
### Develop & Run the Backend API
194224

195-
### Step 1: Create Virtual Environment (Recommended)
225+
#### Step 1: Create Virtual Environment (Recommended)
196226

197227
Open your terminal and navigate to the root folder of the project, then create the virtual environment:
198228

@@ -212,7 +242,7 @@ source .venv/bin/activate
212242

213243
> **Note**: After activation, you should see `(.venv)` in your terminal prompt indicating the virtual environment is active.
214244
215-
### Step 2: Install Dependencies and Run
245+
#### Step 2: Install Dependencies and Run
216246

217247
To develop and run the backend API locally:
218248

@@ -234,7 +264,7 @@ The backend API will run on `http://127.0.0.1:8000` by default.
234264

235265
> **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.
236266
237-
## Develop & Run the Frontend Locally
267+
### Develop & Run the Frontend Locally
238268

239269
To run the React frontend in development mode:
240270

@@ -246,35 +276,6 @@ npm start
246276

247277
The frontend will run on `http://localhost:3000` and automatically proxy API requests to the backend.
248278

249-
250-
## Running with Automated Script
251-
252-
For convenience, you can use the provided startup scripts that handle environment setup and start both services:
253-
254-
**Windows:**
255-
```cmd
256-
cd src
257-
.\start.cmd
258-
```
259-
260-
**macOS/Linux:**
261-
```bash
262-
cd src
263-
chmod +x start.sh
264-
./start.sh
265-
```
266-
267-
### What the Scripts Do
268-
269-
The startup scripts automate the complete local development setup:
270-
271-
- **Environment & Authentication**: Copies `.env` files from Azure deployment and handles Azure login
272-
- **Role Assignments**: Assigns required Azure permissions (SQL, Cosmos DB, Search, AI services)
273-
- **Dependencies**: Creates virtual environment and installs Python/npm packages
274-
- **Service Launch**: Starts both backend (port 8000) and frontend (port 3000) servers
275-
276-
> **Note**: The script includes a 30-second wait time for the backend to initialize before starting the frontend. However, sometimes it might take more time. If you see connection errors in the frontend initially, please wait a moment for the backend to become fully ready, then reload the frontend once the backend is available.
277-
278279
## Access the Application
279280

280281
- **Frontend**: http://localhost:3000

0 commit comments

Comments
 (0)