# ampersand-ai/pickra architecture

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

- Interactive diagram: https://gitdiagram.com/ampersand-ai/pickra
- Repository: https://github.com/ampersand-ai/pickra

## Overview

##### Project Type and Purpose
- This is a Single-Page Application (SPA) built with React, TypeScript, Vite, Tailwind CSS and the shadcn-ui component library.
- It is a client-side resume/job-matching tool that lets users upload resumes, define job requirements, and then calls external APIs (DeepSeek and OpenAI) to compute and display match results.

##### File Structure
- Top-level config: `vite.config.ts`, `tsconfig.json`, `tailwind.config.ts`, `package.json`
- `src/` – main code:
- `main.tsx` + `index.html` – application entry point
- `App.tsx` + `AppLayout.tsx` – global shell, theme provider
- `pages/` – route containers: `Landing`, `Index`, `Test`, `Settings`, `NotFound`
- `components/` – UI widgets (FileUpload, JobRequirements, ResumeResults, etc.) and `ui/` primitives from shadcn-ui
- `context/ResumeMatchContext.tsx` – React Context for global state
- `hooks/` – custom hooks (`useMobile`, `useToast`)
- `utils/` + `lib/` – business logic: `pdfParser.ts`, `deepseekApi.ts`, `openaiApi.ts`, helpers
- No proprietary backend code – relies on external REST/HTTP services.

##### README for Additional Insights
- Hosted/edited via Lovable.dev
- Tech stack confirmed: Vite, React, TS, shadcn-ui, Tailwind
- Deployment: static build + publish on Lovable (custom domain optional)

##### Main Components & Relationships
a. Browser / Client
- Loads the SPA (static assets served by Vite in dev; bundled for production)
b. React Application
- Entry: `main.tsx` → `App.tsx`
- Theme Provider: wraps UI (Tailwind + shadcn-ui)
- Router/Pages: `pages/` folder
- Layout: `AppLayout`
- Components: domain-specific (FileUpload, JobRequirementsList, ResumeResults, SendTestDialog)
- UI Primitives: `components/ui/*`
c. State Management
- `ResumeMatchContext`: holds uploaded files, job requirements, API responses
- Custom Hooks: `useMobile`, `useToast` for responsive design & notifications
d. Business Logic / Utilities
- PDF parsing (`pdfParser.ts`)
- API clients (`deepseekApi.ts`, `openaiApi.ts`)
- Mock data provider (`mockData.ts`)
e. External Services
- DeepSeek API (resume‐job matching)
- OpenAI API (scores, embeddings, LLM prompts)
f. Hosting Platform
- Lovable.dev (static site hosting, CI/CD triggered on Git pushes)

##### Architectural Patterns & Design Principles
- Component-Based UI (React + shadcn-ui primitives)
- Context API for cross-cutting state
- Separation of concerns: UI vs. state vs. data-access (utils)
- Hooks for reusable logic (responsive, notifications)
- Static hosting + HTTP calls to external services

##### Essential Elements
- Clear component names matching your file tree

## Diagram (Mermaid)

```mermaid
flowchart TB
    User["User"]:::external
    Browser["Browser"]:::external

    subgraph "UI Layer"
        indexHTML["index.html"]:::ui
        mainTSX["main.tsx"]:::ui
        AppTSX["App.tsx"]:::ui
        AppLayout["AppLayout.tsx"]:::ui
        ThemeProvider["theme-provider.tsx"]:::ui
        subgraph "Pages"
            Landing["Landing.tsx"]:::ui
            IndexPage["Index.tsx"]:::ui
            TestPage["Test.tsx"]:::ui
            Settings["Settings.tsx"]:::ui
            NotFound["NotFound.tsx"]:::ui
        end
        subgraph "Components"
            FileUpload["FileUpload.tsx"]:::ui
            JobRequirements["JobRequirements.tsx"]:::ui
            JobRequirementsList["JobRequirementsList.tsx"]:::ui
            ResumeResults["ResumeResults.tsx"]:::ui
            SendTestDialog["SendTestDialog.tsx"]:::ui
        end
        UIPrimitives["ui/"]:::ui
    end

    subgraph "State & Hooks"
        ResumeContext["ResumeMatchContext.tsx"]:::state
        useMobile["use-mobile.tsx"]:::state
        useToastHook["use-toast.ts"]:::state
        uiUseToast["ui/use-toast.ts"]:::state
    end

    subgraph "Business Logic"
        PDFParser["pdfParser.ts"]:::logic
        DeepSeekApi["deepseekApi.ts"]:::logic
        OpenAiApi["openaiApi.ts"]:::logic
        OpenAiHelpers["openai.ts"]:::logic
        MockData["mockData.ts"]:::logic
        GeneralUtils["utils.ts"]:::logic
    end

    subgraph "External Services"
        DeepSeek["DeepSeek API"]:::external
        OpenAI["OpenAI API"]:::external
    end

    subgraph "Build & Config"
        ViteConfig["vite.config.ts"]:::config
        TSConfig["tsconfig.json"]:::config
        TailwindConfig["tailwind.config.ts"]:::config
        IndexCSS["index.css"]:::config
        PackageJSON["package.json"]:::config
    end

    subgraph "Hosting"
        Lovable["Lovable.dev"]:::external
    end

    %% Data Flow
    User --> Browser
    Browser --> indexHTML
    indexHTML --> mainTSX
    mainTSX --> AppTSX
    AppTSX --> AppLayout
    AppLayout --> Landing
    AppLayout --> IndexPage
    AppLayout --> TestPage
    AppLayout --> Settings
    AppLayout --> NotFound
    Landing --> ResumeContext
    IndexPage --> ResumeContext
    TestPage --> ResumeContext
    Settings --> ResumeContext
    FileUpload --> ResumeContext
    JobRequirements --> ResumeContext
    JobRequirementsList --> ResumeContext
    SendTestDialog --> ResumeContext
    ResumeContext --> PDFParser
    ResumeContext --> DeepSeekApi
    ResumeContext --> OpenAiApi
    PDFParser --> ResumeContext
    DeepSeekApi --> DeepSeek
    OpenAiApi --> OpenAI
    DeepSeek --> ResumeContext
    OpenAI --> ResumeContext
    ResumeContext --> ResumeResults
    ViteConfig --> mainTSX
    TSConfig --> mainTSX
    TailwindConfig --> mainTSX
    IndexCSS --> mainTSX
    PackageJSON --> ViteConfig
    Lovable --> indexHTML

    %% Click Events
    click indexHTML "https://github.com/ampersand-ai/pickra/blob/main/index.html"
    click mainTSX "https://github.com/ampersand-ai/pickra/blob/main/src/main.tsx"
    click AppTSX "https://github.com/ampersand-ai/pickra/blob/main/src/App.tsx"
    click AppLayout "https://github.com/ampersand-ai/pickra/blob/main/src/components/AppLayout.tsx"
    click ThemeProvider "https://github.com/ampersand-ai/pickra/blob/main/src/components/theme-provider.tsx"
    click Landing "https://github.com/ampersand-ai/pickra/blob/main/src/pages/Landing.tsx"
    click IndexPage "https://github.com/ampersand-ai/pickra/blob/main/src/pages/Index.tsx"
    click TestPage "https://github.com/ampersand-ai/pickra/blob/main/src/pages/Test.tsx"
    click Settings "https://github.com/ampersand-ai/pickra/blob/main/src/pages/Settings.tsx"
    click NotFound "https://github.com/ampersand-ai/pickra/blob/main/src/pages/NotFound.tsx"
    click FileUpload "https://github.com/ampersand-ai/pickra/blob/main/src/components/FileUpload.tsx"
    click JobRequirements "https://github.com/ampersand-ai/pickra/blob/main/src/components/JobRequirements.tsx"
    click JobRequirementsList "https://github.com/ampersand-ai/pickra/blob/main/src/components/JobRequirementsList.tsx"
    click ResumeResults "https://github.com/ampersand-ai/pickra/blob/main/src/components/ResumeResults.tsx"
    click SendTestDialog "https://github.com/ampersand-ai/pickra/blob/main/src/components/SendTestDialog.tsx"
    click UIPrimitives "https://github.com/ampersand-ai/pickra/tree/main/src/components/ui/"
    click ResumeContext "https://github.com/ampersand-ai/pickra/blob/main/src/context/ResumeMatchContext.tsx"
    click useMobile "https://github.com/ampersand-ai/pickra/blob/main/src/hooks/use-mobile.tsx"
    click useToastHook "https://github.com/ampersand-ai/pickra/blob/main/src/hooks/use-toast.ts"
    click uiUseToast "https://github.com/ampersand-ai/pickra/blob/main/src/components/ui/use-toast.ts"
    click PDFParser "https://github.com/ampersand-ai/pickra/blob/main/src/utils/pdfParser.ts"
    click DeepSeekApi "https://github.com/ampersand-ai/pickra/blob/main/src/utils/deepseekApi.ts"
    click OpenAiApi "https://github.com/ampersand-ai/pickra/blob/main/src/utils/openaiApi.ts"
    click OpenAiHelpers "https://github.com/ampersand-ai/pickra/blob/main/src/utils/openai.ts"
    click MockData "https://github.com/ampersand-ai/pickra/blob/main/src/utils/mockData.ts"
    click GeneralUtils "https://github.com/ampersand-ai/pickra/blob/main/src/lib/utils.ts"
    click ViteConfig "https://github.com/ampersand-ai/pickra/blob/main/vite.config.ts"
    click TSConfig "https://github.com/ampersand-ai/pickra/blob/main/tsconfig.json"
    click TailwindConfig "https://github.com/ampersand-ai/pickra/blob/main/tailwind.config.ts"
    click IndexCSS "https://github.com/ampersand-ai/pickra/blob/main/src/index.css"
    click PackageJSON "https://github.com/ampersand-ai/pickra/blob/main/package.json"

    %% Styles
    classDef ui fill:#CCE5FF,stroke:#333,stroke-width:1px
    classDef state fill:#CCFFCC,stroke:#333,stroke-width:1px
    classDef logic fill:#FFF5CC,stroke:#333,stroke-width:1px
    classDef external fill:#FFD1A9,stroke:#333,stroke-width:1px
    classDef config fill:#E0E0E0,stroke:#333,stroke-width:1px
```
