Skip to content

About

Sadaqah Box helps Muslims track their charitable contributions (Sadaqah) in a modern, secure, and private way. The app converts all donations to gold grams for consistent tracking across different currencies, making it easy to see your total giving regardless of the currency used.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

71 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sadaqah Box

Sadaqah Box Logo

Track Your Charity & Sadaqah Contributions

A modern, privacy-focused Progressive Web App for tracking your charitable giving (Sadaqah) with multi-currency support and gold value conversion.

TypeScript React Cloudflare Workers License

Deploy to Cloudflare

Sponsor

Erklab

Sponsored by erklab β€” Architecting production-grade systems with AI-driven velocity and human-centered precision.


πŸ“– Overview

Sadaqah Box helps Muslims track their charitable contributions (Sadaqah) in a modern, secure, and private way. The app converts all donations to gold grams for consistent tracking across different currencies, making it easy to see your total giving regardless of the currency used.

🌟 Our Intention

The Prophet Muhammad ο·Ί said:

"There is a sadaqah to be given for every joint of the human body every day the sun rises. To judge justly between two persons is regarded as sadaqah, and to help a man concerning his riding animal by helping him to ride it or by lifting his luggage on to it, is also regarded as sadaqah, and (saying) a good word is also sadaqah, and every step taken on one's way to offer the compulsory prayer (in the mosque) is also sadaqah and to remove a harmful thing from the way is also sadaqah." β€” Sahih al-Bukhari 2989

Giving sadaqah daily is a beautiful Sunnah, but modern life can make this challenging. We often intend to give charity every day, yet find ourselves too busy, without cash on hand, or simply forgetting.

Sadaqah Box was created to solve this:

  • Remember daily β€” Set aside your intended sadaqah each day so you don't forget
  • Track your commitment β€” See exactly how much you've promised to give
  • Fulfill your promise β€” When ready, collect and distribute to those in need
  • Build consistency β€” Make giving charity a regular habit without the daily friction

The reward for sadaqah comes when it actually reaches those in need. This tool helps you organize your giving so you can follow through on your daily commitment to charity.

Key Features

  • πŸ“¦ Multiple Charity Boxes - Create separate boxes for different causes, family members, or categories
  • πŸ’° Multi-Currency Support - Track donations in any currency (fiat, crypto, or commodities)
  • πŸ₯‡ Gold Value Tracking - All donations are converted to gold grams for consistent comparison and protection against inflation
  • πŸ“Š Visual Analytics - See your giving history with beautiful charts and statistics
  • πŸ”’ Privacy First - Your data is encrypted and secure
  • πŸ“± Progressive Web App - Install on any device, works offline
  • πŸ” Multiple Auth Methods - Email/password, passkeys

πŸš€ Quick Start

Prerequisites

  • Bun >= 1.0
  • Node.js >= 18 (for some tooling)
  • Cloudflare account (for deployment)

Installation

# Clone the repository
git clone <repository-url>
cd sadaqahbox

# Install dependencies
bun install

# Start development server
bun run dev

The app will be available at http://localhost:5173

Database Setup

# Generate database migrations
bun run db:generate

# Apply migrations locally
bun run migrate:local

# Apply migrations to production
bun run migrate:remote

πŸ—οΈ Architecture

Tech Stack

Layer Technology
Frontend React 19, TypeScript, Tailwind CSS 4, Motion
Backend Hono, Cloudflare Workers, D1 Database
Auth Better Auth with passkeys
ORM Drizzle ORM
Build Vite 6, PWA Plugin
UI shadcn/ui, Radix UI, Huge Icons

Project Structure

sadaqahbox/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ api/                 # Backend API (Hono)
β”‚   β”‚   β”œβ”€β”€ endpoints/       # Route handlers
β”‚   β”‚   β”œβ”€β”€ entities/        # Database entities
β”‚   β”‚   β”œβ”€β”€ services/        # Business logic
β”‚   β”‚   β”œβ”€β”€ repositories/    # Data access layer
β”‚   β”‚   β”œβ”€β”€ middleware/      # Auth, CSRF, rate limiting
β”‚   β”‚   └── schemas/         # Zod validation schemas
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ app/            # App root
β”‚   β”‚   β”œβ”€β”€ auth/           # Authentication pages
β”‚   β”‚   β”œβ”€β”€ boxes/          # Box management
β”‚   β”‚   β”œβ”€β”€ dashboard/      # Main dashboard
β”‚   β”‚   β”œβ”€β”€ landing/        # Landing page
β”‚   β”‚   β”œβ”€β”€ layout/         # Header, navigation
β”‚   β”‚   β”œβ”€β”€ sadaqah/        # Sadaqah tracking
β”‚   β”‚   └── ui/             # UI primitives
β”‚   β”œβ”€β”€ db/                  # Database schema
β”‚   β”œβ”€β”€ auth/                # Auth configuration
β”‚   β”œβ”€β”€ hooks/               # React hooks
β”‚   └── lib/                 # Utilities
β”œβ”€β”€ migrations/              # Database migrations
β”œβ”€β”€ public/                  # Static assets
└── docs/                    # Documentation

πŸ“š Documentation

Detailed documentation is available in the docs/ directory:


πŸš€ Deployment

This project is configured for automated deployment via GitHub Actions:

  1. GitHub Pages: Hosts the static frontend client
  2. Cloudflare Workers: Hosts the API and D1 database

GitHub Secrets Required

To enable automated deployment, set the following in your GitHub Repository Settings (Settings > Secrets and variables > Actions):

  • CLOUDFLARE_API_TOKEN: Your Cloudflare API token (with Workers edit permissions)
  • CLOUDFLARE_ACCOUNT_ID: Your Cloudflare Account ID
  • BETTER_AUTH_SECRET: Secret key for Better Auth (generate with bunx better-auth secret)
  • BETTER_AUTH_URL: The production URL of your API (e.g., https://sadaqahbox.apps.erklab.com)

For detailed instructions, see the Deployment Guide.


πŸ”§ Available Scripts

Command Description
bun run dev Start development server
bun run build Build for production
bun run preview Preview production build locally
bun run deploy Deploy to Cloudflare Workers
bun run test Run tests
bun run test:coverage Run tests with coverage
bun run db:generate Generate database migrations
bun run migrate:local Apply migrations locally
bun run migrate:remote Apply migrations to production
bun run studio:dev Open Drizzle Studio (local)
bun run auth:generate Generate auth schema

🌐 API Endpoints

The API is available at /api/ with OpenAPI documentation at /api/docs.

Core Resources

Endpoint Description
GET /api/boxes List all boxes
POST /api/boxes Create a new box
GET /api/boxes/:id Get box details
PUT /api/boxes/:id Update box
DELETE /api/boxes/:id Delete box
POST /api/boxes/:id/collect Empty box (create collection)
GET /api/boxes/:id/sadaqahs List sadaqahs in box
POST /api/boxes/:id/sadaqahs Add sadaqah to box
GET /api/currencies List available currencies
GET /api/stats Get user statistics

See the API Reference for complete documentation.


πŸ” Authentication

Sadaqah Box supports multiple authentication methods:

  • Email/Password - Traditional authentication
  • Passkeys - Passwordless authentication using WebAuthn

Authentication is handled by Better Auth with Cloudflare D1 and KV storage.


πŸ’± Currency & Gold Conversion

All donations are tracked in gold grams (XAU) for consistent comparison:

  1. When you add a sadaqah, the value is converted to USD using live exchange rates
  2. The USD value is then converted to gold grams using the current gold price
  3. Your total giving is displayed in gold grams, with optional conversion to your preferred currency

Supported currency types:

  • Fiat - USD, EUR, TRY, GBP, etc.
  • Crypto - BTC, ETH, etc.
  • Commodities - Gold (XAU), Silver (XAG)

πŸ“± Progressive Web App

Sadaqah Box is a PWA that can be installed on any device:

  • Offline Support - Basic functionality works offline
  • Push Notifications - Get reminders for regular giving
  • Home Screen - Install on mobile and desktop

🀝 Contributing

This is currently a private project. Contributions are not accepted at this time.


πŸ“„ License

This project is private and proprietary. All rights reserved.


πŸ™ Acknowledgments


Built with ❀️ for the Ummah

About

Sadaqah Box helps Muslims track their charitable contributions (Sadaqah) in a modern, secure, and private way. The app converts all donations to gold grams for consistent tracking across different currencies, making it easy to see your total giving regardless of the currency used.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages