Code Monkey home page Code Monkey logo

donate4fun / donate4fun Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 3.0 25.4 MB

Web browser extension for instant Lightning donations on social platforms, even if recepient has no lightning wallet.

License: GNU Affero General Public License v3.0

Python 37.59% CSS 0.49% HTML 19.57% Svelte 31.96% JavaScript 7.93% Shell 1.15% Dockerfile 0.40% Mustache 0.17% Smarty 0.67% Mako 0.07%
bitcoin chrome-extension donations firefox-extension lightning-network webln youtube twitter

donate4fun's Introduction

Telegram Chat Twitter Follow Website codecov

Chrome Web Store Firefox Add-on

Latest Chrome Extension Latest Firefox Add-on

Visitors

Donate4.Fun

This is repository for Donate4.Fun webservice and browser extension. Directory structure:

  • /donate4fun/ - backend (API)
  • /tests/ - tests for backend
  • /frontend/ - website and shared libraries
  • /extensions/ - browser extensions
  • /charts/ - Helm charts for webservice and dependencies (LND, PostgreSQL, Tor)
  • /docker/ - Docker-compose config and Dockerfiles for local development

Development

Website

For developing you need a Docker and docker-compose (see /docker dir). It's recommended to use some virtual env manager, for example direnv.

  • Create config.yaml
  • launch Docker containers (cd docker; docker-compose up -d)
  • launch api python -m donate4fun
  • launch frontend (cd frontend; pnpm run dev)

Tests

Run tests with pytest from repository root.

Trubleshooting

If tests are failing with error FAILURE_REASON_INSUFFICIENT_BALANCE try restarting lnd-bob: docker-compose restart lnd-bob Sometimes channel could not start after starting all services.

If you are getting an error 'database "donate4fun-test" already exists' then connect to local postgresql and drop this database psql -U postgres -c 'drop database "donate4fun-test"'

Browser extension

You need to install both frontend and extension dependencies to build.

(cd frontend && pnpm i)
cd extensions/src
pnpm i
pnpm run dev

Then open browser and install unpacked extension from extensions/chrome or extensions/firefox.

To build release versions run npm run package-clean.

Deploy

For deploying publicly you need a Kubernetes cluster and Helm (see /charts dir).

Build and deploy dependencies

./deploy.sh tor
./deploy.sh lnd
./deploy.sh rtl

Build and deploy the service

./deploy-donate4fun.sh

Extension build and publish

Build

To build release version of extension

cd extensions/src
pnpm install
pnpm build

Chrome Web Store

To make a new release and publish extension to Chrome Web Store NB: always build with pnpm build before publishing

cd extensions/src
npx semantic-release --no-ci

The following environment variables are needed

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • GOOGLE_REFRESH_TOKEN Read this guide on how to obtain them.

Firefox Add On

To publish add-on to addons.mozilla.org

(cd extensions/src && pnpm package-clean)
./scripts/publish-amo.py

The following environment variables are needed

  • AMO_JWT_ISSUER
  • AMO_JWT_SECRET Read this doc on how to obtain them.

donate4fun's People

Contributors

dependabot[bot] avatar nikicat avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

donate4fun's Issues

Top creators page

This page shows table with columns:

  • social account name/profile image
  • social network (logo)
  • total amount of donations
  • flag that shows if this account is linked
  • count of donators (may be their profile images?)

Create lists to recurring donations

Hi,

I will try to explain an use case that I really would like to see on donate4fun service:

1- I would like to be able to create list for recurring donations. The lists could be created in more than one way, for example: I could create a list manually directly on donate4fun site or I could create a list based on my browser browsing history.
The lists could be edited. In the lists will have a list of sites and could be added manually lightning addresses too. The list will have the date of the recurring payment.
When the payment date arrive, donate4fun service will notify the user and create a unique invoice to be paid and then redistribute to all services in the list. (I don't know if is possible to send directly to the v4v or lightning addresses in the list in one transaction without the intermediation of donate4fun).
2- The list will list even sites that has no V4V, so they will appear as missed donations on the list here: #19. By missed donations, I mean sites that it's on my or others recurring donations list but didn't receive the donations because has no V4V.
3- In the list of people/sites of people that received donations #19, could show in the card if the user is included in any recurring donations list or no. And even be able to filter by this category.

Store money using synthetic USD

Issuehunt badges

We could automatically buy synthetic USD on https://lnmarkets.com or https://pro.kollider.xyz/ and sell them on withdraw. On creator account it could still be held in USD.
The idea is taken from https://github.com/standardsats/wallet


IssueHunt Summary

Backers (Total: $0.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips

Donate on mobile devices

Create mobile app or PWA that allows to donate on mobile devices.
It could possible register share handler for youtube videos that automatically sends donation after sharing.

Donate to directly to a Lightning Address

If a donation receiver has a linked (mentioned in video/channel/account description) Lightning Address then send donations directly to this address, but nevertheless create a donation page on Donate4.Fun for history and easy sharing

See a list of all people/sites that received donations

I would like to see a list of all people/sites that received donations from donate4fun

Obs:

1- The cards will show the total received and if the user verified or no the account on donate4fun
2- The total amount will consider too the donations sent directly to lightning address/v4v using donate4fun extension.
3- The list will include too the sites that have v4v.
4- The list could include too a list of sites that never received donations using donate4fun but have v4v.

Donate to an on-chain address

If donation receiver has a linked on-chain address (for example mentioned in a video description) then allow donate directly there. Need to take care of much larger fees, so we need to aggregate such donations of make it on-demand only (by donator or receiver).

Automatically transfer donations

If social account is linked to a Donator account then transfer funds automatically after a donation. This will allow to show updated balance in Extension Popup right after the donation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.