How harshbang/pygpa-analyzer works
Project Type and Purpose
• This is a single-service, Python-based web application deployed via Streamlit Cloud.
• Purpose: Provide students with GPA calculators and planning tools through an interactive web UI.
File Structure
• Top level:
• .devcontainer/ – VS Code dev-container config (local development environment).
• app.py – Streamlit app entry point (UI + controller).
• source_code.py – Core GPA calculation logic (business model).
• requirements.txt – Dependency list (Pandas, Numpy, Streamlit).
• README.md, SECURITY.md – Documentation.
• No distinct frontend/backend folders: Streamlit serves both UI and server logic in one process.
Key Insights from README
• UI framework: Streamlit (handles user input forms, displays charts/tables).
• Business logic: Pandas + Numpy computations for SGPA, CGPA, goal matrices, planners.
• Deployment: Streamlit Cloud (managed hosting).
• No external database or persistent storage – all computations happen in-memory per session.
Main Components & Their Relationships
a. User (Web Browser)
b. Streamlit Web App (app.py)
– Receives HTTP requests via Streamlit server
– Renders forms, tables, matrices, charts
c. Calculation Engine (source_code.py)
– Encapsulates GPA formulas, matrix generator, planner logic
– Utilizes Pandas DataFrames and Numpy arrays
d. Dependency Layer
– Pandas, Numpy, Streamlit libraries
e. Deployment Host
– Streamlit Cloud (handles HTTPS endpoint, autoscaling, SSL)
f. Dev Environment (optional)
– Docker-based devcontainer for local testing
Relationships:
• The User interacts with the Streamlit Web App.
• Streamlit Web App invokes functions in the Calculation Engine.
• The Calculation Engine uses Pandas/Numpy to process data.
• Results flow back through the Streamlit Web App to the User.
• All components live in a single Python process on Streamlit Cloud.
Architectural Patterns & Design Principles
• MVC-style separation (UI in app.py, business logic in source_code.py).
• Stateless sessions: each user session starts fresh, no shared storage.
• Modular code: calculation logic decoupled from UI rendering.
• Cloud-native deployment: no server maintenance, leverages Streamlit Cloud.