How karunakarthurlu/githubprofiletracker works
Project type and purpose
• This is a single-page, front-end React application (“GitHub Profile Tracker”) that consumes the public GitHub REST API to display user profiles, repositories, followers, and language analytics.
• It’s built with React.js, styled with Material-UI, bundled with Vite, and deployed (via GitHub Actions) as a static site (GitHub Pages).
File structure
• Top-level config/build/deploy:
• vite.config.js (Vite build config)
• .github/workflows/deploy.yml (CI/CD to publish to GitHub Pages)
• package.json / package-lock.json
• Public assets: /public, index.html, 404.html
• Source code under /src:
• /components: reusable UI components (AppHeader, SideMenu, SearchField, ReposTable, UserCard, UserProfile)
• /pages: route-level views (Dashboard, CustomDashboard, Profile, Followers, Following, Repositories)
• /context: global state via React Context & Reducer (UserContext, UserReducer, UserActions, UserState)
• /services: API wrapper (GitHubAPI.js)
• /utils: helper utilities (ChartUtil, Notifier, Spinner, ThemeContext, NotFound, ContextStateUtils)
• entry point main.jsx + root App.jsx + styling (App.css, index.css)
README for additional insights
• Confirms key features: profile dashboard, followers page, language breakdown, user-friendly UI.
• Tech stack: React.js front end + GitHub REST API + Material-UI.
Key components
a. Browser/Client
– The user’s browser loads the static React SPA from GitHub Pages (CDN).
b. Static Host & CI/CD
– GitHub Actions workflow builds via Vite → publishes files to GitHub Pages.
c. React Application
– Entry Point (index.html → main.jsx → App.jsx)
– Routing layer (pages under /pages)
– UI Components (/components)
– Global State (React Context: UserContext + Reducer + Actions)
– Services Layer (GitHubAPI service for HTTP requests)
– Utilities (ChartUtil for graphs, Spinner/Notifier for UX, ThemeContext)
d. External Service
– GitHub REST API (OAuth or public endpoints)
Relationships & data flow
• On load, AppHeader and SideMenu render and the Router selects a page under /pages.
• Pages dispatch actions (via UserActions) to fetch data through GitHubAPI (services).
• GitHubAPI calls → REST API → returns JSON → passes to UserReducer to update UserContext.
• Components (e.g., ReposTable, UserCard, ChartUtil) subscribe to UserContext to render UI.
• Utilities (Spinner, Notifier) show loading or error states.
• ThemeContext wraps the whole tree to provide theming.
Architectural patterns & design principles
• Separation of concerns: UI ↔ State ↔ API
• Container/Presentational pattern: pages act as containers, components as presentational units.
• Flux-style state management via Context + Reducer.
• Layered architecture: presentation (components/pages) → service (API) → external API.