# dhirajb05/opensprint architecture

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

- Interactive diagram: https://gitdiagram.com/dhirajb05/opensprint
- Repository: https://github.com/dhirajb05/opensprint

## Overview

#### Purpose and Entry Points
GitHub Roast Machine is a React/Vite single-page application backed by Express serverless/API handlers. A user submits a GitHub username, receives an AI-generated roast, career score, developer archetype, meme content, and a downloadable/shareable card. Frontend bootstraps at `Github-Roast/Profile_Analyser/src/main.jsx`; routing and app composition begin in `Github-Roast/Profile_Analyser/src/App.jsx`. The local backend entry point is `Github-Roast/Profile_Analyser/server/index.js`; Vercel integration is represented by `Github-Roast/Profile_Analyser/api/index.js` and `Github-Roast/Profile_Analyser/vercel.json`.

#### Frontend Interaction Flow
The landing screen collects the target username and roast mode in `Github-Roast/Profile_Analyser/src/pages/Landing.jsx`. The app transitions through terminal-style progress UI in `Github-Roast/Profile_Analyser/src/pages/Loading.jsx`, then presents generated content in `Github-Roast/Profile_Analyser/src/pages/Results.jsx`. Client navigation is React Router-based, while shared retro visual styling is concentrated in `Github-Roast/Profile_Analyser/src/index.css` and `Github-Roast/Profile_Analyser/src/App.css`.

#### GitHub Profile Acquisition Boundary
The backend’s GitHub integration is isolated in `Github-Roast/Profile_Analyser/server/routes/github.js`. This route fetches and shapes public GitHub profile/repository activity into input suitable for analysis. It forms the external-data boundary: frontend requests backend data rather than directly relying on GitHub from browser code, allowing credentials, normalization, rate-limit behavior, and API failures to remain server-side.

#### AI Roast Generation and Caching
`Github-Roast/Profile_Analyser/server/routes/roast.js` owns the main analysis stage: it turns GitHub-derived facts plus the chosen tone (Friendly, Sarcastic, or Savage) into the roast, score, and archetype through Groq’s Llama 3.1 8B Instant API. This route also implements the stated 24-hour caching behavior, using in-memory cache by default and optionally Vercel KV/Redis in production. Required service credentials and deployment-time configuration are indicated by `Github-Roast/Profile_Analyser/server/.env.example`.

#### Meme Generation Stage
`Github-Roast/Profile_Analyser/server/routes/meme.js` is a separate generation boundary for selecting meme templates and producing roast-specific captions. Keeping memes outside the primary roast route allows the results experience to compose optional/generated visual content independently of profile acquisition and core roast analysis. Rendered meme editing is handled by `Github-Roast/Profile_Analyser/src/pages/MemeEditor.jsx`.

#### Results, Export, and Sharing
`Github-Roast/Profile_Analyser/src/pages/Results.jsx` composes roast output, score, archetype, and inline meme results for presentation and social sharing. `Github-Roast/Profile_Analyser/src/pages/RoastCard.jsx` provides the styled, downloadable roast-card representation. These are presentation/export boundaries: generated backend payloads become user-controlled visual artifacts without moving AI or GitHub API access into the client.

#### Runtime and Deployment Topology
The frontend runs as a Vite-built React 19 application (`Github-Roast/Profile_Analyser/package.json`). The backend runs on Node.js with Express (`Github-Roast/Profile_Analyser/server/package.json`) during local development, while Vercel routes deployment through `Github-Roast/Profile_Analyser/api/index.js`. Material external services are GitHub’s API for source profile data, Groq for LLM generation, and optional Vercel KV Redis for persistent production caching.

Main entry points: [`Github-Roast/Profile_Analyser/server/routes/roast.js`](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/routes/roast.js) (Roast analysis), [`Github-Roast/Profile_Analyser/src/pages/Loading.jsx`](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/Loading.jsx) (Analysis progress), [`Github-Roast/Profile_Analyser/src/pages/Results.jsx`](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/Results.jsx) (Results experience), [`Github-Roast/Profile_Analyser/api/index.js`](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/api/index.js) (Vercel API adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React SPA"]
  node_vite["Vite React bootstrap<br/>frontend entry<br/>[main.jsx]"]
  node_app["App routing<br/>React Router shell<br/>[App.jsx]"]
  node_landing["Landing input<br/>username and mode UI<br/>[Landing.jsx]"]
  node_loading["Analysis progress<br/>terminal-style UI<br/>[Loading.jsx]"]
  node_results["Results experience<br/>output composition<br/>[Results.jsx]"]
  node_meme_editor["Meme editor<br/>visual editor<br/>[MemeEditor.jsx]"]
  node_roast_card["Roast card<br/>download/share view<br/>[RoastCard.jsx]"]
end

subgraph group_backend["API Backend"]
  node_express["Local Express server<br/>Node API runtime<br/>[index.js]"]
  node_vercel_api["Vercel API adapter<br/>serverless entry<br/>[index.js]"]
  node_github_route["GitHub acquisition<br/>API route<br/>[github.js]"]
  node_roast_route["Roast analysis<br/>AI API route<br/>[roast.js]"]
  node_cache[("24-hour cache<br/>in-memory / Redis cache")]
  node_meme_route["Meme generation<br/>API route<br/>[meme.js]"]
end

subgraph group_external["External Services"]
  node_github_api{{"GitHub API<br/>profile data service"}}
  node_groq{{"Groq Llama 3.1 8B<br/>LLM service"}}
  node_vercel_kv[("Vercel KV Redis<br/>optional cache service")]
  node_vercel{{"Vercel deployment<br/>serverless platform<br/>[vercel.json]"}}
end

node_vite -->|"mounts"| node_app
node_app -->|"starts at"| node_landing
node_landing -->|"submits username and mode"| node_loading
node_loading -->|"analysis complete"| node_results
node_results -->|"edits meme"| node_meme_editor
node_results -->|"exports or shares"| node_roast_card
node_loading -->|"requests profile facts"| node_github_route
node_loading -->|"requests roast analysis"| node_roast_route
node_results -->|"requests meme content"| node_meme_route
node_express -->|"serves"| node_github_route
node_express -->|"serves"| node_roast_route
node_express -->|"serves"| node_meme_route
node_vercel_api -->|"routes to"| node_github_route
node_vercel_api -->|"routes to"| node_roast_route
node_vercel_api -->|"routes to"| node_meme_route
node_github_route -->|"fetches public activity"| node_github_api
node_roast_route -->|"reads and writes"| node_cache
node_roast_route -->|"generates analysis"| node_groq
node_cache -.->|"persists in production"| node_vercel_kv
node_vercel -->|"deploys"| node_vercel_api

click node_vite "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/main.jsx"
click node_app "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/App.jsx"
click node_landing "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/Landing.jsx"
click node_loading "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/Loading.jsx"
click node_results "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/Results.jsx"
click node_meme_editor "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/MemeEditor.jsx"
click node_roast_card "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/RoastCard.jsx"
click node_express "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/index.js"
click node_vercel_api "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/api/index.js"
click node_github_route "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/routes/github.js"
click node_roast_route "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/routes/roast.js"
click node_meme_route "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/routes/meme.js"
click node_vercel "https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/vercel.json"

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_vite,node_app,node_landing,node_loading,node_results,node_meme_editor,node_roast_card toneBlue
class node_express,node_vercel_api,node_github_route,node_roast_route,node_cache,node_meme_route toneAmber
class node_github_api,node_groq,node_vercel_kv,node_vercel toneMint
```

## Components

### React SPA

- [Vite React bootstrap](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/main.jsx): frontend entry · `Github-Roast/Profile_Analyser/src/main.jsx`
- [App routing](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/App.jsx): React Router shell · `Github-Roast/Profile_Analyser/src/App.jsx`
- [Landing input](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/Landing.jsx): username and mode UI · `Github-Roast/Profile_Analyser/src/pages/Landing.jsx`
- [Analysis progress](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/Loading.jsx): terminal-style UI · `Github-Roast/Profile_Analyser/src/pages/Loading.jsx`
- [Results experience](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/Results.jsx): output composition · Presents roast, score, archetype, and meme output. · `Github-Roast/Profile_Analyser/src/pages/Results.jsx`
- [Meme editor](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/MemeEditor.jsx): visual editor · `Github-Roast/Profile_Analyser/src/pages/MemeEditor.jsx`
- [Roast card](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/src/pages/RoastCard.jsx): download/share view · `Github-Roast/Profile_Analyser/src/pages/RoastCard.jsx`

### API Backend

- [Local Express server](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/index.js): Node API runtime · `Github-Roast/Profile_Analyser/server/index.js`
- [Vercel API adapter](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/api/index.js): serverless entry · `Github-Roast/Profile_Analyser/api/index.js`
- [GitHub acquisition](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/routes/github.js): API route · Fetches and normalizes public profile and repository activity. · `Github-Roast/Profile_Analyser/server/routes/github.js`
- [Roast analysis](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/routes/roast.js): AI API route · Generates roast, career score, and archetype for the selected tone. · `Github-Roast/Profile_Analyser/server/routes/roast.js`
- **24-hour cache**: in-memory / Redis cache · Uses memory locally and can use Vercel KV in production.
- [Meme generation](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/server/routes/meme.js): API route · Selects templates and creates roast-specific captions. · `Github-Roast/Profile_Analyser/server/routes/meme.js`

### External Services

- **GitHub API**: profile data service
- **Groq Llama 3.1 8B**: LLM service
- **Vercel KV Redis**: optional cache service
- [Vercel deployment](https://github.com/dhirajb05/opensprint/blob/main/Github-Roast/Profile_Analyser/vercel.json): serverless platform · `Github-Roast/Profile_Analyser/vercel.json`

## Connections

- Vite React bootstrap → App routing: mounts
- App routing → Landing input: starts at
- Landing input → Analysis progress: submits username and mode
- Analysis progress → Results experience: analysis complete
- Results experience → Meme editor: edits meme
- Results experience → Roast card: exports or shares
- Analysis progress → GitHub acquisition: requests profile facts
- Analysis progress → Roast analysis: requests roast analysis
- Results experience → Meme generation: requests meme content
- Local Express server → GitHub acquisition: serves
- Local Express server → Roast analysis: serves
- Local Express server → Meme generation: serves
- Vercel API adapter → GitHub acquisition: routes to
- Vercel API adapter → Roast analysis: routes to
- Vercel API adapter → Meme generation: routes to
- GitHub acquisition → GitHub API: fetches public activity
- Roast analysis → 24-hour cache: reads and writes
- Roast analysis → Groq Llama 3.1 8B: generates analysis
- 24-hour cache → Vercel KV Redis: persists in production
- Vercel deployment → Vercel API adapter: deploys
