How macalistair1/nepalipulse works
Project type and purpose
• Nepali Pulse is a static, mobile-friendly web application (front-end only) that aggregates real-time data on fuel prices, share market trends, music videos, gold/silver rates, currency exchange, bank interest rates, social hashtags, and date conversion.
• There is no custom backend in this repository; all data is fetched at runtime from external public APIs.
File structure
• Top-level HTML pages (bank.html, oil.html, earthquake.html, etc.) each correspond to a feature/view.
• Common assets and utilities:
• index.html: main navigation shell (mobile-frame UI)
• styles.css, calendar.css: global and feature CSS
• common.js, script.js: shared JavaScript functions and routing logic
• feature-specific JS files (oil.js, banks.js, date-convert.js, etc.) implement data fetch & DOM updates
• No server-side code, build scripts, or configuration files beyond static assets.
README for insights
• Describes each feature, usage, and technology stack: HTML5, CSS3, vanilla JS.
• Mentions mobile frame background for an “app-like” UI.
• Hosts via GitHub Pages (static site).
a. Main components
• User’s Browser (Mobile-sized viewport)
• Front-End Static Host (e.g., GitHub Pages/CDN)
• Static Assets: HTML, CSS, JS, Images
• External Data Providers/APIs:
– Nepal Oil Corporation API
– Share Market Data API
– YouTube Data API (top music videos)
– Metals Price API (gold, silver)
– Currency Exchange API
– Bank Rates API
– Social Media Trending Hashtags API
– (Date conversion uses local library; no external call)
b. Relationships & data flow
1. Browser requests HTML/CSS/JS from Static Host
2. Browser loads index.html → common.js → renders navigation frame
3. User selects a feature → feature-specific HTML/JS loaded or routed
4. Feature JS makes HTTP(S) requests to external API
5. API responds with JSON → JS parses and updates the DOM
c. Architectural patterns & design principles
• Static Multi-Page Application with shared utilities (common.js)
• Separation of concerns: each feature has its own HTML/JS pair plus shared styling
• Client-side rendering of data via asynchronous HTTP calls
• Reuse of assets and common modules to minimize duplication
d. Key technologies/frameworks
• HTML5, CSS3
• Vanilla JavaScript (ES6 modules or IIFE pattern)
• Fetch API / XMLHttpRequest for REST calls
• JSON as the data interchange format
• Hosting via GitHub Pages (or any static site CDN)