# vivekverma807/resumecraft architecture

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

- Interactive diagram: https://gitdiagram.com/vivekverma807/resumecraft
- Repository: https://github.com/vivekverma807/resumecraft

## Overview

##### Project type and purpose
- From the file tree and README, this is a client-side, single-page/static web application called “Resume Builder.”
- It provides a login page, a resume-building interface, and PDF export functionality, all implemented in plain HTML/CSS/JavaScript without a dedicated backend server.

##### File structure
Top-level:
- index.html (landing page)
- auth/login.html (login UI)
- builder.html (resume-builder UI)
assets/:
- resume-template.docx (source template)
scripts/:
- auth.js (login logic)
- main.js (shared initializers/routing)
- builder.js (resume editor logic)
- pdf-export.js (PDF generation)
- storage.js (localStorage persistence)
styles/:
- style.css (global styles)
- builder.css (builder-page styles)

##### README for additional insights
- The README only gives the project title. No further architectural notes are provided, so we infer architecture solely from file structure and naming.

a. Main components
- User Interface
– Login Page (auth/login.html + auth.js + style.css)
– Builder Page (builder.html + builder.js + builder.css)
– Landing/Index (index.html + main.js + style.css)
- Client-side Services
– Authentication Service (auth.js)
– State Persistence (storage.js → localStorage)
– PDF Export Engine (pdf-export.js)
- Assets Store
– Resume Template (assets/resume-template.docx)
b. Relationships & interactions
1. User visits index.html → main.js routes to login or builder.
2. On login.html, auth.js validates credentials (e.g., mock or third-party API if implemented).
3. auth.js → upon success, redirect to builder.html.
4. In builder.html, builder.js loads any saved data via storage.js.
5. User edits fields → builder.js updates UI and calls storage.js to persist draft.
6. When user clicks “Export to PDF,” builder.js invokes pdf-export.js, which transforms HTML/CSS and the resume template into a downloadable PDF.
7. Download link is provided to the user.
c. Architectural patterns & principles
- Modular front-end: separate JS modules for auth, storage, builder, export.
- Client-only state persistence: storage.js abstracts away localStorage operations.
- Feature separation by page (login vs. builder) rather than a single huge bundle.
d. Key technologies & libraries
- Vanilla JavaScript modules
- HTML5 + CSS3
- localStorage (via storage.js)
- PDF generation library or browser API (pdf-export.js may wrap jsPDF, html2pdf, etc.)

##### Elements
– UI Pages: Login Page, Builder Page, Index/Landing Page
– JS Modules: auth.js, storage.js, builder.js, pdf-export.js, main.js
– Assets: resume-template.docx
– User input → auth.js → redirect
– builder.js ↔ storage.js (read/write)
– builder.js → pdf-export.js → Download
– UI components (e.g., blue rectangles)
– Services/modules (e.g., green rectangles)

## Diagram (Mermaid)

```mermaid
flowchart TB
    User(("User")):::external
    subgraph "User Interface"
        INDEX["Landing Page\nindex.html"]:::ui
        LOGIN["Login Page\nauth/login.html"]:::ui
        BUILDER_UI["Builder Page\nbuilder.html"]:::ui
    end

    subgraph "Client-side Services"
        MAIN["Main Router/Initializer\nscripts/main.js"]:::service
        AUTH["Authentication Service\nscripts/auth.js"]:::service
        STORAGE["State Persistence\n(scripts/storage.js)"]:::service
        BUILDER["Resume Builder Logic\nscripts/builder.js"]:::service
        PDFEXPORT["PDF Export Engine\nscripts/pdf-export.js"]:::service
    end

    subgraph "Assets Store"
        TEMPLATE["Resume Template\nassets/resume-template.docx"]:::asset
    end

    User -->|"visits"| INDEX
    INDEX -->|"init"| MAIN
    MAIN -->|"route to login if not authenticated"| LOGIN
    MAIN -->|"route to builder if authenticated"| BUILDER_UI
    LOGIN -->|"submit credentials"| AUTH
    AUTH -->|"login success"| MAIN
    AUTH -->|"redirect"| BUILDER_UI
    BUILDER_UI -->|"load UI logic"| BUILDER
    BUILDER -->|"read draft data"| STORAGE
    BUILDER -->|"write draft data"| STORAGE
    BUILDER -->|"export request"| PDFEXPORT
    PDFEXPORT -->|"load template"| TEMPLATE
    PDFEXPORT -->|"download PDF"| User

    click INDEX "https://github.com/vivekverma807/resumecraft/blob/main/index.html"
    click LOGIN "https://github.com/vivekverma807/resumecraft/blob/main/auth/login.html"
    click BUILDER_UI "https://github.com/vivekverma807/resumecraft/blob/main/builder.html"
    click MAIN "https://github.com/vivekverma807/resumecraft/blob/main/scripts/main.js"
    click AUTH "https://github.com/vivekverma807/resumecraft/blob/main/scripts/auth.js"
    click STORAGE "https://github.com/vivekverma807/resumecraft/blob/main/scripts/storage.js"
    click BUILDER "https://github.com/vivekverma807/resumecraft/blob/main/scripts/builder.js"
    click PDFEXPORT "https://github.com/vivekverma807/resumecraft/blob/main/scripts/pdf-export.js"
    click TEMPLATE "https://github.com/vivekverma807/resumecraft/blob/main/assets/resume-template.docx"

    classDef ui fill:#E0F7FA,stroke:#0288D1,color:#01579B
    classDef service fill:#E8F5E9,stroke:#2E7D32,color:#1B5E20
    classDef asset fill:#FFF9C4,stroke:#F9A825,color:#F57F17
    classDef external fill:#FFFFFF,stroke:#000000,color:#000000
```
