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: docs/frontend.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,32 @@
1
1
# Front-End (Blazor WebAssembly)
2
2
3
+
## Overview
4
+
The front-end is a Blazor WebAssembly application using Microsoft Fluent UI components, deployed on Azure Static Web Apps with integrated Azure AD authentication.
5
+
3
6
## Key Behaviors
7
+
- User must authenticate via Azure AD before accessing the application.
4
8
- User enters Project ID; triggers report fetch.
5
9
- Displays metrics in Fluent UI components (cards, tabs, data grids, accordion).
6
10
- AI summary rendered as markdown using Markdig.
7
11
- PDF download posts existing report JSON to API; no recomputation.
8
12
13
+
## Authentication
14
+
-**Azure Static Web Apps** handles authentication via Azure AD (Entra ID)
15
+
- Configured in `staticwebapp.config.json`:
16
+
-`/api/*` routes require `authenticated` role
17
+
- Unauthenticated users redirected to `/.auth/login/aad`
18
+
- SWA session cookies automatically included in API requests
19
+
- No additional token management needed in Blazor code
20
+
9
21
## State Management
10
22
- Local component state only (no global store yet).
11
23
-`IsLoading` for initial report, `IsPdfLoading` for PDF call.
12
24
13
25
## HTTP
14
-
-`HttpClient` base address from host environment; assumes reverse proxy or relative `/api` route.
26
+
-`HttpClient` base address from host environment.
27
+
- Assumes SWA reverse proxy routing for `/api` routes.
28
+
- SWA authentication cookies automatically included in requests.
29
+
- No manual authorization headers needed.
15
30
16
31
## File Download
17
32
-`saveFile` JS helper converts Base64 to Blob and triggers `<a download>`.
0 commit comments