# a1tharv/rsumai architecture

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

- Interactive diagram: https://gitdiagram.com/a1tharv/rsumai
- Repository: https://github.com/a1tharv/rsumai

## Overview

##### Main Components
- User Interface:
- The core of the application lies in components (e.g., App.tsx, AnalysisDashboard.tsx) under the “src” and “src/components” directories.
- Service Layer:
- The “src/services” directory (with gemini.ts) implements the logic to connect with the external Gemini AI API.
- This layer encapsulates API interaction like resume analysis, fetching scores, and retrieving improvement suggestions.
- Configuration and Build Tools:
- Several configuration files (vite.config.ts, tsconfig.json, tailwind.config.js, postcss.config.js, etc.) indicate the use of Vite, TypeScript, and Tailwind CSS.
- External Dependencies:
- Google Generative AI (Gemini API) as the external resume analysis engine.

##### Relationships and Interactions
- The user uploads a resume (TXT format) via the UI.
- The UI components interact with the service layer (gemini.ts) to call the Gemini AI API.
- Data received from the external API is processed and rendered through various UI components (charts, dashboards).
- The configuration files ensure the build, routing, and styling are managed appropriately.

##### Architectural Patterns and Design Principles
- Component-Based UI Architecture: React’s components structure (App, AnalysisDashboard, others) is central to the design.
- Service Abstraction: A dedicated “services” layer encapsulates external API interactions, promoting separation of concerns.
- Separation of Concerns: Clear division between UI (components), data processing (services), and configuration.
- Use of Environment Variables: The project uses an .env file for storing sensitive data (e.g., Gemini API key).

##### Relevant Technologies, Frameworks, and Libraries
- Frontend: React, TypeScript, Vite.
- Styling: Tailwind CSS.
- Data Visualization: Recharts.
- External API: Google Generative AI (Gemini).

## Diagram (Mermaid)

```mermaid
flowchart TD
    U["User Uploads Resume"]:::external

    subgraph "User Interface"
        UI1["App.tsx"]:::ui
        UI2["AnalysisDashboard.tsx"]:::ui
        UI3["main.tsx"]:::ui
        UI4["index.css"]:::ui
    end

    subgraph "Service Layer"
        S1["gemini.ts"]:::service
    end

    subgraph "External Services"
        E1["Google Generative AI (Gemini)"]:::external
    end

    subgraph "Configuration & Build Tools"
        C1["vite.config.ts"]:::config
        C2["tsconfig.app.json"]:::config
        C3["tsconfig.json"]:::config
        C4["tsconfig.node.json"]:::config
        C5["tailwind.config.js"]:::config
        C6["postcss.config.js"]:::config
        C7["eslint.config.js"]:::config
    end

    subgraph "Type Definitions"
        T1["index.ts"]:::types
        T2["vite-env.d.ts"]:::types
    end

    U -->|"uploads"| UI2
    UI2 -->|"callsGeminiAPI"| S1
    S1 -->|"calls"| E1
    E1 -->|"returnsData"| S1
    S1 -->|"updatesDashboard"| UI2

    C1 -.->|"builds"| UI1
    C1 -.->|"builds"| S1
    T1 -.->|"supports"| UI1
    T1 -.->|"supports"| S1
    T2 -.->|"supports"| UI1

    click UI1 "https://github.com/a1tharv/rsumai/blob/main/src/App.tsx"
    click UI2 "https://github.com/a1tharv/rsumai/blob/main/src/components/AnalysisDashboard.tsx"
    click UI3 "https://github.com/a1tharv/rsumai/blob/main/src/main.tsx"
    click UI4 "https://github.com/a1tharv/rsumai/blob/main/src/index.css"
    click S1 "https://github.com/a1tharv/rsumai/blob/main/src/services/gemini.ts"
    click C1 "https://github.com/a1tharv/rsumai/blob/main/vite.config.ts"
    click C2 "https://github.com/a1tharv/rsumai/blob/main/tsconfig.app.json"
    click C3 "https://github.com/a1tharv/rsumai/blob/main/tsconfig.json"
    click C4 "https://github.com/a1tharv/rsumai/blob/main/tsconfig.node.json"
    click C5 "https://github.com/a1tharv/rsumai/blob/main/tailwind.config.js"
    click C6 "https://github.com/a1tharv/rsumai/blob/main/postcss.config.js"
    click C7 "https://github.com/a1tharv/rsumai/blob/main/eslint.config.js"
    click T1 "https://github.com/a1tharv/rsumai/blob/main/src/types/index.ts"
    click T2 "https://github.com/a1tharv/rsumai/blob/main/src/vite-env.d.ts"

    classDef ui fill:#cce5ff,stroke:#333,stroke-width:2px,rx:10,ry:10;
    classDef service fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef external fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef config fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef types fill:#d1c4e9,stroke:#333,stroke-width:2px;
```
