Fund Purifier Cover

Fund Purifier
Invest in halal versions of popular US funds.Built-in Shariah-compliance monitoring, smart rebalancing and more..


Investing in the stock market as a Muslim is hard, because it’s not always obvious what’s halal and what isn’t. It gets even trickier when it comes to investing in funds, because there’s no way to exclude non-halal stocks from a fund with hundreds of stocks.

Until now.


We built the Fund Purifier to automatically filter any US-listed mutual fund or ETF for you.

Just choose a fund, and we automatically filter it for compliant stocks.

On top of that, we also support:

๐Ÿ” Tracking fund changes so your filtered fund reflects additions/removals in the original fund

๐Ÿ—‘๏ธ Automatic removal when a stock turns haram (and re-added if it turns halal)

โš–๏ธ Smart rebalancing so any funds invested/withdrawn help you come closer to the target weights

… and more!

It’s also 100% Free! You can use it today by signing up at

Oh, and one more thing. It’s completely open-source ๐Ÿ’ฅ

Important Just looking to use the Fund Purifier? Use the hosted version at


Install dependencies

git clone
npm install

Register for 3rd Party Services

The Fund Purifier relies on some 3rd party services. You’ll need to sign up for these in order to run the app locally:

  1. Alpaca Developer App for executing trades (powers the “Sign in with Alpaca” functionality)
  2. Clerk for authentication
  3. Resend for email notifications

You’ll need to sign up to these services and populate your local .env file with the following keys:



To run the Fund Purifier in production, you’ll need to register for additional 3rd party services:

Once done, populate your local .env file with the following keys:


Note: These are paid services. The total cost is around $20k/year.

IMPORTANT: You do not need to sign up to these services to run the Fund Purifier locally. We provide mocked responses in development instead.

Tech Stack

The Fund Purifier is built using the latest tech. Here’s a run-down of what our stack looks like:

  • NextJS 14, with app directory
  • React (Frontend / Server Components)
  • SQLite
  • Typescript
  • BullMQ
  • Redis


Let’s cover the main parts of the project src/ directory:

  • app/: all the routes used in the client application
  • components/: reusable components used throughout the application
  • hooks/: mainly used for global state management
  • lib/: includes interfaces for 3rd party libraries and services
  • models/: includes zod schemas for verifying data from 3rd parties
  • services/: any sufficiently complex code taken outside controllers
  • workers/: any long-running code that runs in the background



AGPL 3.0 License


View Github