Skip to content

aleafarrel-id/saturamadhan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Satu Ramadhan

Satu Ramadhan

A beautiful, offline-first Progressive Web App for Ramadhan prayer schedules

PWA JavaScript

HTML5 CSS3 esbuild GitHub Pages Aladhan API License


✨ Features

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)

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 18 (for production builds)
  • Any static file server for local development

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.

Production Build

npm install        # Install esbuild
npm run build      # Generate dist/ folder

The 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%

🌐 Deployment (GitHub Pages)

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 main

In your GitHub repository settings:

  • Settings β†’ Pages β†’ Source: Deploy from branch
  • Branch: dist / / (root)

πŸ“ Project Structure

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)

πŸ”§ Configuration

πŸŒ™ Ramadhan Dates β€” database/ramadhan.json

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.


πŸ”„ Cache Versioning

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.

Steps to Update

  1. Increment version in sw.js:

    - const CACHE_VERSION = 'v32';
    + const CACHE_VERSION = 'v33';
  2. Match version in scripts/build.js:

    - "const CACHE_VERSION = 'v32-dist'"
    + "const CACHE_VERSION = 'v33-dist'"
  3. Rebuild and deploy:

    npm run build

Caching Strategies

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

πŸ› οΈ Tech Stack

HTML5 CSS3 JavaScript esbuild GitHub Pages

  • 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

🀲 API

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

πŸ“œ Copyright

Β© 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!

About

An offline-first, client-side PWA engineered for accurate Ramadan scheduling across Indonesia. It features interactive countdowns and guarantees precision by utilizing official calculation methods from Kemenag RI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors