Skip to content

Walon-Foundation/deen-track

Repository files navigation

DeenTrack Protocol.

High-Fidelity Spiritual Operating System for the Modern Muslim.

Next.js React Tailwind CSS Drizzle ORM Clerk Auth Neon DB

DeenTrack is a professional-grade, privacy-first platform designed to help Muslims track their spiritual progress β€” from daily Salah to Quranic study, Hadith reflection, and personal journaling β€” through a premium, immersive interface.


πŸš€ Key Features

1. Command Center (Dashboard)

A responsive, analytics-first overview of your spiritual journey.

  • Activity Density Chart: Visualize your consistency over 7 days, 30 days, or a full year with live Recharts analytics.
  • Live Metrics: Real-time counters for Quranic verses read, Hadith studied, Supplications made, and Knowledge points earned.
  • Daily Discovery: A cached, rotating "Insight of the Day" card serving Quran, Hadith, or Dua β€” with Arabic, English, and transliteration.
  • Milestone Celebrations: Confetti animations and motivational modals when you hit daily entry milestones.

2. Salah Hub (Prayer Tracker)

A dedicated calendar-based system for tracking your five daily prayers.

  • Visual Calendar Grid: Month-by-month heatmap showing prayer consistency at a glance. Color-coded β€” green for Jamaah, blue for individual, rose for missed.
  • Detailed Day Modal: Click any day to see a full breakdown of Fajr, Dhuhr, Asr, Maghrib, and Isha statuses.
  • Sunnah & Night Prayers: Track Sunnah prayers, Witr, Tahajjud, and Nafl units alongside your Fardh.
  • Temporal Persistence Engine: LocalStorage-based daily draft system that auto-saves your prayer selections throughout the day and resets at midnight.
  • Upsert Sync: Database-level .onConflictDoUpdate() ensures one clean record per day, whether you log once or update throughout the day.
  • Smart Redirect: "Initialize Protocol" button in the modal deep-links to the Entry page with the Salah tab pre-selected.
  • Empty State Handling: Days without records display an "Absolute Absence" state with conditional actions (initialize only for today).

3. Unified Entry Portal

A streamlined, tabbed interface to log your daily deeds in seconds.

  • 5 Entry Categories: Quran, Hadith, Dua, Knowledge, and Salah β€” each with dedicated forms and validation.
  • Quran Logging: Select from all 114 Surahs, specify verse ranges, reading status, and language.
  • Hadith Logging: Log by scholar collection (with book counts for Bukhari, Muslim, Tirmidhi, etc.), book number, hadith number, and personal reflection.
  • Dua Logging: Categorized supplication tracking with count support.
  • Knowledge Logging: Free-form knowledge point entries with type classification, title, and notes.
  • Deep Link Support: URL query parameter ?tab=Salah (or any category) auto-selects the correct tab on page load.
  • Suspense Loading: Premium animated loading screen with orbiting rings and pulsing indicators during hydration.

4. Discovery Sanctuary (Public Hub)

A public workspace for multilingual spiritual discovery.

  • Bilingual Exploration: View Quran and Hadith in their original Arabic script, Transliteration, and English translation.
  • Direct-to-Log: Integrated "Save to My Journey" buttons that pre-populate your entry forms from discovered content.
  • Wisdom Sharing: Native Web Share API integration for instant sharing to social apps.

5. History Vault & Journal

Your complete spiritual archive, searchable and paginated.

  • Full History: Browse all logged entries across every category with infinite scroll pagination.
  • Journal View: Dedicated filtered view for personal journal/reflection entries.
  • Search: Real-time search across titles and content.

6. Privacy-First Protocol

Designed for deep personal reflection.

  • Strict Data Isolation: Every database row is procedurally scoped to the authenticated owner via Clerk user ID.
  • Encrypted Authentication: Powered by Clerk for world-class session security with webhook-based user sync.

πŸ›  Tech Stack & Architecture

Layer Technology Purpose
Framework Next.js 16 App Router, React 19, Server Components
Language TypeScript End-to-end type safety
Database Neon PostgreSQL Serverless Postgres
ORM Drizzle ORM v0.45 Type-safe queries, migrations, upserts
Auth Clerk Authentication, session management, webhooks
Styling Tailwind CSS 4 Utility-first responsive design
Animations Motion (Framer Motion) Premium micro-animations and transitions
Charts Recharts Activity density visualization
UI Components shadcn/ui + Radix UI Accessible, composable primitives
Validation Zod v4 Runtime schema validation for API inputs
Icons Lucide React 1000+ consistent SVG icons
Notifications Sonner Toast notifications
Linting Biome High-speed linting & formatting
Package Manager Bun / npm Fast dependency management

External APIs (Free, No API Key Required)

API Base URL Usage
AlQuran Cloud https://api.alquran.cloud/v1 Quranic verses β€” Arabic, English, transliteration, surah metadata
Hadith API https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1 Hadith collections β€” Bukhari, Muslim, Tirmidhi, and 20+ more

πŸ“ Project Structure

religion-tracker/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”‚   β”œβ”€β”€ prayers/       # GET: Fetch prayer history
β”‚   β”‚   β”‚   β”œβ”€β”€ stats/         # GET: Dashboard statistics & chart data
β”‚   β”‚   β”‚   └── vault/         # GET: Paginated history vault
β”‚   β”‚   β”œβ”€β”€ discovery/
β”‚   β”‚   β”‚   └── daily/         # GET: Random Quran/Hadith/Dua of the day
β”‚   β”‚   β”œβ”€β”€ entry/
β”‚   β”‚   β”‚   β”œβ”€β”€ dua/           # POST: Log dua entry
β”‚   β”‚   β”‚   β”œβ”€β”€ hadith/        # POST: Log hadith entry
β”‚   β”‚   β”‚   β”œβ”€β”€ knowledge/     # POST: Log knowledge entry
β”‚   β”‚   β”‚   β”œβ”€β”€ prayer/        # POST: Log/upsert daily prayer record
β”‚   β”‚   β”‚   └── quran/         # POST: Log quran entry
β”‚   β”‚   β”œβ”€β”€ journal/           # POST: Log journal entry
β”‚   β”‚   └── webhook/           # POST: Clerk webhook for user sync
β”‚   β”œβ”€β”€ dashboard/             # Dashboard page (Command Center)
β”‚   β”œβ”€β”€ discovery/             # Public discovery page
β”‚   β”œβ”€β”€ entry/                 # Entry portal (page + loading screen)
β”‚   β”œβ”€β”€ howitworks/            # How It Works page
β”‚   β”œβ”€β”€ privacy/               # Privacy policy page
β”‚   β”œβ”€β”€ sign-in/               # Clerk sign-in page
β”‚   β”œβ”€β”€ sign-up/               # Clerk sign-up page
β”‚   β”œβ”€β”€ layout.tsx             # Root layout (Clerk provider, fonts, Sonner)
β”‚   β”œβ”€β”€ page.tsx               # Landing page
β”‚   └── globals.css            # Global styles & Tailwind config
β”œβ”€β”€ components/ui/             # shadcn/ui components (Avatar, Button, Input, etc.)
β”œβ”€β”€ db/
β”‚   └── schema.ts              # Drizzle schema (users, quran, hadith, dua, knowledge, prayer, journal)
β”œβ”€β”€ lib/                       # Utilities (Clerk client, Drizzle client, cn helper)
β”œβ”€β”€ validators/                # Zod schemas for API input validation
β”œβ”€β”€ drizzle.config.ts          # Drizzle Kit configuration
β”œβ”€β”€ biome.json                 # Biome linting/formatting config
└── package.json

πŸ“¦ Getting Started

Prerequisites

  • Node.js (v20+) or Bun
  • A Clerk account for authentication
  • A Neon (or any PostgreSQL) database instance

1. Installation

git clone https://github.com/walon-foundation/deen-track.git
cd deen-track
bun install # or npm install

2. Environment Configuration

Create a .env file in the root directory:

# Database
DATABASE_URL=your_neon_postgres_url

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_publishable_key
CLERK_SECRET_KEY=your_secret_key
CLERK_WEBHOOK_SECRET=your_webhook_secret

# Optional: Override API base URLs (defaults are built-in)
QURAN_BASE_URL=https://api.alquran.cloud/v1
HADITH_BASE_URL=https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1

3. Initialize Database

npm run db:push    # Push schema to database
npm run db:studio  # Optional: Open Drizzle Studio to inspect data

4. Launch

npm run dev

Visit http://localhost:3000 β€” your spiritual command center awaits. πŸŒ™


πŸ§ͺ Available Scripts

Command Description
npm run dev Start development server
npm run build Production build
npm run start Start production server
npm run lint Run Biome linter
npm run format Auto-format code with Biome
npm run db:push Push Drizzle schema to database
npm run db:generate Generate Drizzle migrations
npm run db:migrate Run Drizzle migrations
npm run db:studio Open Drizzle Studio GUI

βš–οΈ License & Guidelines

  • License: Distributed under the MIT License. See LICENSE for details.
  • Security: For data privacy concerns or vulnerability reporting, see SECURITY.md.
  • Contribution: We welcome contributions from the community. See CONTRIBUTING.md to get started.

About

DeenTrack is a professional-grade, privacy-first platform designed to help Muslims track their spiritual progress, log daily reflections, and discover sacred wisdom through a high-contrast, immersive interface.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors