You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documents/LocalDevelopmentSetup.md
+37-47Lines changed: 37 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ This application consists of two separate services that run independently:
20
20
**Terminal Organization:**
21
21
22
22
• **Terminal 1**: Backend API - HTTP server on port 8000
23
-
• **Terminal 2**: Frontend - Development server on port 3000
23
+
• **Terminal 2**: Frontend - Development server on port 5173
24
24
25
25
---
26
26
@@ -746,15 +746,15 @@ Add the following to `src/App/.env`:
746
746
747
747
```bash
748
748
# API Configuration
749
-
REACT_APP_API_BASE_URL=http://127.0.0.1:8000
749
+
VITE_API_BASE_URL=http://127.0.0.1:8000
750
750
751
751
# Optional: Enable debug logging
752
-
REACT_APP_DEBUG=true
752
+
VITE_DEBUG=true
753
753
```
754
754
755
755
> ⚠️ **Important**:
756
-
> - The `REACT_APP_API_BASE_URL` must match the backend API address (default: `http://127.0.0.1:8000`)
757
-
> -React apps require `REACT_APP_` prefix for custom environment variables
756
+
> - The `VITE_API_BASE_URL` must match the backend API address (default: `http://127.0.0.1:8000`)
757
+
> -Vite apps require `VITE_` prefix for custom environment variables
758
758
> - After changing `.env`, restart the frontend development server
759
759
760
760
### 5.3. Install UI Dependencies
@@ -775,11 +775,8 @@ This will install all dependencies listed in `package.json`, including:
775
775
- Axios for API calls
776
776
- Development tools and testing libraries
777
777
778
-
> **Note**: The `package.json` includes a proxy configuration. If you see `"proxy": "http://localhost:5000"` in package.json but your backend runs on port 8000, you may need to update it:
779
-
> ```json
780
-
> "proxy": "http://localhost:8000"
781
-
> ```
782
-
> Or rely on the `REACT_APP_API_BASE_URL` environment variable instead.
778
+
> **Note**: The frontend uses Vite with a dev server proxy configured in `vite.config.ts`. The proxy forwards `/api` and `/history` requests to the backend at `http://localhost:8000`.
779
+
> You can also set the `VITE_API_BASE_URL` environment variable in `.env` to configure the backend URL.
783
780
784
781
#### Troubleshooting npm Installation
785
782
@@ -821,73 +818,66 @@ For production builds:
821
818
npm run build
822
819
```
823
820
824
-
This creates an optimized production build in the `build/` directory. This step is optional for local development.
821
+
This creates an optimized production build in the `dist/` directory. This step is optional for local development.
825
822
826
823
### 5.5. Start Development Server
827
824
828
825
```bash
829
-
# Start the React development server
830
-
npm start
826
+
# Start the Vite development server
827
+
npm run dev
831
828
```
832
829
833
830
The app will start at:
834
831
835
832
```
836
-
http://localhost:3000
833
+
http://localhost:5173
837
834
```
838
835
839
-
The browser should automatically open. If not, manually navigate to `http://localhost:3000`
836
+
The browser should automatically open. If not, manually navigate to `http://localhost:5173`
840
837
841
838
#### Expected Output
842
839
843
840
When successfully running, you should see output similar to:
844
841
845
842
```
846
-
Compiled successfully!
843
+
VITE v6.x.x ready in xxx ms
847
844
848
-
You can now view the app in the browser.
849
-
850
-
Local: http://localhost:3000
851
-
On Your Network: http://192.168.1.x:3000
852
-
853
-
Note that the development build is not optimized.
854
-
To create a production build, use npm run build.
855
-
856
-
webpack compiled successfully
845
+
➜ Local: http://localhost:5173/
846
+
➜ Network: http://192.168.1.x:5173/
847
+
➜ press h + enter to show help
857
848
```
858
849
859
-
#### React Development Features
850
+
#### Vite Development Features
860
851
861
852
The development server provides:
862
853
-**Hot Module Replacement (HMR)**: Automatically refreshes when you save changes
863
854
-**Error Overlay**: Shows compilation errors and runtime errors in the browser
864
-
-**API Proxy**: Uses `REACT_APP_API_BASE_URL` from `.env` to connect to backend at `http://127.0.0.1:8000`
855
+
-**API Proxy**: Configured in `vite.config.ts` to proxy `/api` and `/history` requests to the backend at `http://localhost:8000`
865
856
-**Azure AD Authentication**: Integrated with @azure/msal-react for user authentication
866
857
867
858
#### Common Frontend Issues
868
859
869
-
**Port 3000 Already in Use:**
860
+
**Port 5173 Already in Use:**
870
861
```bash
871
862
# Option 1: Use a different port
872
-
PORT=3001 npm start # Linux/macOS
873
-
$env:PORT=3001; npm start # Windows PowerShell
863
+
npx vite --port 3000 # Linux/macOS/Windows
874
864
875
-
# Option 2: Kill process on port 3000
865
+
# Option 2: Kill process on port 5173
876
866
# Windows:
877
-
netstat -ano | findstr :3000
867
+
netstat -ano | findstr :5173
878
868
taskkill /PID <process-id> /F
879
869
880
870
# Linux/macOS:
881
-
lsof -i :3000
871
+
lsof -i :5173
882
872
kill -9 <process-id>
883
873
```
884
874
885
875
**Cannot Connect to Backend API:**
886
876
```bash
887
877
# 1. Verify backend is running on http://127.0.0.1:8000
888
-
# 2. Check REACT_APP_API_BASE_URL in src/App/.env
878
+
# 2. Check VITE_API_BASE_URL in src/App/.env
889
879
# 3. Check browser console for CORS errors
890
-
# 4. Restart frontend after changing .env: Ctrl+C then npm start
880
+
# 4. Restart frontend after changing .env: Ctrl+C then npm run dev
891
881
```
892
882
893
883
**Module Not Found or TypeScript Errors:**
@@ -908,7 +898,7 @@ Before using the application, confirm both services are running in separate term
0 commit comments