How jaydip-satani/git-spect works
Project Type and Purpose
• Gitspect is a single‐page/full-stack (server-rendered) web application built with Next.js.
• It’s a frontend‐centric project that fetches data from an external service (the GitHub API), processes it, and displays interactive visualizations.
Main System Components
a. Client Browser
• Renders UI (HTML/CSS/JS).
• Users enter GitHub usernames and interact with the charts/components.
b. Next.js Server (SSR/SSG)
• Hosts React components in the src/app and src/components directories.
• Responsible for server‐side rendering (or static generation) of pages at build time or on request.
c. Static Asset Host / CDN
• Serves the built JS/CSS bundles, images (in /public), and favicon.
• Often implemented via Vercel, Netlify, or any static‐hosting provider.
d. GitHub API (External Service)
• Provides public user data (repos, followers, activity).
• Gitspect sends HTTPS requests to endpoints like https://api.github.com/users/:username and GitHub’s REST API for language statistics, commit activity, etc.
Relationships and Data Flows
1) User opens the web page in Browser.
2) Browser loads HTML/CSS/JS from CDN.
3) Browser invokes client‐side code (or Next.js SSR fetches on the server) to call the GitHub API.
4) GitHub API returns JSON data.
5) Next.js processes that data, hydrates React components (GitHubCard, GitHubChart, GitHubCalendar).
6) The Browser renders the interactive charts and UI state.
7) For subsequent searches, the Browser repeats steps 3–6 (client‐side fetch).
Architectural Patterns and Design Principles
• Component‐based UI (React + Next.js App Router).
• Separation of concerns:
• src/app for routing/layout pages (page.tsx, layout.tsx)
• src/components for reusable UI pieces ( charts, cards, spinners )
• External API integration: data‐fetching hooks or fetch calls within server‐components or client‐components.
• Styling via Tailwind CSS (postcss.config.mjs, tailwind imports in globals.css).