graph LR
linkStyle default fill:#ffffff
subgraph diagram ["Components — API Backend"]
style diagram fill:#ffffff,stroke:#ffffff
10("
Stihia Guardrails
[Software System]
Real-time AI threat
detection. Analyses user
messages for prompt
injection, toxic content,
sensitive data exposure, and
other threats before they
reach the LLM.
")
click 10 https://api.stihia.ai "https://api.stihia.ai"
style 10 fill:#6b6b6b,stroke:#4a4a4a,color:#ffffff
11("
NVIDIA NIM
[Software System]
Hosted LLM inference API
serving
nvidia/nemotron-mini-4b-instruct.
Responses are returned as a
Server-Sent Events stream.
")
click 11 https://integrate.api.nvidia.com "https://integrate.api.nvidia.com"
style 11 fill:#6b6b6b,stroke:#4a4a4a,color:#ffffff
subgraph 2 ["AI Interview Guide"]
style 2 fill:#ffffff,stroke:#0b4884,color:#0b4884
subgraph 4 ["API Backend"]
style 4 fill:#ffffff,stroke:#2e6295,color:#2e6295
5("
SessionFunction
[Component: Azure Function — POST /api/session]
Accepts the NVIDIA NIM API
key from the browser, stores
it in the memory cache keyed
by a generated sessionId
(30-min sliding expiry), and
returns the sessionId.
")
style 5 fill:#85bbf0,stroke:#5d82a8,color:#000000
6("
ChatFunction
[Component: Azure Function — POST /api/chat]
Resolves the caller's NVIDIA
API key from cache, invokes
the guardrail check, builds
the system prompt
server-side, calls NVIDIA
NIM, and forwards the SSE
stream to the browser.
")
style 6 fill:#85bbf0,stroke:#5d82a8,color:#000000
7("
StihiaService
[Component: C# Singleton — HttpClient]
Calls Stihia /v1/sense with
the latest user message.
Returns allowed/blocked with
severity. Fails open on
outage. Skipped when
DISABLE_GUARDRAILS=true.
")
style 7 fill:#85bbf0,stroke:#5d82a8,color:#000000
8("
TopicData
[Component: C# Static Class]
Static registry of all 8
interview topics and their
concepts, sample questions,
and server-side system prompt
builder. Clients send only a
numeric topicId.
")
style 8 fill:#85bbf0,stroke:#5d82a8,color:#000000
9[("
Session Cache
[Component: IMemoryCache (.NET)]
In-process memory cache
mapping sessionId → NVIDIA
NIM API key with a 30-minute
sliding expiration. API key
never leaves the backend
after the initial session
call.
")]
style 9 fill:#85bbf0,stroke:#5d82a8,color:#000000
end
3["
Frontend SPA
[Container: React 18 + Vite / Azure Static Web Apps]
Single-page application
serving topic study material
and the AI chat practice
interface. Manages session
state and streams AI
responses token by token.
"]
style 3 fill:#438dd5,stroke:#2e6295,color:#ffffff
end
3-. "
POST /api/session — submits
NVIDIA API key once [HTTPS]
" .->5
3-. "
POST /api/chat — sends
sessionId + topicId +
messages [HTTPS + SSE]
" .->6
5-. "
Stores apiKey → sessionId
mapping
" .->9
6-. "
Resolves NVIDIA API key by
sessionId
" .->9
6-. "
Checks last user message
before calling NIM
" .->7
6-. "
Builds system prompt for
topicId
" .->8
6-. "
POST /v1/chat/completions
[HTTPS + SSE]
" .->11
7-. "
POST /v1/sense [HTTPS]
" .->10
end