How yuvii-b/gpa-calc works
Project type and purpose
• Type: Client-side static web application
• Purpose: Let students compute Semester GPA (SGPA) and Cumulative GPA (CGPA) entirely in the browser using HTML, CSS, and JavaScript
File structure
• Top-level files:
– index.html: Landing/home page
– sgpa.html & sgpa.js: SGPA calculation page and its script
– cgpa.html & cgpa.js: CGPA calculation page and its script
– style.css: Shared stylesheet
– LICENSE, README.md: Meta documentation
• No server-side code, databases, or external services
• All computation happens client-side via JavaScript
README for additional insights
• Confirms tool is purely front-end
• No dependencies beyond vanilla HTML/CSS/JS
a. Main components:
1. User’s Web Browser (Client)
2. Static File Server (could be GitHub Pages, any HTTP server)
3. Static assets:
– HTML pages (index.html, sgpa.html, cgpa.html)
– JavaScript modules (sgpa.js, cgpa.js)
– CSS (style.css)
b. Relationships & interactions:
• Browser “→” Server: HTTP GET requests for HTML, CSS, JS
• Server “→” Browser: Serves static files
• Browser internal flow:
– User navigates to index.html / sgpa.html / cgpa.html
– Browser loads style.css for UI styling
– Browser executes sgpa.js or cgpa.js for calculations
– JS reads form input, computes GPA, updates DOM
c. Architectural patterns / principles:
• Static asset hosting (no backend)
• Client-side MVC notion:
– View: HTML + CSS
– Controller/Model: JavaScript functions in sgpa.js / cgpa.js
d. Key technologies:
• HTML5 for structure
• CSS for styling
• Vanilla JavaScript for business logic
Detailed breakdown
Layer 1: Client/Server boundary
[User’s Browser] ←── HTTP GET /index.html, /sgpa.html, /cgpa.html ──→ [Static File Server]
[User’s Browser] ←── style.css ──→
[User’s Browser] ←── sgpa.js / cgpa.js ──→
(HTML + CSS UI)
↑
| “include”
↓
(JavaScript logic: sgpa.js / cgpa.js)
↑
| “reads form fields”
| “computes GPA”
↓
(DOM update: show result)