# amiturfriend007/interviewai architecture

> Architecture diagram of the GitHub repository amiturfriend007/interviewai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amiturfriend007/interviewai
- Repository: https://github.com/amiturfriend007/interviewai

## Overview

##### Project Type & Purpose
- This is a full-stack AI interview platform ("Interview AI") consisting of a React frontend and a Django backend.
- Frontend hosts three main UI modules (Dashboard, Interview Engine, Question Bank).
- Backend provides an admin console, user management, and an NLP API (/api/interact) that leverages a BERT model.
- Nginx serves both the frontend static assets and reverse-proxies to Django.
- The entire solution is deployed to Azure Cloud.

##### Key Components
a. Client Browser & React Frontend
- Components: Dashboard.tsx, InterviewEngine.tsx, QuestionBank.tsx
- Static assets served by Nginx (HTML/CSS/JS)
b. Nginx Reverse Proxy
- Serves React build (static files)
- Proxies API calls (e.g. /api/interact) to Django backend
c. Django Backend
- Admin interface (built-in Django Admin)
- User module (authentication, authorization)
- API module “api/interact” invoking the BERT NLP model
d. BERT NLP Service
- Either embedded within Django or as a separate microservice/container
e. Database
- Stores user profiles, question bank data, interview sessions, logs
- e.g., PostgreSQL or Azure SQL Database
f. Azure Cloud Infrastructure
- Azure App Service or Virtual Machines (hosting Nginx + Django)
- Optional: Azure Kubernetes Service (if containerized)
- Azure Blob Storage (for any large assets or model artifacts)
- Azure Load Balancer or Azure Front Door (for traffic distribution)

##### Relationships & Data Flows
- User → Browser (React UI)
- Browser → Nginx (static file GET)
- Browser → Nginx → Django API (POST /api/interact, GET /api/users, etc.)
- Django → Database (ORM queries for users, questions)
- Django → BERT Model (invoke NLP pipeline)
- Responses flow back up the chain: BERT → Django → Nginx → Browser → User

##### Architectural Patterns & Principles
- Separation of Concerns: clearly decoupled UI, application logic, and data layers
- MVC (Django’s default pattern for admin & user modules)
- API-driven Communication: frontend ↔ backend via REST or GraphQL
- Reverse Proxy Pattern: Nginx front ends both static hosting and API routing
- Scalability via Azure services (scale out frontend/backend independently)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Side
    User["User"]:::user
    Browser["Browser"]:::client

    subgraph "React UI Layer"
        direction TB
        Dashboard["Dashboard Component"]:::frontend
        InterviewEngine["Interview Engine Component"]:::frontend
        QuestionBank["Question Bank Component"]:::frontend
    end

    %% Azure Cloud Infrastructure
    subgraph "Azure Cloud"
        direction TB
        LB["Azure Front Door / Load Balancer"]:::infra
        Nginx["Nginx Reverse Proxy"]:::infra

        subgraph "App Service / Kubernetes"
            direction TB
            Django["Django Backend"]:::backend
            Admin["Django Admin Interface"]:::backend
            API["/api/interact (NLP API)"]:::backend
            BERT["BERT NLP Service"]:::backend
        end

        DB["Azure SQL / PostgreSQL"]:::data
        Blob["Azure Blob Storage"]:::infra
    end

    %% Client flows
    User --> Browser
    Browser --> Dashboard
    Browser --> InterviewEngine
    Browser --> QuestionBank

    Browser -->|"HTTP GET static"| Nginx
    Nginx -->|"SERVE React build"| Browser

    Browser -->|"POST /api/interact"| Nginx
    Browser -->|"GET /api/users"| Nginx

    LB --> Nginx

    %% API proxying
    Nginx -->|"Proxy POST /api/interact"| API
    Nginx -->|"Proxy other API calls"| Django

    %% Backend internals
    API -->|"Invoke NLP pipeline"| BERT
    Django -->|"ORM queries"| DB
    Django -->|"Admin actions"| Admin

    %% Response flows
    API -->|"JSON response"| Nginx
    Admin -->|"UI pages"| Nginx
    Nginx --> Browser

    %% Storage access
    BERT -->|"Load model artifacts"| Blob

    %% Click Events
    click Dashboard "https://github.com/amiturfriend007/interviewai/blob/main/components/Dashboard.tsx"
    click InterviewEngine "https://github.com/amiturfriend007/interviewai/blob/main/components/InterviewEngine.tsx"
    click QuestionBank "https://github.com/amiturfriend007/interviewai/blob/main/components/QuestionBank.tsx"

    %% Styles
    classDef user fill:#FFF2CC,stroke:#333,stroke-width:1px
    classDef client fill:#E8F4FF,stroke:#333,stroke-width:1px
    classDef frontend fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef backend fill:#DFF2BF,stroke:#333,stroke-width:1px
    classDef data fill:#FFD1D1,stroke:#333,stroke-width:1px
    classDef infra fill:#EDEDED,stroke:#333,stroke-width:1px
```
