# tanuj0099/certifyroi architecture

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

- Interactive diagram: https://gitdiagram.com/tanuj0099/certifyroi
- Repository: https://github.com/tanuj0099/certifyroi

## Overview

1. **Overall shape**
   - This is a **single-page React app** built with **Vite** and styled with **Tailwind/CSS variables**. The core product is a certification ROI calculator with an AI-assisted analysis layer, not a multi-page backend-heavy system.

2. **Primary runtime boundary**
   - The main execution boundary is the **browser**: `src/main.jsx` boots `App.jsx`, and most of the logic lives in React components, hooks, and client-side services.
   - Deployment is designed for **static hosting plus optional serverless support** on Vercel (`vercel.json`), which matches the mostly client-side architecture.

3. **UI composition layer**
   - `src/components/` contains the visible product surfaces:
     - `Hero`, `LandingPage`, `Navigation`, `ModeSelector`, `ThemeToggle`
     - calculator/analysis panels like `BurnRate`, `CareerSimulator`, `CertCompare`, `CollegeVsCorporate`, `JobCertMap`, `ResumeAnalyzer`, `PitchGenerator`, `PitchBoss`, `HikeVerifier`, `ShareROICard`
     - support components like `ErrorBoundary`, `AILoadingState`, `NeonCard`, `WaveBg`, `Slider`, `Heatmap`
   - These are mostly presentational and feature-specific pieces assembled by `App.jsx`.

4. **Core interaction flow**
   - User input enters through **sliders, mode selection, and analysis prompts**.
   - Those inputs feed into calculation/state hooks, then render into comparison charts, ROI summaries, and AI-generated insights.
   - The app is centered around a loop of: **adjust inputs → compute ROI / scenario results → visualize → optionally ask Groq for interpretation**.

5. **Business logic and shared state**
   - `src/hooks/` holds the reusable logic boundary:
     - `useAuth.jsx` manages Firebase auth state
     - `useTheme.jsx` manages UI theme preference
     - `hooks.jsx` appears to bundle ROI utilities, guest limits, and other shared calculator logic
   - This is where cross-component state and non-visual behavior are normalized before reaching the UI.

6. **AI integration boundary**
   - `src/services/aiService.jsx` is the client-side service layer for Groq requests.
   - The README indicates the app can run in **demo mode** without a key, so this service likely handles both:
     - live model calls when `VITE_GROQ_API_KEY` is present
     - mocked/templated responses when it is not
   - The presence of `api/groq.js` suggests a **thin serverless API boundary** for Groq access in some deployments.

7. **Authentication and gating**
   - `src/firebase.js` and `src/firebase.jsx` define the Firebase integration, and `useAuth.jsx` exposes it to the UI.
   - The repo uses Firebase primarily for **Google and Phone authentication** and for gating the “free guest queries” experience.
   - Architecturally, auth sits alongside the AI layer as an access-control boundary, not as the app’s core data store.

8. **Static domain data**
   - `src/data/jobCertData.js` is the main structured content source for certification/job-market mappings and likely powers the comparison/map-style views.
   - `src/tokens.js` centralizes design tokens and possibly domain constants, keeping presentation values and certification metadata out of the feature components.

9. **Visualization and feedback layer**
   - Recharts-based visualizations are used for ROI comparisons and scenario display, especially the “with cert vs inaction” framing described in the README.
   - The app emphasizes **decision support visuals** more than generic dashboards: break-even, 5-year gain, market demand, and loss-aversion framing.

10. **Resilience and UX polish**
   - `ErrorBoundary.jsx` isolates rendering failures so the calculator can fail gracefully.
   - `AILoadingState.jsx` handles asynchronous AI feedback states.
   - `ThemeToggle`, `NeonCard`, `WaveBg`, and the Tailwind config indicate a strong separation between **interaction logic** and **luxury visual treatment**.

11. **Configuration and build**
   - `vite.config.js`, `tailwind.config.js`, `postcss.config.js`, and `package.json` define the frontend build pipeline.
   - `index.html` is the Vite entry shell, and `src/index.css` provides the base global styling layer.

12. **Important architectural boundaries to draw**
   - **Browser UI layer**: React components and charts
   - **Shared logic layer**: hooks for ROI/auth/theme
   - **Service layer**: AI calls to Groq, plus mock/demo fallback
   - **External services**: Groq for LLM analysis, Firebase for auth
   - **Static content layer**: job/cert data and design tokens
   - **Optional serverless edge**: `api/groq.js` / `groq.js` for deployment-time API mediation

13. **How data moves end-to-end**
   - User input flows from UI controls into hooks/calculation utilities.
   - Calculated outputs feed charts, cards, and shareable summary components.
   - When the user requests analysis, the app sends a prompt payload through `aiService` to Groq (or a mock path), then renders the response into the analysis panels.
   - Auth state from Firebase influences whether the user is gated, limited, or fully unlocked.

14. **Repo artifacts**
   - The top-level `certifyroi/`, `antigravitycertifyroi/`, and `certifyroi-project.tar.gz` look like packaged or duplicated project artifacts rather than active subsystems.
   - For an architecture diagram, the important live system is the **root Vite app in `src/` plus the small AI/auth integration points**.

Main entry points: [`src/App.jsx`](https://github.com/tanuj0099/certifyroi/blob/main/src/App.jsx) (App), [`src/services/aiService.jsx`](https://github.com/tanuj0099/certifyroi/blob/main/src/services/aiService.jsx) (AI Service), [`src/components/LandingPage.jsx`](https://github.com/tanuj0099/certifyroi/blob/main/src/components/LandingPage.jsx) (Landing), [`src/components/BurnRate.jsx`](https://github.com/tanuj0099/certifyroi/blob/main/src/components/BurnRate.jsx) (Burn Rate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser UI"]
  node_main["Entry<br/>boot<br/>[main.jsx]"]
  node_app["App<br/>shell<br/>[App.jsx]"]
  node_landing["Landing<br/>surface<br/>[LandingPage.jsx]"]
  node_hero["Hero<br/>surface<br/>[Hero.jsx]"]
  node_nav["Navigation<br/>surface<br/>[Navigation.jsx]"]
  node_mode["Mode Select<br/>control<br/>[ModeSelector.jsx]"]
  node_calc["ROI Views<br/>feature set"]
  node_burn["Burn Rate<br/>calculator<br/>[BurnRate.jsx]"]
  node_career["Career Sim<br/>simulator"]
  node_compare["Compare<br/>comparison<br/>[CertCompare.jsx]"]
  node_college["College vs Corp<br/>comparison"]
  node_map["Job Map<br/>mapping<br/>[JobCertMap.jsx]"]
  node_analysis["AI Analysis<br/>feature set"]
  node_resume["Resume Analyzer<br/>analysis<br/>[ResumeAnalyzer.jsx]"]
  node_pitch["Pitch Tools<br/>analysis<br/>[PitchGenerator.jsx]"]
  node_hike["Hike Verifier<br/>analysis<br/>[HikeVerifier.jsx]"]
  node_share["Share Card<br/>output<br/>[ShareROICard.jsx]"]
  node_error["Error Boundary<br/>resilience<br/>[ErrorBoundary.jsx]"]
  node_loading["AI Loading<br/>status ui<br/>[AILoadingState.jsx]"]
  node_slider["Slider<br/>control<br/>[Slider.jsx]"]
  node_visual["Visuals<br/>presentation"]
  node_heatmap["Heatmap<br/>chart<br/>[Heatmap.jsx]"]
  node_neon["Neon Card<br/>presentation<br/>[NeonCard.jsx]"]
  node_wave["Wave Bg<br/>presentation<br/>[WaveBg.jsx]"]
end

subgraph group_logic["Shared Logic"]
  node_hookset["Hooks<br/>state layer<br/>[hooks.jsx]"]
  node_auth["Auth<br/>state hook<br/>[useAuth.jsx]"]
  node_theme["Theme<br/>state hook<br/>[useTheme.jsx]"]
end

subgraph group_services["Integrations"]
  node_ai["AI Service<br/>[aiService.jsx]"]
  node_groqapi["Groq API<br/>edge api<br/>[groq.js]"]
  node_firebase["Firebase<br/>integration<br/>[firebase.js]"]
  node_fbjsx["Firebase UI<br/>integration<br/>[firebase.jsx]"]
end

subgraph group_content["Static Content"]
  node_jobdata[("Job Data<br/>dataset<br/>[jobCertData.js]")]
  node_tokens["Tokens<br/>design system<br/>[tokens.js]"]
end

node_main -->|"mounts"| node_app
node_app -->|"shows"| node_landing
node_app -->|"uses"| node_nav
node_app -->|"switches"| node_mode
node_app -->|"renders"| node_calc
node_app -->|"renders"| node_analysis
node_app -->|"exports"| node_share
node_landing -->|"contains"| node_hero
node_landing -->|"styles"| node_wave
node_calc -->|"includes"| node_burn
node_calc -->|"includes"| node_career
node_calc -->|"includes"| node_compare
node_calc -->|"includes"| node_college
node_calc -->|"includes"| node_map
node_burn -->|"computes with"| node_hookset
node_career -->|"computes with"| node_hookset
node_compare -->|"reads"| node_jobdata
node_map -->|"reads"| node_jobdata
node_analysis -->|"includes"| node_resume
node_analysis -->|"includes"| node_pitch
node_analysis -->|"includes"| node_hike
node_resume -->|"requests"| node_ai
node_pitch -->|"requests"| node_ai
node_hike -->|"requests"| node_ai
node_ai -.->|"can proxy through"| node_groqapi
node_app -->|"gates"| node_auth
node_auth -->|"uses"| node_firebase
node_auth -->|"exposes"| node_fbjsx
node_app -->|"persists"| node_theme
node_theme -->|"aligns with"| node_tokens
node_hero -->|"uses"| node_neon
node_burn -->|"inputs"| node_slider
node_career -->|"inputs"| node_slider
node_compare -->|"visualizes"| node_heatmap
node_map -->|"visualizes"| node_heatmap
node_analysis -->|"states"| node_loading
node_app -->|"guards"| node_error

click node_main "https://github.com/tanuj0099/certifyroi/blob/main/src/main.jsx"
click node_app "https://github.com/tanuj0099/certifyroi/blob/main/src/App.jsx"
click node_landing "https://github.com/tanuj0099/certifyroi/blob/main/src/components/LandingPage.jsx"
click node_hero "https://github.com/tanuj0099/certifyroi/blob/main/src/components/Hero.jsx"
click node_nav "https://github.com/tanuj0099/certifyroi/blob/main/src/components/Navigation.jsx"
click node_mode "https://github.com/tanuj0099/certifyroi/blob/main/src/components/ModeSelector.jsx"
click node_burn "https://github.com/tanuj0099/certifyroi/blob/main/src/components/BurnRate.jsx"
click node_career "https://github.com/tanuj0099/certifyroi/blob/main/src/components/CareerSimulator.jsx"
click node_compare "https://github.com/tanuj0099/certifyroi/blob/main/src/components/CertCompare.jsx"
click node_college "https://github.com/tanuj0099/certifyroi/blob/main/src/components/CollegeVsCorporate.jsx"
click node_map "https://github.com/tanuj0099/certifyroi/blob/main/src/components/JobCertMap.jsx"
click node_resume "https://github.com/tanuj0099/certifyroi/blob/main/src/components/ResumeAnalyzer.jsx"
click node_pitch "https://github.com/tanuj0099/certifyroi/blob/main/src/components/PitchGenerator.jsx"
click node_hike "https://github.com/tanuj0099/certifyroi/blob/main/src/components/HikeVerifier.jsx"
click node_share "https://github.com/tanuj0099/certifyroi/blob/main/src/components/ShareROICard.jsx"
click node_hookset "https://github.com/tanuj0099/certifyroi/blob/main/src/hooks/hooks.jsx"
click node_auth "https://github.com/tanuj0099/certifyroi/blob/main/src/hooks/useAuth.jsx"
click node_theme "https://github.com/tanuj0099/certifyroi/blob/main/src/hooks/useTheme.jsx"
click node_ai "https://github.com/tanuj0099/certifyroi/blob/main/src/services/aiService.jsx"
click node_groqapi "https://github.com/tanuj0099/certifyroi/blob/main/api/groq.js"
click node_firebase "https://github.com/tanuj0099/certifyroi/blob/main/src/firebase.js"
click node_fbjsx "https://github.com/tanuj0099/certifyroi/blob/main/src/firebase.jsx"
click node_jobdata "https://github.com/tanuj0099/certifyroi/blob/main/src/data/jobCertData.js"
click node_tokens "https://github.com/tanuj0099/certifyroi/blob/main/src/tokens.js"
click node_error "https://github.com/tanuj0099/certifyroi/blob/main/src/components/ErrorBoundary.jsx"
click node_loading "https://github.com/tanuj0099/certifyroi/blob/main/src/components/AILoadingState.jsx"
click node_slider "https://github.com/tanuj0099/certifyroi/blob/main/src/components/Slider.jsx"
click node_heatmap "https://github.com/tanuj0099/certifyroi/blob/main/src/components/Heatmap.jsx"
click node_neon "https://github.com/tanuj0099/certifyroi/blob/main/src/components/NeonCard.jsx"
click node_wave "https://github.com/tanuj0099/certifyroi/blob/main/src/components/WaveBg.jsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_landing,node_hero,node_nav,node_mode,node_calc,node_burn,node_career,node_compare,node_college,node_map,node_analysis,node_resume,node_pitch,node_hike,node_share,node_error,node_loading,node_slider,node_visual,node_heatmap,node_neon,node_wave toneBlue
class node_hookset,node_auth,node_theme toneAmber
class node_ai,node_groqapi,node_firebase,node_fbjsx toneMint
class node_jobdata,node_tokens toneRose
```

## Components

### Browser UI

React app shell, screens, and interactive calculator views rendered in the browser.

- [Entry](https://github.com/tanuj0099/certifyroi/blob/main/src/main.jsx): boot · Vite/browser bootstrap that mounts the React app. · `src/main.jsx`
- [App](https://github.com/tanuj0099/certifyroi/blob/main/src/App.jsx): shell · Top-level application composition and routing between product modes. · `src/App.jsx`
- [Landing](https://github.com/tanuj0099/certifyroi/blob/main/src/components/LandingPage.jsx): surface · Primary marketing and onboarding surface for the ROI calculator. · `src/components/LandingPage.jsx`
- [Hero](https://github.com/tanuj0099/certifyroi/blob/main/src/components/Hero.jsx): surface · Top-of-page value proposition and entry point. · `src/components/Hero.jsx`
- [Navigation](https://github.com/tanuj0099/certifyroi/blob/main/src/components/Navigation.jsx): surface · Top-level navigation and mode switching controls. · `src/components/Navigation.jsx`
- [Mode Select](https://github.com/tanuj0099/certifyroi/blob/main/src/components/ModeSelector.jsx): control · Chooser for calculator or analysis mode. · `src/components/ModeSelector.jsx`
- **ROI Views**: feature set · Core calculator and comparison surfaces for ROI analysis.
- [Burn Rate](https://github.com/tanuj0099/certifyroi/blob/main/src/components/BurnRate.jsx): calculator · Scenario input and payoff computation view. · `src/components/BurnRate.jsx`
- [Career Sim](https://github.com/tanuj0099/certifyroi/blob/main/src/components/CareerSimulator.jsx): simulator · Career progression and earnings scenario model. · `src/components/CareerSimulator.jsx`
- [Compare](https://github.com/tanuj0099/certifyroi/blob/main/src/components/CertCompare.jsx): comparison · Certification comparison view. · `src/components/CertCompare.jsx`
- [College vs Corp](https://github.com/tanuj0099/certifyroi/blob/main/src/components/CollegeVsCorporate.jsx): comparison · Educational path versus corporate path comparison. · `src/components/CollegeVsCorporate.jsx`
- [Job Map](https://github.com/tanuj0099/certifyroi/blob/main/src/components/JobCertMap.jsx): mapping · Maps certifications to job-market demand and roles. · `src/components/JobCertMap.jsx`
- **AI Analysis**: feature set · Prompt-driven interpretation and pitch-generation surfaces.
- [Resume Analyzer](https://github.com/tanuj0099/certifyroi/blob/main/src/components/ResumeAnalyzer.jsx): analysis · AI-assisted resume and certification feedback view. · `src/components/ResumeAnalyzer.jsx`
- [Pitch Tools](https://github.com/tanuj0099/certifyroi/blob/main/src/components/PitchGenerator.jsx): analysis · AI-generated pitch and selling-point helpers. · `src/components/PitchGenerator.jsx`
- [Hike Verifier](https://github.com/tanuj0099/certifyroi/blob/main/src/components/HikeVerifier.jsx): analysis · Salary hike validation and scenario checker. · `src/components/HikeVerifier.jsx`
- [Share Card](https://github.com/tanuj0099/certifyroi/blob/main/src/components/ShareROICard.jsx): output · Shareable ROI summary card for social or export use. · `src/components/ShareROICard.jsx`
- [Error Boundary](https://github.com/tanuj0099/certifyroi/blob/main/src/components/ErrorBoundary.jsx): resilience · Catches rendering failures in the UI tree. · `src/components/ErrorBoundary.jsx`
- [AI Loading](https://github.com/tanuj0099/certifyroi/blob/main/src/components/AILoadingState.jsx): status ui · Loading and pending state for AI responses. · `src/components/AILoadingState.jsx`
- [Slider](https://github.com/tanuj0099/certifyroi/blob/main/src/components/Slider.jsx): control · Input control used by calculator scenarios. · `src/components/Slider.jsx`
- **Visuals**: presentation · Shared visual styling and chart-friendly display pieces.
- [Heatmap](https://github.com/tanuj0099/certifyroi/blob/main/src/components/Heatmap.jsx): chart · Demand and intensity visualization component. · `src/components/Heatmap.jsx`
- [Neon Card](https://github.com/tanuj0099/certifyroi/blob/main/src/components/NeonCard.jsx): presentation · Styled card primitive used across polished surfaces. · `src/components/NeonCard.jsx`
- [Wave Bg](https://github.com/tanuj0099/certifyroi/blob/main/src/components/WaveBg.jsx): presentation · Background decoration for the landing experience. · `src/components/WaveBg.jsx`

### Shared Logic

Reusable hooks and stateful calculator behavior shared across views.

- [Hooks](https://github.com/tanuj0099/certifyroi/blob/main/src/hooks/hooks.jsx): state layer · Reusable state and calculator logic shared across the app. · `src/hooks/hooks.jsx`
- [Auth](https://github.com/tanuj0099/certifyroi/blob/main/src/hooks/useAuth.jsx): state hook · Firebase-backed authentication and guest gating state. · `src/hooks/useAuth.jsx`
- [Theme](https://github.com/tanuj0099/certifyroi/blob/main/src/hooks/useTheme.jsx): state hook · UI theme preference and dark-mode state. · `src/hooks/useTheme.jsx`

### Integrations

Client-side services and optional serverless boundary for AI and auth.

- [AI Service](https://github.com/tanuj0099/certifyroi/blob/main/src/services/aiService.jsx): service · Client-side Groq request layer with demo fallback behavior. · `src/services/aiService.jsx`
- [Groq API](https://github.com/tanuj0099/certifyroi/blob/main/api/groq.js): edge api · Optional serverless mediation for Groq access. · `api/groq.js`
- [Firebase](https://github.com/tanuj0099/certifyroi/blob/main/src/firebase.js): integration · Firebase app setup for authentication. · `src/firebase.js`
- [Firebase UI](https://github.com/tanuj0099/certifyroi/blob/main/src/firebase.jsx): integration · React-side Firebase wiring and helpers. · `src/firebase.jsx`

### Static Content

Domain data and design tokens used across the app.

- [Job Data](https://github.com/tanuj0099/certifyroi/blob/main/src/data/jobCertData.js): dataset · Certification and job-market mapping data. · `src/data/jobCertData.js`
- [Tokens](https://github.com/tanuj0099/certifyroi/blob/main/src/tokens.js): design system · Shared design tokens and domain constants. · `src/tokens.js`

## Connections

- Entry → App: mounts · Bootstraps the root React application.
- App → Landing: shows · Composes the main landing experience.
- App → Navigation: uses · Provides top-level navigation and mode switching.
- App → Mode Select: switches · Selects the active calculator or analysis mode.
- App → ROI Views: renders · Surfaces the core ROI calculator views.
- App → AI Analysis: renders · Surfaces AI-assisted analysis tools.
- App → Share Card: exports · Produces shareable summary output.
- Landing → Hero: contains · Landing page includes the hero section.
- Landing → Wave Bg: styles · Uses decorative background treatment.
- ROI Views → Burn Rate: includes · One of the main scenario calculators.
- ROI Views → Career Sim: includes · Career earnings simulation.
- ROI Views → Compare: includes · Certification comparison view.
- ROI Views → College vs Corp: includes · Path comparison view.
- ROI Views → Job Map: includes · Job-market mapping view.
- Burn Rate → Hooks: computes with · Uses shared ROI and scenario logic.
- Career Sim → Hooks: computes with · Uses shared calculator utilities.
- Compare → Job Data: reads · Pulls structured certification/domain data.
- Job Map → Job Data: reads · Uses the job-certification dataset.
- AI Analysis → Resume Analyzer: includes · Resume and certification feedback.
- AI Analysis → Pitch Tools: includes · Pitch generation and framing tools.
- AI Analysis → Hike Verifier: includes · Salary increase verification flow.
- Resume Analyzer → AI Service: requests · Sends prompts for interpretation and feedback.
- Pitch Tools → AI Service: requests · Generates AI-written pitch content.
- Hike Verifier → AI Service: requests · Uses AI for scenario interpretation.
- AI Service → Groq API: can proxy through · Optional deployment-time API mediation.
- App → Auth: gates · Controls guest limits and access state.
- Auth → Firebase: uses · Relies on Firebase authentication backend.
- Auth → Firebase UI: exposes · Provides auth state to React components.
- App → Theme: persists · Applies theme preference across the app.
- Theme → Tokens: aligns with · Shares the design system palette and constants.
- Hero → Neon Card: uses · Uses the stylized card primitive.
- Burn Rate → Slider: inputs · Relies on scenario sliders for user tuning.
- Career Sim → Slider: inputs · Uses sliders for model inputs.
- Compare → Heatmap: visualizes · Uses chart-style visual feedback.
- Job Map → Heatmap: visualizes · Shows demand/intensity structure.
- AI Analysis → AI Loading: states · Displays asynchronous AI progress.
- App → Error Boundary: guards · Wraps the UI in a failure boundary.
