# hothead01th/free-resume-maker architecture

> Architecture diagram of the GitHub repository hothead01th/free-resume-maker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hothead01th/free-resume-maker
- Repository: https://github.com/hothead01th/free-resume-maker

## Overview

##### Main Components
- Frontend UI – The bulk of the project is composed of React components located under the “components” directory (divided further into categories like ai, form, hero, meta, preview, ui, and utility). These handle the display and interaction for resume building, including drag-and-drop functionality and real-time previews.
- Page Routing – “pages” directory contains the Next.js pages like _app.jsx, _document.jsx, index.jsx, builder.jsx, and templates.jsx that integrate the UI components into the overall application framework.
- API Layer – Under “pages/api” you have endpoints (such as hello.ts and suggestions.js) to serve backend functionalities. Particularly, suggestions.js likely communicates with the Google Gemini API for smart content suggestions.
- Utility & Helper Modules – The “lib” and “utils” directories include utility functions and helper scripts (for example, utils/gemini.js and lib/utils.ts) that encapsulate business logic or API communication.
- Development & Configurations – Files like next.config.mjs, tailwind.config.ts, tsconfig.json, and other configuration files govern build behavior, styling, and overall project setup.

##### Establish Relationships and Data Flow
- The Next.js Pages act as controllers – they pull together various UI components and connect to the API endpoints for fetching data or processing AI suggestions.
- The UI Components (like Form and Preview) are responsible for capturing user input and displaying the live resume preview.
- When the user requests an AI suggestion (e.g., by clicking on the AISuggestionButton component), a request is sent through the API route (pages/api/suggestions.js), which in turn may use the utility functions (in lib or utils) for contacting the external Google Gemini API.
- The submit or preview actions update the state of the resume, and the changes are rendered immediately thanks to the component-based architecture.

##### Architectural Patterns & Important Design Principles
- Separation of Concerns: The project clearly separates its UI, API logic, and helper utilities. This helps in isolating responsibilities (e.g., visual representation in components, data-fetching in API routes, and logic in utility files).
- Component-Based Design: The architecture leverages React’s component model to encapsulate various sections of a resume (profiles, education, work experience, etc.) and enable reuse and easy maintenance.
- Modular Routing: Using the Next.js file-based routing system to separate concerns between page rendering and API handling.

##### Keep in Mind
- Integration of AI-powered features via the Google Gemini API, which is an essential part of the project’s unique selling proposition.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend UI Components
    subgraph "Frontend UI Components"
        comp_ai["AI Components"]:::ui
        comp_form["Form Components"]:::ui
        comp_hero["Hero Components"]:::ui
        comp_meta["Meta Components"]:::ui
        comp_preview["Preview Components"]:::ui
        comp_ui["General UI Components"]:::ui
        comp_util["Utility UI Components"]:::ui
    end

    %% Next.js Pages
    subgraph "Next.js Pages"
        page_app["_app.jsx"]:::page
        page_document["_document.jsx"]:::page
        page_builder["builder.jsx"]:::page
        page_index["index.jsx"]:::page
        page_templates["templates.jsx"]:::page
    end

    %% API Endpoints
    subgraph "API Endpoints"
        api_hello["hello.ts"]:::api
        api_suggestions["suggestions.js (AI Suggestions)"]:::api
    end

    %% Utility & Helper Modules
    subgraph "Utility & Helper Modules"
        util_lib["lib/utils.ts"]:::util
        util_gemini["utils/gemini.js"]:::util
    end

    %% External Service
    geminiExternal["Google Gemini API"]:::external

    %% Development & Configurations
    subgraph "Development & Configurations"
        dev_next["next.config.mjs"]:::dev
        dev_tailwind["tailwind.config.ts"]:::dev
        dev_ts["tsconfig.json"]:::dev
    end

    %% Relationships between components
    comp_ai -->|"Uses"| page_app
    comp_form -->|"Uses"| page_app
    comp_hero -->|"Uses"| page_app
    comp_meta -->|"Uses"| page_app
    comp_preview -->|"Uses"| page_app
    comp_ui -->|"Uses"| page_app
    comp_util -->|"Uses"| page_app

    page_app -->|"Wraps"| page_document
    page_builder -->|"RenderBy"| page_app
    page_index -->|"RenderBy"| page_app
    page_templates -->|"RenderBy"| page_app

    page_builder -->|"Calls"| api_suggestions
    page_index -->|"Calls"| api_hello

    api_suggestions -->|"Uses"| util_lib
    api_suggestions -->|"Uses"| util_gemini

    api_suggestions -->|"Connects"| geminiExternal

    dev_next ---|"Configures"| page_app
    dev_tailwind ---|"Configures"| comp_ui
    dev_ts ---|"Configures"| comp_util

    %% Click Events
    click comp_ai "https://github.com/hothead01th/free-resume-maker/tree/main/components/ai"
    click comp_form "https://github.com/hothead01th/free-resume-maker/tree/main/components/form"
    click comp_hero "https://github.com/hothead01th/free-resume-maker/tree/main/components/hero"
    click comp_meta "https://github.com/hothead01th/free-resume-maker/tree/main/components/meta"
    click comp_preview "https://github.com/hothead01th/free-resume-maker/tree/main/components/preview"
    click comp_ui "https://github.com/hothead01th/free-resume-maker/tree/main/components/ui"
    click comp_util "https://github.com/hothead01th/free-resume-maker/tree/main/components/utility"

    click page_app "https://github.com/hothead01th/free-resume-maker/blob/main/pages/_app.jsx"
    click page_document "https://github.com/hothead01th/free-resume-maker/blob/main/pages/_document.jsx"
    click page_builder "https://github.com/hothead01th/free-resume-maker/blob/main/pages/builder.jsx"
    click page_index "https://github.com/hothead01th/free-resume-maker/blob/main/pages/index.jsx"
    click page_templates "https://github.com/hothead01th/free-resume-maker/blob/main/pages/templates.jsx"

    click api_hello "https://github.com/hothead01th/free-resume-maker/blob/main/pages/api/hello.ts"
    click api_suggestions "https://github.com/hothead01th/free-resume-maker/blob/main/pages/api/suggestions.js"

    click util_lib "https://github.com/hothead01th/free-resume-maker/blob/main/lib/utils.ts"
    click util_gemini "https://github.com/hothead01th/free-resume-maker/blob/main/utils/gemini.js"

    click dev_next "https://github.com/hothead01th/free-resume-maker/blob/main/next.config.mjs"
    click dev_tailwind "https://github.com/hothead01th/free-resume-maker/blob/main/tailwind.config.ts"
    click dev_ts "https://github.com/hothead01th/free-resume-maker/blob/main/tsconfig.json"

    %% Styles
    classDef ui fill:#add8e6,stroke:#333,stroke-width:2px
    classDef page fill:#90ee90,stroke:#333,stroke-width:2px
    classDef api fill:#ffcccb,stroke:#333,stroke-width:2px
    classDef util fill:#ffffe0,stroke:#333,stroke-width:2px
    classDef external fill:#d3d3d3,stroke:#333,stroke-width:2px
    classDef dev fill:#f5deb3,stroke:#333,stroke-width:2px

    linkStyle default stroke:#333,stroke-width:2px
```
