Coder Social home page Coder Social logo

tiphub's Introduction

TipHub

Send sats to your favorite open source contributors! Embed a button in your README and get tips for your work. See an example of that right here:

Tip wbobeirne on TipHub
My pubkey starts with 02458b08

Development

First setup your environment variables, copy .env.example into a file named .env. Review each one and follow the instructions for the ones that need input.

To start the backend:

  • cd backend
  • Setup virtualenv (recommended, not required)
    • virtualenv -p python3 venv
    • source venv/bin/activate
  • pip install -r requirements.txt
  • flask db upgrade
  • FLASK_APP=app.py FLASK_ENV=development flask run

To start the frontend:

  • cd frontend
  • yarn && yarn dev

Production

  • Build the frontend with 'yarn && yarn build'
  • Run FLASK_APP=app.py FLASK_ENV=production flask run

Deploy

This app was built to deploy on heroku by doing the following:

  • Create a new heroku app and link it to the repo
  • Setup your environment variables based on .env.example
  • Provision a PostgreSQL database addon
  • Add the subdir buildpack
    • heroku buildpacks:set https://github.com/negativetwelve/heroku-buildpack-subdir
  • git push heroku master

tiphub's People

Contributors

dependabot[bot] avatar dongcarl avatar ecurrencyhodler avatar giovannibordiga avatar wbobeirne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tiphub's Issues

Configure for production

Configure the frontend and backend to work in a production environment. The flask app should serve up the static assets from yarn build.

[brainstorm] Sender/receiver privacy

Sender/receiver privacy should be maintained to the best of our abilities.

Sender Privacy
Right now, the sender can tip anonymously. The only information we're privy to on that can be tied to the sender is the fulfilled invoice.

Receiver Privacy
Right now, receiving requires signup using one of our OAuth integrations. We also connect to nodes thru IPv4.

We should:

  • Enable signup using usernames/emails
  • Enable connecting to nodes thru Tor

The above is most likely incomplete, please comment below on other privacy concerns.

Allow for account deletion / removal of connections

Users should be able to remove connections from their account. Removing the final connection should prompt a warning to the user that their account will be deleted. They can sign up again, but we'll wipe out their tip history & their node info.

Changing email causes discrepancy between frontend and backend

Steps to reproduce:

  1. Go to "Config" tab of profile page
  2. Change email
  3. Hit submit
  4. Click on another tab
  5. Go back to "Config" tab
  6. Email appears to be unchanged
  7. Reload page
  8. Email appears to be changed

Expected behavior:

  1. Go to "Config" tab of profile page
  2. Change email
  3. Hit submit
  4. Click on another tab
  5. Go back to "Config" tab
  6. Email appears to be changed
  7. Reload page
  8. Email appears to be changed

List view of tips

It's scaffolded out right now, but it'd be great if we actually had a working list view of tips.

Email user on successful payment / failed node request

We should email the user when the following things happen:

  • They receive a tip
  • We try to generate an invoice with their node, and it fails

Ideally both cases would have some rate limiting to prevent a user from getting rekt with emails.

About page

It's currently a placeholder, we should probably flesh it out with some detail.

  • What the site does
  • Who built it
  • FAQ?

Handle OAuth Errors

When OAuth fails, we get redirected to a page with query parameters that contain more information. Here's an example of a GitHub OAuth failure redirect:

/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=azCYm71U9Kg8Fpv85HzaGB94uBNANw

We should handle these and display them to the user. Should also be useful for development.

Background process for monitoring payments

We should look into Celery or some other way of keeping tabs on Lightning payments going through. Our current methodology of long polling from the client seems pretty error-prone.

Fix Blockstack auth in production

Currently manifest.json is serving from /static/manifest.json, blockstack needs to be informed that it's there (and not at /manifest.json) or we should setup a flask route directly to it.

Embed markdown snippet page

We'll need a page that lets a user preview a tip button embed, and provides them markdown to put in their readme. The embed should include the following:

  • A stylish button for a user to click
  • The user's node's pubkey, so that tippers can confirm our site isn't foolin' em.

We may add customization features in the future, but those will be separate tasks.

Form for setting up node

Provide a form for users that allows them to specify:

  • An invoice.macaroon file
  • A tls.cert file
  • A URL to their node's gRPC endpoint
  • (Optional) an email to alert them of new tips & failed requests

Should do as much pre-validation before submitting as possible.

Use Redux for auth state

To keep things simple for the hackathon, no redux state was added and all components fetched data as-needed. However to reduce copy-paste and improve auth flow, we should add a redux store. At the moment, all I can think of it needing to keep track of is auth state. But if there's anything else, drop a note here.

Add optional on-chain fallback address

We should let folks configure an on-chain fallback address, and watch for sends to that too. Might be nice for large tips, people who don't have nodes, or people who can't route their tips.

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.