How chandy-bit/mathsim-platform works
1. Repository shape
- This is a static educational web platform centered on math learning and simulation experiences.
- The main entry points are a set of standalone HTML pages (index.html, subject pages, dashboard, games, docs, policies) backed by shared CSS and JavaScript.
- There is no obvious backend application in the tree; the only server-side artifact is header.php, which suggests optional server-side reuse of shared page chrome.
2. Core presentation layer
- The UI is split across many HTML pages rather than a single SPA.
- Pages are organized by purpose: learning content (algebra.html, calculus.html, geometry.html, probability.html, precalculus.html), interactive experiences (game.html, simulation.html, planner.html, prototype.html), dashboards (analytic-dashboard.html, progress.html, leaderboard.html), and supporting/legal pages (privacy.html, terms.html, consent.html, etc.).
- This suggests a multi-page application architecture with shared assets rather than route-driven client-side navigation.
3. Shared shell and navigation
- header.php likely provides reusable header/navigation markup across pages.
- Shared layout and theme styling live in css/style.css, with feature-specific styles such as css/consent.css and css/upgrade.css.
- The architecture likely relies on a common site shell plus page-specific content sections.
4. Learning content subsystem
- Subject-specific scripts (js/algebra.js, js/calculus.js, js/geometry.js, js/probability.js) indicate dedicated logic per math domain.
- js/practice-questions.js, js/tutorials.js, js/solution-panel.js, and js/plotter.js suggest the platform mixes explanatory content with interactive practice and visual feedback.
- This subsystem is the main pedagogical layer: it appears to render exercises, hints, explanations, and visualizations within the subject pages.
5. Simulation and game engine
- The simulation stack is more structured and separated from the subject pages: js/simulation-core.js, js/simulation-types.js, js/simulation.js, js/game.js, and js/animations.js.
- This implies a reusable runtime for interactive simulations/games, with scenario-specific behavior defined by “types” and shared execution handled by the core.
- Pages such as simulation.html, game.html, and algebra-game.html likely mount this engine with different content or rules.
6. Progress, analytics, and leaderboard flow
- js/progress.js, js/analytics.js, js/dashboard.js, and js/leaderboard.js indicate client-side tracking and visualization of learner activity.
- progress.html, analytic-dashboard.html, and leaderboard.html are the visible surfaces for this subsystem.
- The architectural boundary here is important: user interaction data is captured in the browser, then surfaced in dashboards/leaderboards, likely with local storage or remote telemetry depending on deployment.
7. Platform services and runtime features
- js/pwa.js and js/service-worker.js indicate Progressive Web App support, likely for offline availability and installability.
- offline.html is the fallback/offline experience, which is typically served when network access is unavailable.
- manifest.json defines app metadata for installation, icons, and startup behavior.
8. Cross-cutting client features
- js/theme.js, js/language.js, js/accessibility.js, js/upgrade.js, and js/animations.js are cross-cutting modules affecting many pages.
- These likely handle theme switching, localization, accessibility enhancements, UI polish, and feature gating or upgrade messaging.
- js/main.js and js/modulesloader.js appear to coordinate shared initialization and page-specific script loading.
9. Content, assets, and compliance boundary
- Static assets live under assets/ and css/, with images/icons and a consent PDF.
- The repository includes policy and consent pages (privacy.html, terms.html, consent.html) plus a consent-form.pdf, which suggests attention to user consent and compliance flows.
- These pages are part of the public-facing content boundary, separate from interactive learning features.
10. Information architecture and documentation
- Supporting pages such as about.html, contact.html, faq.html, docs.html, user-manual.html, tutorial.html, changelog.html, and system-diagram.html indicate a documentation-heavy product.
- sitemap.xml and robots.txt show standard web publishing/SEO support.
- The presence of survey.html and feedback.html suggests direct user input channels, though no backend is visible in the tree.
11. Likely deployment model
- The repo looks designed to be deployed as a static site or static-first web app, possibly on a host that can optionally render PHP for shared headers.
- Client-side JavaScript appears to do most of the work: interactivity, simulation runtime, analytics dashboards, PWA/offline behavior, and UI state management.
- Any persistent state beyond the file system is not visible here, so diagramming should treat storage as browser-side or external/implicit rather than repo-defined.
12. How to draw the architecture
- At the center, show a browser-based multi-page learning platform.
- Surround it with shared client modules for learning content, simulation/game runtime, progress/analytics, and platform services like PWA/offline/theme/accessibility.
- Connect all HTML pages to the shared CSS/JS layer, with subject pages feeding the learning engine, and dashboard/progress pages consuming tracked user activity.
- Show static hosting as the main delivery mechanism, with header.php as an optional shared template boundary if server-side includes are used.
Main entry points: modulesloader.js Module loader · main.js App init · header.php Header · style.css Base styles
Components 20
Presentation pages
Static multi-page front end for learning, docs, and policies
- Home · Main landing page for the platform
index.html - Subjects · Core math learning pages for different domains
- Interactive · Pages for games, simulations, planners, and prototypes
- Docs & policy · Documentation, help, feedback, and legal pages
Learning engine
Subject content and practice UI
- Learning modules · Math-specific logic, questions, tutorials, and solution UI
- Plotter · Graphing and visual feedback utilities
js/plotter.js
Simulation runtime
Reusable interactive simulation and game execution
- Sim core · Shared execution engine for simulations and games
js/simulation-core.js - Sim types · Definitions for simulation variants and behaviors
js/simulation-types.js - Game logic · Game-specific orchestration built on the simulation stack
js/game.js
Insights
Progress, analytics, and leaderboard surfaces
- Dashboards · Pages that surface progress, analytics, and rankings
- Tracking · Progress, analytics, dashboard, and leaderboard logic
Platform services
Shared chrome, theme, PWA, and cross-cutting client features
- Header · Optional server-side reusable page chrome
header.php - Base styles · Global visual theme and layout rules
css/style.css - Page styles · Feature-specific styling for consent and upgrade flows
- App init · Shared initialization and page startup coordination
js/main.js - Module loader · Loads page-specific scripts and shared modules
js/modulesloader.js - Platform features · Theme, language, accessibility, upgrade, animation, and PWA features
- Service worker · Offline caching and web app runtime support
js/service-worker.js - Manifest · Installable app metadata and startup configuration
manifest.json - Offline · Fallback experience when the network is unavailable
offline.html
Connections 32
- Home → Base styles: uses
- Home → App init: boots
- Subjects → Base styles: uses
- Subjects → App init: boots
- Interactive → Base styles: uses
- Interactive → App init: boots
- Dashboards → Base styles: uses
- Dashboards → App init: boots
- Docs & policy → Base styles: uses
- Docs & policy → App init: boots
- Header → Home: shared chrome
- Header → Subjects: shared chrome
- Header → Interactive: shared chrome
- Header → Dashboards: shared chrome
- Header → Docs & policy: shared chrome
- App init → Module loader: delegates
- Module loader → Learning modules: loads
- Module loader → Sim core: loads
- Module loader → Game logic: loads
- Module loader → Tracking: loads
- Module loader → Platform features: loads
- Learning modules → Plotter: visualizes
- Learning modules → Subjects: powers
- Sim core → Sim types: configures
- Sim core → Interactive: powers
- Game logic → Sim core: extends
- Tracking → Dashboards: powers
- Platform features → Base styles: coordinates
- Service worker → Offline: falls back to
- Service worker → Manifest: supports
- Platform features → Service worker: registers
- Platform features → Manifest: supports