Giter Site home page Giter Site logo

getalby / zapplanner Goto Github PK

View Code? Open in Web Editor NEW
9.0 6.0 6.0 1.7 MB

ZapPlanner - Scheduled recurring lightning payments powered by Nostr Wallet Connect (NWC), enabling lightning subscriptions, bitcoin recurring payments.

Home Page: https://zapplanner.albylabs.com/

TypeScript 93.69% JavaScript 2.76% Dockerfile 2.50% Shell 0.08% CSS 0.97%
bitcoin lightning nostrwalletconnect nwc subscriptions-and-payments

zapplanner's Introduction

ZapPlanner

Scheduled recurring lightning payments powered by Nostr Wallet Connect (NWC)

Try it here: https://zapplanner.albylabs.com/

Programmatically filling the fields

As a service you can programmatically create a URL with all the subscription properties that your users will only need to confirm:

https://zapplanner.albylabs.com/confirm?amount=21&[email protected]&timeframe=30d&comment=baz&payerdata=%7B%22name%22%3A%22Bob%22%7D&returnUrl=https%3A%2F%2Fexample.com
  • amount, recipient, timeframe are required
  • amount is in sats
  • recipient must be a lightning address
  • timeframe must be in milliseconds, or a valid ms string e.g. 1d, 30%20minutes
  • payerdata should be a URL-encoded JSON object as per LUD-18
  • comment and payerdata will only be sent if the recipient lightning address supports it
  • returnUrl encoded URL to show as link on confirmation page

Installation

Run $ yarn install

Run $ cp .env.example .env.local && husky install

note: if .env.local does not work for you, as a temporary solution try renaming it to .env

Run $ yarn cloak:generate and set PRISMA_FIELD_ENCRYPTION_KEY=<CLOAK_MASTER_KEY> in .env.local

Database Setup (Docker)

Run $ yarn docker:start

Run $ yarn db:migrate:deploy

Database Setup (Non-Docker)

Unless you already have it, create the database with: $ createdb boostagram-viewer

Make sure to set your Postgres username and password in .env.local. To list Postgres users, open $ psql followed by > \du. To set no password, leave it empty like this: postgres://username:@localhost....

Run $ yarn db:migrate:deploy

Development (Docker)

Run $ yarn docker:start

Run $ yarn inngest:local

Run $ yarn dev

Development (Non-Docker)

Run $ yarn inngest:local

Run $ yarn dev

NextJS

This is a Next.js project bootstrapped with create-next-app.

Inngest

ZapPlanner is a serverless application that uses Inngest to power its background jobs.

zapplanner's People

Contributors

bumi avatar jankoegel avatar rolznz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

zapplanner's Issues

Remove seconds as option

I don't think it makes sense to send payments every second (payments can even take longer than that). We should event prevent that and only allow something reasonable.

A week would be a better additional option than seconds or minutes, imo.

Dark mode

DaisyUI supports multiple themes. Fix the dark mode theme so it is actually dark

Improve emails for failure & recovery

  • Add the number of failure attempts to the fail email (Attempt 1/3)
  • Consider updating success template to show recovered status (after one or more failures)
  • Add email template for on re-activating subscription

Session data is not cleared

it seems the form is saved in a session and then on the confirm page persisted.
This session is not cleared and when I open the form again I see the same data again.

Why do we need to save this in the session?

disable submit buttons or add spinner on loading

Currently the user does not get feedback when the page is loaded.
I click on the submit button and it takes a bit until I get feedback.
maybe we can disable the submit button or add a loading spinner to indicate to the user that something is loading

Remove form submit button and shadowed box from layout

This is hacky because the button needs to know the form ID, and there is no way to control the button state (e.g. to make it disabled)

Instead, make each page create its own form and include the content box inside the form.

Bug: subscription events stop even though the subscription has no errors

Why did some subscriptions stop?

We could setup a daily scheduled task to re-execute any subscriptions that should have been executed, but were not. But it feels like a bit of a hack. I wonder if we should have used inngest scheduled tasks rather than creating new events after the old one is processed, but that still should work.

Re-add accounts

It's easier to keep track of multiple subscriptions if they are tied to accounts.

What login options should be added? Login with Alby, email, lightning?

-> email login with magic link

My use case for Zaplanner

Hi, I will describe how I would like to use ZapPlanner:

1- Be able to connect with my non custodial Alby account
2- Be able to choose Nostr recipients using Nostr Lists. For example: I create a donation list on something like https://listr.lol/. So On ZapPlanner on recipients I choose Nostr list and select my list.
3- On ZapPlanner I choose to donate a specific amount of sats that will be equally distributed for people of my donation nostr list.

Re-activate subscription

sometimes a subscription might fail 3 times for a number of reasons (LNURL endpoint not available, wallet doesn't have enough balance). User should be able to re-start the subscription when this occurs.

Inngest function executing multiple times in one day

It happens when fly is unable to contact inngest, resulting in inngest trying to send the event again.
"could not make HTTP request to instance: connection error: timed out"

This could be worked around by saving a last updated time on the subscription, and ignoring the next event. But this feels a bit hacky.

Creator pages & rewards

From Mary https://twitter.com/mary_imasuen

I see Zap Planner to be used by a lot of creators no matter the kind of content they are creating. But here are some suggestions I have for Zap Planner.

  • A customizable platform for the creator. I know Zap Planner is created from the perspective of someone wanting to support the creator, but I think there should be an interface that allows creators to have their own Zap Planner page that they can share with people. On this page, they should be able to set different ways people could support them with Zap Planner.

  • Special gift for subscribers. There should also be a way the content creator can also give a gift in return for the person who wants to support them.

For example, if I share my Zap Planner page on my Twitch, newsletter, etc and someone clicks that page and sets how much and how frequently they want to support my content, I should be able to give a special gift to the subscriber. This could be a PDF, special sticker, etc.

Add "For developers" in footer

A link or button that opens information about how to create 1-click confirmation urls for users of their service (similar to what is available in the README)

Deeplink editor

I guess it should be rather simple to have some input fields which are used to generate the URL
Because of the URL encoding this would make it much easier for the user
image

Allow ZapPlanner to prefill data

Something like this, where user just needs to authorize the NWC connection to setup the new subscription:

[zapplanner.com?recipient=foobar&payerdata={](http://zapplanner.com/?recipient=foobar&payerdata={)"foo"="bar"}&comment=baz&timeframe=30d

Use dropdown for intervals

Currently the user needs to know what they enter
we should use some default values

10m
1h
4h
1d
1w
2w
1m
?

Rename "Periodic Payments"?

"Recurring Payments" is more common. It also depends on the context, especially if the user opens a confirmation link then maybe it is a subscription. For other cases where a user is voluntarily contributing, it could be recurring backing payments.

Validate lightning address

  • check if the format is correct (can also be done with html)
  • check if it is a lightning address: alby-tools can be used to load the lnurlp data

Add public stats on homepage

It would be cool to show:

  • how many subscriptions are active
  • how many sats being sent to V4V creators per day/week/month

Thoughts?

Remove session storage for saving form contents

Instead of saving the form state to session storage, before navigating from the create to confirm page the current route could be replaced to one with the submitted form fields as query parameters, and then be read similar to the confirm page.

Automatically set a budget when configuring connection

Based on the interval a user picks, pass budget info to NWC when creating the connection. That way, the user does not need to set it up. Use the delay in milliseconds to figure out which interval makes sense (daily, weekly, monthly, yearly) and set the correct amount of sats to be exactly needed.

Also, make it impossible to create subscriptions with an interval more than 1 year (there is no point in this).

The change needs to be made here: https://github.com/getAlby/ZapPlanner/blob/main/app/confirm/components/ConfirmSubscriptionForm.tsx#L60

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.