How tanuj0099/certifyroi works
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: App.jsx App · aiService.jsx AI Service · LandingPage.jsx Landing · BurnRate.jsx Burn Rate
Components 33
Browser UI
React app shell, screens, and interactive calculator views rendered in the browser.
- Entry · Vite/browser bootstrap that mounts the React app.
src/main.jsx - App · Top-level application composition and routing between product modes.
src/App.jsx - Landing · Primary marketing and onboarding surface for the ROI calculator.
src/components/LandingPage.jsx - Hero · Top-of-page value proposition and entry point.
src/components/Hero.jsx - Navigation · Top-level navigation and mode switching controls.
src/components/Navigation.jsx - Mode Select · Chooser for calculator or analysis mode.
src/components/ModeSelector.jsx - ROI Views · Core calculator and comparison surfaces for ROI analysis.
- Burn Rate · Scenario input and payoff computation view.
src/components/BurnRate.jsx - Career Sim · Career progression and earnings scenario model.
src/components/CareerSimulator.jsx - Compare · Certification comparison view.
src/components/CertCompare.jsx - College vs Corp · Educational path versus corporate path comparison.
src/components/CollegeVsCorporate.jsx - Job Map · Maps certifications to job-market demand and roles.
src/components/JobCertMap.jsx - AI Analysis · Prompt-driven interpretation and pitch-generation surfaces.
- Resume Analyzer · AI-assisted resume and certification feedback view.
src/components/ResumeAnalyzer.jsx - Pitch Tools · AI-generated pitch and selling-point helpers.
src/components/PitchGenerator.jsx - Hike Verifier · Salary hike validation and scenario checker.
src/components/HikeVerifier.jsx - Share Card · Shareable ROI summary card for social or export use.
src/components/ShareROICard.jsx - Error Boundary · Catches rendering failures in the UI tree.
src/components/ErrorBoundary.jsx - AI Loading · Loading and pending state for AI responses.
src/components/AILoadingState.jsx - Slider · Input control used by calculator scenarios.
src/components/Slider.jsx - Visuals · Shared visual styling and chart-friendly display pieces.
- Heatmap · Demand and intensity visualization component.
src/components/Heatmap.jsx - Neon Card · Styled card primitive used across polished surfaces.
src/components/NeonCard.jsx - Wave Bg · Background decoration for the landing experience.
src/components/WaveBg.jsx
Shared Logic
Reusable hooks and stateful calculator behavior shared across views.
Integrations
Client-side services and optional serverless boundary for AI and auth.
- AI Service · Client-side Groq request layer with demo fallback behavior.
src/services/aiService.jsx - Groq API · Optional serverless mediation for Groq access.
api/groq.js - Firebase · Firebase app setup for authentication.
src/firebase.js - Firebase UI · React-side Firebase wiring and helpers.
src/firebase.jsx
Connections 37
- 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.