How booterman98/malla-interactiva works
Project type and purpose
• This is a client-side, static web application (a Progressive Web App) for visualizing and interacting with university course curricula (“mallas”).
• It serves JSON-driven data, renders interactive UIs in the browser, and persists user state locally.
• The app can be served via any static HTTP server (Python, Docker, GitHub Pages) and registers a service worker for offline support.
File structure overview
• Top-level:
• index.html, Dockerfile, serviceWorker.js, site.webmanifest
• css/: global and dark-mode styles
• js/: core modules (init.js, generator.js, malla.js, mallaEditor.js, priorix.js, ramo.js, selectableRamo.js, semesterManager.js, customMalla.js)
• data/: curricula JSON (data_CARR.json + colors_CARR.json) + welcome texts
• views/: HTML fragments (header.html, footer.html)
• personalizar/, prioridad/, contact/: feature-specific HTML entry points
• docs/, assets/: documentation and static assets
• scripts/: dev/build helper scripts
• .github/workflows/: CI/CD Docker build pipeline
• No server-side code: pure front end + static assets + CI for Docker image building.
Key architectural insights from README
• UI flows:
• Interactive map of courses by semester
• Prerequisite unlocking logic (js modules)
• Priority calculation widget
• Custom curricula editor
• Build & deployment: npm dev build, Python/Browser-sync or Docker image.
Main components
a. Client (Browser)
• HTML entry point(s) (index.html, personalizar/malla.html, prioridad/index.html, contact/index.html)
• CSS & Assets loader
• JavaScript modules (initialization, UI controllers, data fetchers, state managers)
• Service Worker (caching static files + offline support)
• Local storage (IndexedDB or localStorage) for persisting user modifications
b. Static HTTP Server
• Hosts HTML, CSS, JS, JSON, assets
• Can be any HTTP server (Python SimpleHTTPServer, Node/browser-sync, Docker Nginx)
c. Data Store (JSON files)
• Course definitions (data_CARR.json)
• welcomeTexts.json for dynamic greetings
d. CI/CD Pipeline & Containerization
• GitHub Actions workflow builds Docker image
• Dockerfile packages static site into a container (booterman/malla-interactiva)
• Deployment target (any container host, GitHub Pages, labcomp.cl)
Relationships & interactions
• Browser → HTTP Server: GET *.html, *.css, *.js, *.json
• JS modules parse JSON → render UI → update DOM
• UI actions → JS controllers → update in-memory state → persist to local storage
• Service Worker intercepts requests → serves from cache or network → caches new assets
• CI pipeline → builds Docker image → pushes/publishes container → end users pull & run container
Architectural patterns & design principles
• Modular JS: separation of concerns (init, data layer, UI layer, business logic)
• Client-side MVC/MVVM: models (JSON data + local state), views (HTML + templates), controllers (JS modules)
• Progressive Enhancement: offline support via service worker + caching
• Static site hosting: simplicity, no backend required
• Containerization for consistent deployment