Sadaqah Jariyah

In Islam, continuous charity or ongoing charity (صدقة جارية) refers to any act that continues to benefit humanity even after the death of its initiator. Whoever leaves a beneficial legacy for humanity is deemed to continue to be rewarded for it even after their death.

On the authority of Abu Hurairah that the Messenger of Allah said, "When a person dies, his deeds come to an end except for three: Sadaqah Jariyah (a continuous charity), or knowledge from which benefit is gained, or a righteous child who prays for him."

Examples
Examples of ongoing charity in Islam include:

Planting a tree: Planting trees is recommended in Islam, as it provides three essential benefits: consuming its fruits, seeking shade under it, and utilizing its wood.

Building a Water Well: Building water wells is also recommended, as it facilitates access to water, serving as ongoing charity since people continue to benefit from it even after the person who dug it has passed away.

Building a mosque or School or hospital: Constructing mosques is considered a significant ongoing charity, as the one who builds it continues to earn rewards whenever people pray in that mosque.

Leaving a beneficial book.

Leaving Useful Knowledge.

Leaving anything beneficial for humanity is considered ongoing charity.

The Prophet Muhammad said:"There are seven deeds for which a person continues to earn rewards after death: giving knowledge, digging a well, planting a tree, building a mosque, leaving a Quran as inheritance, leaving a child who prays for forgiveness after their death."