Ramadan Tracker
A responsive web application for tracking Sehri (Suhoor) and Iftar times during Ramadan with multi-fiqh support, Qibla direction, and PWA capabilities.
About the Project
A responsive web application for tracking Sehri (Suhoor) and Iftar times during Ramadan with multi-fiqh support, Qibla direction, and PWA capabilities.
⨠Features
ð Core Features
- Dynamic Countdown Timer for Sehri (Fajr) and Iftar (Maghrib)
- Real-time updates that reset daily
- Multi-Fiqh Support: Hanafi, Shafi/Maliki/Hanbali, and Jaffari (Shia)
ð Calculation Methods
- Muslim World League (MWL)
- University of Islamic Sciences, Karachi
- Umm al-Qura University, Makkah
- Islamic Society of North America (ISNA)
ð Location Features
- Auto-detect location using browser Geolocation API
- Manual location selection with Country/City dropdowns
- Custom coordinates input for precise location
- Timezone handling with auto-detection or manual selection
ð Date Display
- Hijri date with automatic conversion
- Ramadan day highlight when in Ramadan month
- Gregorian date for reference
ð§ Qibla Direction
- Compass display with direction indicator
- Distance to Kaaba in kilometers
- Compass direction (N, NE, E, etc.)
ð± PWA Support
- Installable on mobile and desktop
- Offline support with service worker
- Push notifications for Sehri and Iftar reminders
ð Multi-Language
- English
- ارد٠(Urdu)
- Ø§ÙØ¹Ø±Ø¨ÙØ© (Arabic)
𤲠Duas Section
Authentic duas with Arabic text, transliteration, and translation:
- Iftar Dua 1 (Sunan Abi Dawud 2358)
- Iftar Dua 2 (Sunan Abi Dawud 2357)
- Sehri Intention (with scholarly note)
ð ï¸ Tech Stack
- Backend: FastAPI (Python)
- Frontend: Vanilla JavaScript, HTML5, CSS3
- Styling: Custom CSS with CSS Variables
- Prayer Times API: AlAdhan API
- Location: Browser Geolocation API
- State Management: LocalStorage
ð Prerequisites
- Python 3.8+
- pip (Python package manager)
ð Installation & Deployment
Local Development
-
Clone the repository
git clone https://github.com/RasikhAli/Ramadan-Tracker.git cd Ramadan-Tracker -
Create virtual environment
python -m venv venv # Windows venv\Scripts\activate # Linux/Mac source venv/bin/activate -
Install dependencies
pip install -r requirements.txt -
Run the application
python run.py -
Open in browser
http://localhost:8000
Production Deployment
Option 1: Using Gunicorn (Linux/Mac)
pip install gunicorn gunicorn -w 4 -k uvicorn.workers.UvicornWorker app.main:app --bind 0.0.0.0:8000
Option 2: Using Uvicorn
pip install uvicorn[standard] uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
Option 3: Docker
-
Create Dockerfile
FROM python:3.11-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] -
Build and run
docker build -t ramadan-countdown . docker run -p 8000:8000 ramadan-countdown
Option 4: Deploy to Cloud
Heroku:
# Create Procfile echo "web: uvicorn app.main:app --host 0.0.0.0 --port $PORT" > Procfile # Deploy heroku create your-app-name git push heroku main
Railway/Render:
- Connect your GitHub repository
- Set build command:
pip install -r requirements.txt - Set start command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
ð Project Structure
ramadan-web/
âââ app/
â âââ __init__.py
â âââ main.py # FastAPI application and routes
â âââ templates/
â â âââ index.html # Main HTML template
â âââ static/
â â âââ manifest.json # PWA manifest
â â âââ sw.js # Service worker
â â âââ icons/
â â âââ icon.svg # App icon
â âââ services/
â â âââ __init__.py
â â âââ city_service.py # City data operations
â â âââ prayer_service.py # Prayer time fetching
â â âââ fiqh_service.py # Fiqh calculations
â â âââ countdown_service.py # Countdown logic
â âââ data/
â âââ cities.py # City data module
âââ data/
â âââ cities.json # City coordinates and timezones
â âââ countries.json # Country data
âââ tests/
â âââ test_prayer_service.py
âââ scripts/
â âââ import_cities.py # City data import script
âââ requirements.txt
âââ run.py
âââ README.md
ð API Endpoints
Location Detection
GET /api/detect-location- Detect location from timezoneGET /api/detect-location-from-coords- Detect from coordinates
City Data
GET /api/countries- List all countriesGET /api/cities/{country}- Get cities for a countryGET /api/city-data- Get city coordinatesGET /api/search-city- Search for a city
Prayer Times
GET /api/prayer-times- Get prayer times for a cityGET /api/prayer-times-all- Get times for all fiqh methodsGET /api/prayer-times-by-coords- Get times by coordinates
Other
GET /api/hijri-date- Get Hijri dateGET /api/qibla- Get Qibla directionGET /api/fiqh-methods- Get fiqh method infoGET /api/health- Health check
𧪠Testing
# Run tests pytest tests/ # Run with coverage pytest --cov=app tests/
ð Configuration
Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| PORT | Server port | 8000 |
| HOST | Server host | 0.0.0.0 |
Customization
- Add more cities: Edit
data/cities.jsonor usescripts/import_cities.py - Modify calculation methods: Edit
app/services/fiqh_service.py - Change theme colors: Edit CSS variables in
app/templates/index.html
ð¤ Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
ð License
This project is open source and available under the MIT License.
ð Acknowledgments
- AlAdhan API for prayer time calculations
- GeoNames for city data
- All contributors and testers
ð Support
For issues and feature requests, please use the GitHub Issues page.
Developed with â¤ï¸ by Rasikh Ali
Project Gallery
Project Timeline
Technologies
External Links
Related Projects
Projects built with similar technologies.
Online Html Editor And Viewer
The Online HTML Editor and Viewer is a simple web application built with Flask that allows users to write and preview HTML code in real-time.
Qrgen
A premium, feature-rich QR Code Generator engineered with Python (Flask) and a pristine Glassmorphism frontend.
Examina Ai
Using AI, It transforms raw study materials into structured, verified examination sets with support for institutional export formats like Moodle XML.