# kishan-solanki/intervue-ai architecture

> Architecture diagram of the GitHub repository kishan-solanki/intervue-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kishan-solanki/intervue-ai
- Repository: https://github.com/kishan-solanki/intervue-ai

## Overview

##### Project type and purpose
- This is a full-stack web application built with Next.js (“src/app”, “next.config.mjs”)
- It provides an AI-driven interview platform (“Intervue AI”), integrating a Python-based nervousness detection model (“nervesness_model/…”) and external AI services (e.g., Google Gemini SDK)
- It supports user authentication, interview creation, interview results, and user data persistence

##### File structure
- Frontend (React/Next.js):
– src/app/(auth) and src/app/(root) contain UI routes and pages (login, register, dashboard, interview pages)
– src/app/component and src/components hold reusable UI components (Navbar, Button, Hero, custom animations)
– globals.css, layout.js, page.js configure global styles and page shells
- Backend (Next.js API routes):
– src/app/api/auth, src/app/api/interview, src/app/api/user define server-side endpoints (Route.js files)
– src/lib holds utilities: dbconfig.js (database connection), jwt.js (token handling), googleGemini.js (external LLM), vapi.sdk.js, utils.js
– src/helpers/mailer.js for email notifications
– src/model contains Mongoose/ORM models (userModel.js, interviewModel.js)
- Machine Learning microservice:
– nervesness_model folder with Python code and pickle model
– run.py likely exposes a REST or gRPC interface for stress-level inference
- Configuration & tooling:
– package.json, eslint.config.mjs, postcss.config.mjs, next.config.mjs, jsconfig.json
– middleware.js for cross-cutting concerns (authentication guard, logging)

##### README
- Minimal description: “This is Intervue AI”

##### Final advice
- Major pieces without over-partitioning – group related API routes together
- Async or long-running flows (e.g., model inference)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Next.js Frontend UI Layer"
        direction TB
        AuthPages["Authentication Pages"]:::frontend
        RootPages["Core Pages"]:::frontend
        UIComponents["Reusable UI Components"]:::frontend
        LayoutStyles["Layout & Global Styles"]:::frontend
    end

    %% Backend/API Layer
    subgraph "Next.js API Server Layer"
        direction TB
        AuthAPI["Auth API Routes"]:::backend
        InterviewAPI["Interview API Routes"]:::backend
        UserAPI["User API Routes"]:::backend
        Utilities["Utilities & Middleware"]:::backend
        Models["Mongoose/ORM Models"]:::backend
    end

    %% Database
    Database["Database"]:::db

    %% ML Microservice
    subgraph "Python ML Service"
        direction TB
        MLService["Nervousness Detection Service"]:::ml
        ModelCode["Model Code & Weights"]:::ml
    end

    %% External Services
    subgraph "External Services"
        direction TB
        GoogleGemini["Google Gemini SDK"]:::external
        VAPISDK["VAPI SDK"]:::external
        EmailSMTP["Email SMTP Service"]:::external
    end

    %% Data Flows
    Browser["User Browser"]:::external
    Browser -->|"HTTP/HTTPS"| AuthPages
    Browser -->|"HTTP/HTTPS"| RootPages
    AuthPages -->|"API Calls"| AuthAPI
    RootPages -->|"API Calls"| InterviewAPI
    RootPages -->|"API Calls"| UserAPI
    UIComponents --> RootPages
    LayoutStyles --> AuthPages

    AuthAPI -->|"Reads/Writes"| Database
    InterviewAPI -->|"Reads/Writes"| Database
    UserAPI -->|"Reads/Writes"| Database

    InterviewAPI -->|"Send audio/text"| MLService
    MLService -->|"Inference results"| InterviewAPI

    InterviewAPI -->|"LLM requests"| GoogleGemini
    InterviewAPI -->|"LLM requests"| VAPISDK

    AuthAPI -->|"Send emails"| EmailSMTP

    AuthAPI --> Utilities
    InterviewAPI --> Utilities
    UserAPI --> Utilities

    AuthAPI --> Models
    InterviewAPI --> Models
    UserAPI --> Models

    %% Click Events
    click AuthPages "https://github.com/kishan-solanki/intervue-ai/tree/main/src/app/(auth)"
    click RootPages "https://github.com/kishan-solanki/intervue-ai/tree/main/src/app/(root)"
    click UIComponents "https://github.com/kishan-solanki/intervue-ai/tree/main/src/app/component"
    click UIComponents "https://github.com/kishan-solanki/intervue-ai/tree/main/src/components"
    click LayoutStyles "https://github.com/kishan-solanki/intervue-ai/blob/main/src/app/layout.js"
    click LayoutStyles "https://github.com/kishan-solanki/intervue-ai/blob/main/src/app/globals.css"
    click LayoutStyles "https://github.com/kishan-solanki/intervue-ai/blob/main/src/app/page.js"

    click AuthAPI "https://github.com/kishan-solanki/intervue-ai/tree/main/src/app/api/auth"
    click InterviewAPI "https://github.com/kishan-solanki/intervue-ai/tree/main/src/app/api/interview"
    click UserAPI "https://github.com/kishan-solanki/intervue-ai/tree/main/src/app/api/user"

    click Utilities "https://github.com/kishan-solanki/intervue-ai/blob/main/src/lib/dbconfig.js"
    click Utilities "https://github.com/kishan-solanki/intervue-ai/blob/main/src/lib/jwt.js"
    click Utilities "https://github.com/kishan-solanki/intervue-ai/blob/main/src/lib/googleGemini.js"
    click Utilities "https://github.com/kishan-solanki/intervue-ai/blob/main/src/lib/vapi.sdk.js"
    click Utilities "https://github.com/kishan-solanki/intervue-ai/blob/main/src/lib/utils.js"
    click Utilities "https://github.com/kishan-solanki/intervue-ai/blob/main/middleware.js"

    click Models "https://github.com/kishan-solanki/intervue-ai/blob/main/src/model/userModel.js"
    click Models "https://github.com/kishan-solanki/intervue-ai/blob/main/src/model/interviewModel.js"

    click MLService "https://github.com/kishan-solanki/intervue-ai/blob/main/nervesness_model/run.py"
    click ModelCode "https://github.com/kishan-solanki/intervue-ai/blob/main/nervesness_model/nervousness_model.py"
    click ModelCode "https://github.com/kishan-solanki/intervue-ai/blob/main/nervesness_model/nervousness_model.pkl"

    click EmailSMTP "https://github.com/kishan-solanki/intervue-ai/blob/main/src/helpers/mailer.js"

    %% Styles
    classDef frontend fill:#DDEEFF,stroke:#3399FF,color:#003366
    classDef backend fill:#FFEEDD,stroke:#FF9933,color:#663300
    classDef db fill:#EEFFDD,stroke:#33CC33,color:#336600
    classDef ml fill:#F0DDFF,stroke:#9933CC,color:#660066
    classDef external fill:#EEEEEE,stroke:#888888,color:#444444
```
