How sairam19062006/readme-activity-calender works
Project type and purpose
• This is a front-end-only, open-source widget library (“GitHub Repository Stats Widgets”) that runs entirely in the browser and visualizes real-time GitHub repo data via the GitHub REST API. There is no custom backend—just static assets and client-side logic.
Main components
a. Static File Server (e.g., GitHub Pages, Netlify, Vercel)
b. Client (Browser)
• index.html (UI skeleton)
• style.css (layout & styling)
• repo.js (fetches data from GitHub API)
• charts.js (renders interactive charts via Chart.js)
• Chart.js library (bundled or via CDN)
c. External Service
• GitHub REST API
Relationships & data flow
1) User’s Browser requests index.html, style.css, JS modules, assets from the Static File Server.
2) Browser parses HTML & CSS and loads repo.js and charts.js plus Chart.js.
3) repo.js issues asynchronous HTTPS calls to GitHub REST API to retrieve repo metadata (stars, forks, contributors, languages, etc.).
4) Data returned from GitHub API is passed into charts.js.
5) charts.js (using Chart.js) transforms data into interactive charts and injects them into the DOM.
6) UI updates accordingly; user interactions (e.g., entering a new repo name) trigger fresh API calls.
Architectural patterns & principles
• Pure client-side MVC-style separation:
• Model = GitHub data fetched in repo.js
• View = DOM templates in index.html + style.css
• Controller = charts.js + event handlers
• Asynchronous, event-driven data fetching (Promises / async-await)
• Single‐page widget embed pattern (self-contained HTML/CSS/JS)
a. Static File Server → Browser (label “serves index.html, style.css, repo.js, charts.js, assets”)
b. repo.js → GitHub REST API (label “fetch repo metadata”)
c. GitHub REST API → repo.js (label “JSON payload”)
d. repo.js → charts.js (label “pass data”)
e. charts.js → DOM/HTML (label “render charts”)