# vadiml1024/jobhunterai architecture

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

- Interactive diagram: https://gitdiagram.com/vadiml1024/jobhunterai
- Repository: https://github.com/vadiml1024/jobhunterai

## Overview

##### Main system components
- Frontend (Client Layer): Represented by the “client” directory, it contains the React code (pages, components, hooks, layouts, and UI elements). Note the distinct UI sections such as Dashboard, Jobs, Applications, Resume Management, and Profile.
- API/Backend Layer: Resides in the “server” directory and includes modules for authentication, calendar integration, job boards, LinkedIn integration, file uploads, and configuration. This layer also encapsulates the LLM service integration (with files like llm-service.ts, openai.ts, gemini.ts).
- AI Service Layer: Abstracts over different AI providers (OpenAI and Gemini) to power features like resume analysis, cover letter generation, and chat support. This should be highlighted as a sub-component of the backend or as an external service.
- Data Layer: Use a PostgreSQL database to store user profiles, resumes, job data, and application statuses, with Drizzle ORM (configuration in drizzle.config.ts and shared schema files) as the interface.
- External Integrations: Include integration points such as LinkedIn (for profile import), calendar services (e.g., Google Calendar), and possibly external job board APIs.

##### Interactions
- AI Service Layer as a module that the API calls into for features like resume analysis or job recommendation.
- External integrations (LinkedIn API, calendar services, job boards) connecting with the API layer.

##### Architectural patterns and technologies
- Separation of concerns: UI (React with TypeScript, TanStack Query, Shadcn/UI, Tailwind CSS) is separated from business logic (Express backend) and data persistence (PostgreSQL with Drizzle ORM).
- That the file tree indicates a modular, component-based structure for the client and a route-centric design for the server, reflecting clean architectural practices.
- Out the use of configuration files (e.g., vite.config.ts, postcss.config.js, tailwind.config.ts) which solidify the toolchain setup.
- Shared code (in “shared/schema.ts”) to show how the system maintains consistency between the client and server.

##### Detailed system design elements
- Frontend Components: Represent the main UI modules such as Dashboard, Applications, Jobs, Resume Management, Profile, and AI Chat Assistant. You might abstract these as a collective “Client Layer” with internal subdivisions.
- Backend Modules: Represent key files such as auth.ts, calendar.ts, jobboards.ts, and routes.ts under the API layer. Indicate that these modules interact with each other as well as with external services.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Frontend Layer
    subgraph "Frontend Layer"
        FE_Main["React SPA - JobAI Client"]:::frontend
        FE_Dashboard["Dashboard & UI Modules"]:::frontend
        FE_Jobs["Jobs Management"]:::frontend
        FE_Applications["Applications"]:::frontend
        FE_Resumes["Resume Management"]:::frontend
        FE_Profile["Profile"]:::frontend
        FE_Integrations["Integrations"]:::frontend
        FE_Chat["AI Chat Assistant"]:::frontend
    end

    %% API/Backend Layer
    subgraph "API/Backend Layer"
        BE_API["Express API Server"]:::backend
        BE_Auth["Authentication Module"]:::backend
        BE_Calendar["Calendar Integration"]:::backend
        BE_JobBoards["Job Boards Connector"]:::backend
        BE_LinkedIn["LinkedIn Integration"]:::backend
        BE_FileUpload["File Upload"]:::backend
        BE_Storage["Storage"]:::backend
        BE_Routes["API Routing & Config"]:::backend
    end

    %% AI Service Layer
    subgraph "AI Service Layer"
        AI_LLM["LLM Service Layer (OpenAI, Gemini)"]:::ai
    end

    %% Data Layer
    subgraph "Database (PostgreSQL with Drizzle ORM)"
        DB_Config["Drizzle Config"]:::database
        DB_Schema["Shared Schema"]:::database
    end

    %% External Systems
    subgraph "External Systems"
        EXT_LinkedIn["LinkedIn API"]:::external
        EXT_Calendar["Calendar Services"]:::external
        EXT_JobBoards["Job Board APIs"]:::external
    end

    %% Connections between layers
    FE_Main -->|"HTTPRequests"| BE_API

    %% Frontend internal components (optional grouping arrows)
    FE_Main --- FE_Dashboard
    FE_Main --- FE_Jobs
    FE_Main --- FE_Applications
    FE_Main --- FE_Resumes
    FE_Main --- FE_Profile
    FE_Main --- FE_Integrations
    FE_Main --- FE_Chat

    %% Backend internal module calls
    BE_API -->|"calls"| BE_Auth
    BE_API -->|"calls"| BE_Calendar
    BE_API -->|"calls"| BE_JobBoards
    BE_API -->|"calls"| BE_LinkedIn
    BE_API -->|"calls"| BE_FileUpload
    BE_API -->|"calls"| BE_Storage
    BE_API -->|"calls"| BE_Routes

    %% API interactions with AI Services, Database and External Systems
    BE_API -->|"AIRequests"| AI_LLM
    BE_API -->|"CRUD"| DB_Config
    BE_API -->|"Integration"| EXT_LinkedIn
    BE_API -->|"Integration"| EXT_Calendar
    BE_API -->|"Integration"| EXT_JobBoards

    %% Click Events for Frontend
    click FE_Main "https://github.com/vadiml1024/jobhunterai/tree/main/client/"
    click FE_Dashboard "https://github.com/vadiml1024/jobhunterai/tree/main/client/src/components/dashboard/"
    click FE_Jobs "https://github.com/vadiml1024/jobhunterai/tree/main/client/src/components/jobs/"
    click FE_Applications "https://github.com/vadiml1024/jobhunterai/tree/main/client/src/components/applications/"
    click FE_Resumes "https://github.com/vadiml1024/jobhunterai/tree/main/client/src/components/resumes/"
    click FE_Profile "https://github.com/vadiml1024/jobhunterai/tree/main/client/src/components/profile/"
    click FE_Integrations "https://github.com/vadiml1024/jobhunterai/tree/main/client/src/components/integrations/"
    click FE_Chat "https://github.com/vadiml1024/jobhunterai/tree/main/client/src/components/layout/"

    %% Click Events for API/Backend Layer
    click BE_API "https://github.com/vadiml1024/jobhunterai/tree/main/server/"
    click BE_Auth "https://github.com/vadiml1024/jobhunterai/blob/main/server/auth.ts"
    click BE_Calendar "https://github.com/vadiml1024/jobhunterai/blob/main/server/calendar.ts"
    click BE_JobBoards "https://github.com/vadiml1024/jobhunterai/blob/main/server/jobboards.ts"
    click BE_LinkedIn "https://github.com/vadiml1024/jobhunterai/blob/main/server/linkedin.ts"
    click BE_FileUpload "https://github.com/vadiml1024/jobhunterai/blob/main/server/upload.ts"
    click BE_Storage "https://github.com/vadiml1024/jobhunterai/blob/main/server/storage.ts"
    click BE_Routes "https://github.com/vadiml1024/jobhunterai/blob/main/server/index.ts"

    %% Click Events for AI Service Layer
    click AI_LLM "https://github.com/vadiml1024/jobhunterai/blob/main/server/llm-service.ts"

    %% Click Events for Data Layer
    click DB_Config "https://github.com/vadiml1024/jobhunterai/blob/main/drizzle.config.ts"
    click DB_Schema "https://github.com/vadiml1024/jobhunterai/blob/main/shared/schema.ts"

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef backend fill:#A9DFBF,stroke:#145A32,stroke-width:2px;
    classDef ai fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef database fill:#FADBD8,stroke:#CB4335,stroke-width:2px;
    classDef external fill:#D6EAF8,stroke:#2874A6,stroke-width:2px;
```
