Skip to content

karimogit/QuranLife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

76 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

QuranLife

Personal growth with Quran

QuranLife is a Progressive Web App (PWA) built with Next.js 14, TypeScript, and Tailwind CSS that combines personal development with Islamic guidance. Track your daily habits, set meaningful goals, and receive daily Quranic inspiration with intelligent verse matching.

✨ Features

πŸš€ Core Features

  • πŸ“Š Daily Habit Tracking: Track 5 daily prayers, Quran reading, and custom habits
  • πŸ“– Smart Quranic Guidance: Live API access to complete Quran with Arabic text, English translation, reflections, and practical guidance
  • 🎯 Intelligent Goal Management: Set and manage life goals with AI-powered verse matching from all 6,236 Quranic verses
  • πŸ“ˆ Progress Dashboard: Visual progress tracking with responsive two-column layout
  • πŸ’Ύ Secure Local Storage: All personal data stored safely in your browser with encryption
  • πŸ“€ Data Export: Export all your data as JSON for backup or transfer
  • πŸ“± PWA Support: Install as an app on your device with offline functionality

🧠 Smart Features

  • πŸ€– SmartGuidance AI: Click πŸ“– next to any goal for personalized Quranic guidance from live API
  • 🎯 Intelligent Verse Search: Real-time verse matching from the complete Quran using AlQuran.cloud API
  • πŸ“‹ Practical Action Steps: Each verse includes actionable spiritual and practical guidance
  • 🀲 Dua Recommendations: Suggested prayers (duas) for achieving your goals
  • πŸ”„ Related Habit Suggestions: Discover relevant Islamic practices for your goals
  • πŸ“€ Data Export: Simple one-click export of all your data for backup or transfer
  • ⚑ Smart Caching: Intelligent caching system for improved performance and offline support

🎨 Design & UX

  • 🌈 Consistent Green-Blue Theme: Islamic colors throughout the app
  • πŸ“± Responsive Design: Desktop two-column, mobile single-column layouts
  • ⚑ Smooth Animations: Framer Motion transitions for delightful interactions
  • 🎯 Clean Navigation: Simplified header and footer navigation
  • πŸŒ™ Accessibility: High contrast, readable fonts, semantic HTML

πŸ”’ Security & Privacy

  • πŸ›‘οΈ Content Security Policy: Advanced XSS protection
  • πŸ” Input Validation: All user inputs sanitized and validated
  • πŸ’Ύ Secure Storage: Safe localStorage operations with error handling
  • 🚫 No Tracking: Zero analytics, cookies, or user tracking
  • 🌐 Offline-First: Works completely offline after first load

πŸ—οΈ Tech Stack

  • Framework: Next.js 14 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS with custom green-blue theme
  • UI Components: ShadCN UI with Framer Motion animations
  • API Integration: AlQuran.cloud REST API for live Quranic data
  • PWA: Progressive Web App with service worker
  • Security: CSP headers, input validation, secure storage utilities
  • SEO: Complete meta tags, Open Graph, JSON-LD structured data
  • Deployment: Vercel-optimized with automatic builds

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm

Installation

  1. Clone the repository:
git clone https://github.com/KarimOsmanGH/QuranLife.git
cd quranlife
  1. Install dependencies:
pnpm install
  1. Run the development server:
pnpm dev
  1. Open http://localhost:3000 in your browser.

Building for Production

pnpm build
pnpm start

Security Audit

pnpm run security-audit
pnpm run security-fix  # Fix vulnerabilities
pnpm run type-check    # TypeScript validation

πŸ“ Project Structure

quranlife/
β”œβ”€β”€ app/                          # Next.js 14 App Router
β”‚   β”œβ”€β”€ page.tsx                 # Dashboard with responsive layout
β”‚   β”œβ”€β”€ habits/page.tsx          # Habits tracking (two-column desktop)
β”‚   β”œβ”€β”€ goals/page.tsx           # Goals with SmartGuidance (two-column desktop)
β”‚   β”œβ”€β”€ settings/page.tsx        # App settings and data management
β”‚   β”œβ”€β”€ privacy/page.tsx         # Privacy policy page
β”‚   β”œβ”€β”€ terms/page.tsx           # Terms of service page
β”‚   β”œβ”€β”€ layout.tsx               # Root layout with responsive navigation
β”‚   └── globals.css              # Global styles with custom CSS variables
β”œβ”€β”€ components/                   # Reusable UI components
β”‚   β”œβ”€β”€ DashboardCard.tsx        # Card wrapper with Framer Motion
β”‚   β”œβ”€β”€ HabitTracker.tsx         # Habit tracking with progress animations
β”‚   β”œβ”€β”€ VerseCard.tsx            # Quranic verse display with clean design
β”‚   β”œβ”€β”€ GoalsList.tsx            # Goals CRUD with edit/delete functionality
β”‚   └── SmartGuidance.tsx        # AI-powered Quranic guidance component
β”œβ”€β”€ lib/                         # Utilities and API integration
β”‚   β”œβ”€β”€ utils.ts                 # Tailwind class utilities
β”‚   β”œβ”€β”€ security.ts              # Secure storage and validation utilities
β”‚   β”œβ”€β”€ quran-api.ts             # AlQuran.cloud API service integration
β”‚   └── quran-engine.ts          # AI-powered verse matching and guidance engine
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── enhanced-quran.json  # Legacy data (now using live API)
β”‚   β”œβ”€β”€ icons/                   # PWA icons (192x192, 512x512)
β”‚   β”œβ”€β”€ favicon.svg              # Islamic-themed SVG favicon
β”‚   β”œβ”€β”€ manifest.json            # PWA manifest with proper config
β”‚   β”œβ”€β”€ sw.js                    # Service worker for offline functionality
β”‚   β”œβ”€β”€ sitemap.xml              # SEO sitemap
β”‚   └── robots.txt               # Search engine directives
└── Configuration files
    β”œβ”€β”€ next.config.js           # Next.js with security headers
    β”œβ”€β”€ tailwind.config.js       # Custom green-blue theme
    β”œβ”€β”€ vercel.json              # Vercel deployment config
    └── package.json             # Dependencies and scripts

πŸ“Š API Integration & Data Sources

AlQuran.cloud API Integration

QuranLife is powered by the exceptional AlQuran.cloud API - a free, open-source RESTful API providing comprehensive access to the Holy Quran.

What AlQuran.cloud Provides:

  • Complete Quran: Access to all 6,236 verses with authentic Arabic text
  • Multiple Translations: Including Muhammad Asad's scholarly translation
  • Multiple Arabic Scripts: Uthmani, Simple, and other authentic scripts
  • Audio Support: Multiple recitations with high-quality audio files
  • Free & Open: Educational and religious use encouraged, no authentication required
  • REST API: Simple, reliable HTTP API with comprehensive documentation
  • Community-Driven: Actively maintained and continuously improved

API Service Structure (lib/quran-api.ts):

interface Verse {
  number: number;
  text: string;
  numberInSurah: number;
  juz: number;
  page: number;
  translation?: string;
  audio?: string;
}

interface RandomVerseResponse {
  verse: Verse;
  surah: Surah;
  theme?: string;
  context?: string;
}

// Core API methods
- getSurah(surahNumber): Get complete Surah with translations
- getVerse(surahNumber, verseNumber): Get specific verse with audio
- getRandomVerse(): Intelligent random verse selection
- searchVerses(query): Search across all verses
- getAllSurahs(): Get Surah metadata
- getVerseAudio(surahNumber, verseNumber): Get audio recitation URLs

Enhanced QuranEngine (lib/quran-engine.ts):

// AI-powered features built on top of the API
- getDailyVerse(): Smart daily verse recommendation
- findVersesForGoal(goal): Match goals with relevant verses
- getThematicCollection(theme): Curated verse collections
- getSmartRecommendation(userGoals, habits): Personalized guidance

Our Enhancement Layer:

QuranLife builds intelligent features on top of AlQuran.cloud's robust foundation:

  • 🎯 Smart Goal Matching: AI-powered verse recommendations based on personal goals
  • 🧠 Intelligent Search: Enhanced verse discovery beyond simple text matching
  • πŸ“‹ Practical Guidance: Each verse enriched with actionable spiritual steps
  • 🀲 Dua Integration: Connected prayers and supplications for deeper practice
  • 🎡 Audio Integration: Seamless verse recitation with mobile-optimized playback
  • ⚑ Performance Optimization: Smart caching and offline fallbacks
  • 🎨 Beautiful UI: Clean, Islamic-themed interface for better user experience

Caching & Performance:

  • Intelligent 5-minute cache for frequently accessed verses
  • Fallback verses for offline scenarios
  • Rate limiting and error handling
  • Optimized API calls to reduce latency

Translation & Audio Sources

English Translation: Muhammad Asad's "The Message of the Qur'an", known for its scholarly approach and comprehensive commentary, providing contextual understanding for modern readers.

Audio Recitations: High-quality recitations from AlQuran.cloud's audio collection, featuring renowned Qari recitations with mobile-optimized playback.

For Comprehensive Quranic Study

While QuranLife focuses on practical spiritual development, for complete Quranic study we recommend:

  • AlQuran.cloud - The API that powers our app
  • Quran.com - Comprehensive online Quran platform
  • Tanzil.net - Various Quranic texts and translations
  • Qualified Islamic Scholars - For proper interpretation and guidance
  • Local Islamic Centers - For community learning and support

Open Source Appreciation

We're grateful to the AlQuran.cloud team for providing this invaluable service to the global Muslim community. Their commitment to making Quranic content freely accessible enables projects like QuranLife to focus on innovative applications while building on solid, authentic foundations.

Data Interfaces

Habits Interface

interface Habit {
  id: string;
  name: string;
  completed: boolean;
  frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
  lastCompleted?: string;
  streak: number;
  completionHistory: Record<string, boolean>;
  icon?: string;
}

Goals Interface

interface Goal {
  id: string;
  title: string;
  description?: string;
  completed: boolean;
  category: string;
  priority: 'low' | 'medium' | 'high';
  dueDate?: string;
}

πŸš€ Deployment

Live Demo

Vercel (Recommended)

  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Deploy with default settings

The app is configured with:

  • Automatic builds on push
  • PWA manifest serving
  • Static file optimization
  • Security headers
  • SEO optimization

Other Platforms

The app can be deployed on any platform that supports Next.js:

  • Netlify
  • Railway
  • DigitalOcean App Platform
  • AWS Amplify

πŸ”’ Security & Privacy

QuranLife is built with security and privacy as top priorities:

πŸ›‘οΈ Security Features

  • Content Security Policy (CSP): Prevents XSS attacks and code injection
  • Input Validation: All user inputs are sanitized and validated using secure utilities
  • Safe Storage: Secure localStorage operations with error handling (lib/security.ts)
  • Rate Limiting: API calls are rate-limited to prevent abuse
  • Security Headers: X-Frame-Options, X-Content-Type-Options, Referrer-Policy
  • No External Dependencies: All data stays on your device

πŸ›‘οΈ Privacy Protection

  • Local-Only Storage: No data sent to external servers
  • No Tracking: No analytics, cookies, or user tracking
  • No Authentication: No personal information required
  • Offline-First: Works completely offline after first load
  • Zero Data Collection: We don't collect, store, or process any personal data

πŸ” Security Audit

  • βœ… No critical vulnerabilities (npm audit clean)
  • βœ… Dependencies regularly updated
  • βœ… TypeScript for type safety
  • βœ… Input sanitization implemented
  • βœ… Error handling throughout
  • βœ… Secure storage utilities
  • βœ… CSP headers configured

πŸ“š Data Sources & Acknowledgments

AlQuran.cloud API

QuranLife is powered by the exceptional AlQuran.cloud API - a free, open-source RESTful API providing comprehensive access to the Holy Quran.

What AlQuran.cloud Provides:

  • Complete Quran: Access to all 6,236 verses with authentic Arabic text
  • Multiple Translations: Including Muhammad Asad's scholarly translation
  • Multiple Arabic Scripts: Uthmani, Simple, and other authentic scripts
  • Audio Support: Multiple recitations with high-quality audio files
  • Free & Open: Educational and religious use encouraged, no authentication required
  • REST API: Simple, reliable HTTP API with comprehensive documentation
  • Community-Driven: Actively maintained and continuously improved

API Service Structure (lib/quran-api.ts):

interface Verse {
  number: number;
  text: string;
  numberInSurah: number;
  juz: number;
  page: number;
  translation?: string;
  audio?: string;
}

interface RandomVerseResponse {
  verse: Verse;
  surah: Surah;
  theme?: string;
  context?: string;
}

// Core API methods
- getSurah(surahNumber): Get complete Surah with translations
- getVerse(surahNumber, verseNumber): Get specific verse with audio
- getRandomVerse(): Intelligent random verse selection
- searchVerses(query): Search across all verses
- getAllSurahs(): Get Surah metadata
- getVerseAudio(surahNumber, verseNumber): Get audio recitation URLs

Enhanced QuranEngine (lib/quran-engine.ts):

// AI-powered features built on top of the API
- getDailyVerse(): Smart daily verse recommendation
- findVersesForGoal(goal): Match goals with relevant verses
- getThematicCollection(theme): Curated verse collections
- getSmartRecommendation(userGoals, habits): Personalized guidance

Our Enhancement Layer:

QuranLife builds intelligent features on top of AlQuran.cloud's robust foundation:

  • 🎯 Smart Goal Matching: AI-powered verse recommendations based on personal goals
  • 🧠 Intelligent Search: Enhanced verse discovery beyond simple text matching
  • πŸ“‹ Practical Guidance: Each verse enriched with actionable spiritual steps
  • 🀲 Dua Integration: Connected prayers and supplications for deeper practice
  • 🎡 Audio Integration: Seamless verse recitation with mobile-optimized playback
  • ⚑ Performance Optimization: Smart caching and offline fallbacks
  • 🎨 Beautiful UI: Clean, Islamic-themed interface for better user experience

Caching & Performance:

  • Intelligent 5-minute cache for frequently accessed verses
  • Fallback verses for offline scenarios
  • Rate limiting and error handling
  • Optimized API calls to reduce latency

Translation & Audio Sources

English Translation: Muhammad Asad's "The Message of the Qur'an", known for its scholarly approach and comprehensive commentary, providing contextual understanding for modern readers.

Audio Recitations: High-quality recitations from AlQuran.cloud's audio collection, featuring renowned Qari recitations with mobile-optimized playback.

For Comprehensive Quranic Study

While QuranLife focuses on practical spiritual development, for complete Quranic study we recommend:

  • AlQuran.cloud - The API that powers our app
  • Quran.com - Comprehensive online Quran platform
  • Tanzil.net - Various Quranic texts and translations
  • Qualified Islamic Scholars - For proper interpretation and guidance
  • Local Islamic Centers - For community learning and support

Open Source Appreciation

We're grateful to the AlQuran.cloud team for providing this invaluable service to the global Muslim community. Their commitment to making Quranic content freely accessible enables projects like QuranLife to focus on innovative applications while building on solid, authentic foundations.

Data Interfaces

Habits Interface

interface Habit {
  id: string;
  name: string;
  completed: boolean;
  frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
  lastCompleted?: string;
  streak: number;
  completionHistory: Record<string, boolean>;
  icon?: string;
}

Goals Interface

interface Goal {
  id: string;
  title: string;
  description?: string;
  completed: boolean;
  category: string;
  priority: 'low' | 'medium' | 'high';
  dueDate?: string;
}

πŸ•Œ Islamic Principles

This app is built with Islamic values in mind:

  • Intention (Niyyah): Every feature encourages sincere intention
  • Consistency: Small, consistent actions over sporadic efforts
  • Balance: Focus on both worldly life (dunya) and hereafter (akhirah)
  • Trust in Allah (Tawakkul): Plan and work, then trust in Allah's decree
  • Gratitude: Daily reflection and appreciation
  • Privacy: Respects user privacy as an Islamic principle
  • Knowledge: Integration of Quranic wisdom with practical action

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

πŸš€ Future Enhancements

  • πŸ“… Advanced Calendar Integration: Google/Outlook sync for prayer times
  • ☁️ Cloud Sync: Optional Supabase/Firebase integration
  • πŸ“Š Advanced Analytics: Streak tracking and habit insights
  • πŸ‘₯ Community Features: Share goals and achievements (with privacy)
  • 🌍 Multiple Languages: Arabic, Urdu, Turkish, French support
  • πŸ”” Smart Notifications: Prayer time reminders and goal nudges
  • 🎯 Advanced Goal Templates: Pre-built Islamic development paths

πŸ‘¨β€πŸ’» Author & License

Created by: Karim Osman

MIT License - feel free to use this project for personal or commercial purposes.

🀲 Duas for Success

"Rabbana atina fi'd-dunya hasanatan wa fi'l-akhirati hasanatan wa qina 'adhab an-nar"

Our Lord, give us good in this world and good in the hereafter, and save us from the punishment of the Fire.


Personal growth with Quran πŸŒ±πŸ“–βœ¨

May Allah accept your efforts and make this app a means of drawing closer to Him. 🀲

About

Quranic advise on your goals.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors