# ananteshg/talentmatch-ai architecture

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

- Interactive diagram: https://gitdiagram.com/ananteshg/talentmatch-ai
- Repository: https://github.com/ananteshg/talentmatch-ai

## Overview

##### Project type and purpose
- TalentMatch-AI is a full-stack web application that matches student resumes with company job postings using AI.
- Frontend: Next.js + Tailwind CSS + Firebase for UI, authentication, and storage.
- Backend: Flask Python service exposing REST endpoints, integrating OpenAI for ranking, Cloudinary or Firebase Storage for resume files, and SMTP for email notifications.

##### File structure
- Top level: `backend/` and `frontend/`.
- backend/app.py – Flask app defining `/register`, `/login`, `/upload`, `/resumes`, `/company`, `/search_resumes` endpoints.
- backend/requirements.txt – lists Flask, OpenAI, Firebase Admin, SMTP libs.
- frontend/app/… – Next.js “app” directory with pages: login, register, user-dashboard, company-dashboard, layout, globals.css.
- frontend/components/ProtectedRoute.tsx – guards private pages.
- frontend/firebase/firebase.ts – initializes Firebase Auth, Firestore, Storage.
- next.config.js/ts, tsconfig.json, eslint/postcss configs, package.json – standard Next.js setup.

##### README for additional insights
- Describes features: resume upload, AI matching, email notifications.
- Tech stack: Next.js SSR, Firebase Storage & Auth, Flask REST API, OpenAI API, SMTP.
- Lists environment variables, setup steps, and API endpoints.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Actors
    Student(("Student")):::external
    Recruiter(("Recruiter")):::external

    %% Frontend Layer
    subgraph "Frontend\n(UI Layer)"
        direction TB
        NextApp["Next.js App\n(SSR + CSR)"]:::frontend
        Protected["ProtectedRoute.tsx\n(Auth Guard)"]:::frontend
        FirebaseInit["firebase.ts\n(Auth, Firestore, Storage)"]:::external
        subgraph "Next.js Pages"
            direction TB
            Login["login/page.tsx"]:::frontend
            Register["register/page.tsx"]:::frontend
            StuDash["user-dashboard/page.tsx"]:::frontend
            CompDash["company-dashboard/page.tsx"]:::frontend
        end
        Layout["layout.tsx\n+ globals.css"]:::frontend
        subgraph "Next.js Configuration & Tooling"
            direction TB
            Config1["next.config.js"]:::frontend
            Config2["next.config.ts"]:::frontend
            Config3["tsconfig.json"]:::frontend
            Config4["eslint.config.mjs"]:::frontend
            Config5["postcss.config.mjs"]:::frontend
        end
    end

    %% Backend Layer
    subgraph "Backend\n(API Layer)"
        direction TB
        Flask["Flask API\n(app.py)"]:::backend
        Requirements["requirements.txt"]:::backend
        subgraph "AI & Email"
            direction TB
            OpenAI["OpenAI API"]:::external
            SMTP["SMTP Server"]:::external
        end
    end

    %% External Services
    Firestore["Firestore"]:::external
    Storage["Firebase Storage\n/ Cloudinary"]:::external

    %% Connections
    Student -->|"HTTP/HTTPS"| NextApp
    Recruiter -->|"HTTP/HTTPS"| NextApp
    NextApp -->|"uses"| Protected
    NextApp -->|"initializes"| FirebaseInit
    NextApp -->|"Auth tokens"| FirebaseInit
    NextApp -->|"REST calls"| Flask
    NextApp -->|"fetch data"| Firestore

    Flask -->|"POST /upload\nGET /resumes\nstore files"| Storage
    Flask -->|"metadata read/write"| Firestore
    Flask -->|"POST /search_resumes\nrank resumes"| OpenAI
    Flask -->|"SMTP"| SMTP

    %% Click Events
    click NextApp "https://github.com/ananteshg/talentmatch-ai/tree/main/frontend/app"
    click Login "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/app/login/page.tsx"
    click Register "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/app/register/page.tsx"
    click StuDash "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/app/user-dashboard/page.tsx"
    click CompDash "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/app/company-dashboard/page.tsx"
    click Protected "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/components/ProtectedRoute.tsx"
    click FirebaseInit "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/firebase/firebase.ts"
    click Layout "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/app/layout.tsx"
    click Config1 "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/next.config.js"
    click Config2 "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/next.config.ts"
    click Config3 "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/tsconfig.json"
    click Config4 "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/eslint.config.mjs"
    click Config5 "https://github.com/ananteshg/talentmatch-ai/blob/main/frontend/postcss.config.mjs"
    click Flask "https://github.com/ananteshg/talentmatch-ai/blob/main/backend/app.py"
    click Requirements "https://github.com/ananteshg/talentmatch-ai/blob/main/backend/requirements.txt"

    %% Styles
    classDef frontend fill:#D0EFFF,stroke:#0366D6,stroke-width:2px;
    classDef backend fill:#DFFFE0,stroke:#22863A,stroke-width:2px;
    classDef external fill:#FFE0B2,stroke:#FF7F00,stroke-width:2px;
```
