# arjun-v1-ai/ai-career-hub architecture

> Architecture diagram of the GitHub repository arjun-v1-ai/ai-career-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arjun-v1-ai/ai-career-hub
- Repository: https://github.com/arjun-v1-ai/ai-career-hub

## Overview

##### Project Type and Purpose
- This is a full-stack application that serves as a comprehensive career guidance platform using AI-powered features like video proctoring, resume analysis, and career counseling.
- The frontend is built with Next.js (using the App Router) and Tailwind CSS, and it handles user-facing pages and API routes under the “app” directory.
- The backend is implemented in Python using FastAPI (located in the “server” directory) with additional AI components (for example, MediaPipe for video analysis).

##### File Structure
- Frontend (Next.js):
- The “app” directory contains pages and API routes (e.g., authentication routes, career guidance, resume analysis, forum functionalities) with subfolders for different features.
- There are also “components” (for UI elements and widgets), “assets”, and public images, ensuring a clear separation of presentation and business logic.
- Backend (Python FastAPI):
- The “server” directory has the FastAPI application (server/main.py) along with its requirements.
- The README explains that the API endpoints in the backend include health checks and video analysis.
- Shared Resources and Utilities:
- “db” and “lib” directories hold database connection logic (likely for MongoDB, based on “lib/mongodb.js” and “db/dbConnection.js”) and “models” (User model).
- “services” and “utils” contain business logic and helper functions that are used across the project.

##### Determining Key Components
- Frontend Application (Next.js):
- UI/UX pages (e.g., home, profile, forum, career guidance sections)
- API Routes under “app/api” (handling authentication, user creation, resume analysis, cover letter generation, career guidance, etc.)
- Third-party integrations (NextAuth.js for authentication, Gemini API for AI tasks, and possibly Google APIs).
- Backend API Service (Python FastAPI):
- Main FastAPI server (server/main.py) responsible for video proctoring, video analysis, and possibly other analytical tasks (e.g., analyze, health endpoints).
- Integration with MediaPipe for video/image analysis.
- Database:
- MongoDB (with connection logic in “lib/mongodb.js” and “db/dbConnection.js” and schemas in “models”).
- External Services & Integrations:
- Authentication service (using NextAuth.js)
- External API calls to services like Gemini for resume analysis (usages evident in “utils/geminiAPI.js”)
- Job scraping service (via an API endpoint in “app/api/scrape-jobs”)

##### Architectural Patterns and Design Principles
- Separation of Concerns:
- The frontend and backend are clearly separated, with Next.js directly managing routes and pages while FastAPI handles dedicated analytical endpoints.
- API-First Approach:
- The project uses well-defined API endpoints (both within Next.js “app/api” and FastAPI backend) to handle most business logic.
- Modular Design:
- Components, services, and utilities are split into separate directories, which is ideal for maintainability and scalability.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        FE1["Next.js Application (Pages)"]:::frontend
        FE2["UI Components (Navbar, Footer, etc.)"]:::frontend
        FE3["API Routes"]:::frontend
    end

    subgraph "Backend Layer"
        BE1["FastAPI Server (server/main.py)"]:::backend
        BE2["Video Analysis (MediaPipe Integration)"]:::backend
        BE3["Health Endpoints"]:::backend
    end

    subgraph "Persistence"
        DB["MongoDB Database"]:::database
    end

    subgraph "External Services"
        EX1["Gemini API (Resume Analysis)"]:::external
        AUTH["Auth Service (app/api/auth & services/authService.js)"]:::external
        EX2["Job Scraping Service"]:::external
    end

    FE1 -->|"uses"| FE3
    FE3 -->|"RESTAPICall"| BE1
    BE1 -->|"DataFetchStore"| DB
    BE1 -->|"VideoAnalysis"| BE2
    BE1 -->|"HealthCheck"| BE3
    BE1 -->|"ResumeAnalysis"| EX1
    FE3 -->|"Authentication"| AUTH
    FE3 -->|"JobScrape"| EX2

    click FE1 "https://github.com/arjun-v1-ai/ai-career-hub/tree/main/app"
    click FE2 "https://github.com/arjun-v1-ai/ai-career-hub/tree/main/components"
    click FE3 "https://github.com/arjun-v1-ai/ai-career-hub/tree/main/app/api"
    click BE1 "https://github.com/arjun-v1-ai/ai-career-hub/blob/main/server/main.py"
    click DB "https://github.com/arjun-v1-ai/ai-career-hub/blob/main/db/dbConnection.js"
    click DB "https://github.com/arjun-v1-ai/ai-career-hub/blob/main/lib/mongodb.js"
    click EX1 "https://github.com/arjun-v1-ai/ai-career-hub/blob/main/utils/geminiAPI.js"
    click AUTH "https://github.com/arjun-v1-ai/ai-career-hub/tree/main/app/api/auth"
    click AUTH "https://github.com/arjun-v1-ai/ai-career-hub/blob/main/services/authService.js"

    classDef frontend fill:#B3E5FC,stroke:#0277BD,stroke-width:2px;
    classDef backend fill:#FFCCBC,stroke:#D84315,stroke-width:2px;
    classDef database fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px;
    classDef external fill:#E1BEE7,stroke:#6A1B9A,stroke-width:2px;
```
