A beautiful, offline-first Progressive Web App for Ramadhan prayer schedules
| Feature | Description | |
|---|---|---|
| π | Accurate Prayer Times | Powered by Aladhan API with Kemenag RI calculation method |
| π | GPS & Manual Location | Auto-detect via GPS or select from 500+ Indonesian regencies |
| π§ | Qibla Compass | Real-time compass with device orientation & magnetic calibration |
| π | Full Monthly Schedule | Complete Ramadhan timetable β Imsak, Subuh, Dzuhur, Ashar, Maghrib, Isya |
| β±οΈ | Live Countdown | Next prayer countdown timer on the home screen |
| π± | Installable PWA | Add to home screen for a native app experience |
| π | Offline-First | Works without internet after first visit |
| π¨ | Premium Dark Theme | Elegant teal & gold design with smooth animations |
| π’ | Multi-Organization | Supports Muhammadiyah (Hisab) and NU/Government (Rukyatul Hilal) |
- Node.js β₯ 18 (for production builds)
- Any static file server for local development
# Clone the repository
git clone https://github.com/aleafarrel/saturamadhan.git
cd saturamadhan
# Serve with any static server β for example:
npx serve .
# or
npx http-server .Open http://localhost:3000 (or whichever port) in your browser.
npm install # Install esbuild
npm run build # Generate dist/ folderThe build script bundles and minifies all assets:
| Asset | Before | After | Reduction |
|---|---|---|---|
| CSS (19 files β 1) | 71.3 KB | 49.8 KB | 30% |
| JS (10 modules β 1) | 188.6 KB | 70.7 KB | 63% |
| Total | 311.7 KB | 156.0 KB | 50% |
This project uses a dist branch for GitHub Pages deployment. The dist branch contains only the minified production build.
# 1. Build production assets
npm run build
# 2. Switch to dist branch (or create it)
git checkout dist
# 3. Copy dist/ contents to root and commit
cp -r dist/* .
git add .
git commit -m "Deploy v32"
git push origin dist
# 4. Switch back to main
git checkout mainIn your GitHub repository settings:
- Settings β Pages β Source: Deploy from branch
- Branch:
dist// (root)
saturamadhan/
βββ π index.html # Main HTML entry point
βββ βοΈ sw.js # Service Worker (offline caching)
βββ π manifest.json # PWA manifest
βββ π¦ package.json # Build dependencies
β
βββ π¨ assets/
β βββ css/
β β βββ style.css # CSS entry (imports all components)
β β βββ base/ # Variables, fonts, reset, typography
β β βββ layout/ # Container layout
β β βββ components/ # 15 modular component stylesheets
β βββ js/
β β βββ loader.js # Module loader with splash screen
β β βββ app.js # App coordinator & lifecycle
β β βββ main.js # UI controller & event handling
β β βββ modules/ # 8 feature modules (config, api,
β β # database, location, prayer,
β β # storage, ui, qibla)
β βββ favicon/ # App icon (WebP)
β βββ font/ # Poppins & Amiri typefaces
β βββ icon/ # Prayer time SVG icons + Kaaba
β βββ vendor/ # Boxicons library
β
βββ ποΈ database/
β βββ ramadhan.json # β Ramadhan dates (update yearly!)
β βββ province.json # 34 Indonesian provinces
β βββ regency.json # 500+ regencies with coordinates
β
βββ π§ scripts/
β βββ build.js # Production build script (esbuild)
β
βββ π€ dist/ # Production output (generated)
Important
This file must be updated every year before Ramadhan begins.
{
"tahunHijriah": 1447,
"tahunMasehi": 2026,
"tanggalSatuRamadhan": {
"muhammadiyah": "2026-02-18",
"nu": "2026-02-19"
}
}| Field | Description |
|---|---|
tahunHijriah |
Hijri year of the upcoming Ramadhan |
tahunMasehi |
Corresponding Gregorian year |
tanggalSatuRamadhan.muhammadiyah |
1st Ramadhan date per Muhammadiyah (Hisab) |
tanggalSatuRamadhan.nu |
1st Ramadhan date per NU / Government decision |
Dates must use YYYY-MM-DD format. After updating, rebuild and redeploy.
Caution
Since this is a PWA, the browser aggressively caches all assets via the Service Worker. You must bump the cache version on every deployment, or users will see stale content.
-
Increment version in
sw.js:- const CACHE_VERSION = 'v32'; + const CACHE_VERSION = 'v33';
-
Match version in
scripts/build.js:- "const CACHE_VERSION = 'v32-dist'" + "const CACHE_VERSION = 'v33-dist'"
-
Rebuild and deploy:
npm run build
| Strategy | Assets | Behavior |
|---|---|---|
| Cache-first | CSS, fonts, images, icons | Instant load from cache |
| Network-first | JS, HTML | Latest code from server, cache fallback |
| Stale-while-revalidate | API responses | Instant cached data + background refresh |
- No frameworks β Pure vanilla HTML, CSS, and JavaScript
- No server runtime β Fully static, hosted on GitHub Pages
- Modular CSS β 19 component files with CSS Custom Properties design system
- Modular JS β 10 self-contained modules loaded in sequence
- Build tool β esbuild for blazing-fast minification
Prayer times are fetched from the Aladhan Prayer Times API:
- Calculation Method: Kemenag RI (Method 20)
- Coordinates: User's GPS or manually selected regency
- Fallback: Multiple API mirrors for high availability
- Caching: GPS coordinates normalized to 4 decimal places (~11m) for optimal cache hit rate
Β© 2026 Satu Ramadhan β All rights reserved.
This project is proprietary software. Unauthorized copying, modification, distribution, or use of this software, via any medium, is strictly prohibited without explicit written permission from the author.
Built with β€οΈ for the Muslim community β Ramadhan Kareem!