GithubHelp home page GithubHelp logo

bgmorton / blicense Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 482 KB

This NodeJS/Express Application accepts payment for, and generates a node-js-licensefile compatible software license

JavaScript 51.54% HTML 44.61% CSS 3.85%

blicense's Introduction

blicense

node-js-licensefile + express + stripe


About

  • This NodeJS/Express Application accepts payment for, and generates a node-js-licensefile compatible software license
  • It provides a text download of the generated license with invoice details, stores the results in a database, and emails a copy to the customer
  • It can apply discounts for each additional month the duration of the software license is for, encouraging users to invest in your product
  • Optional single tax rate for sales in your region - For example, GST can be added for Australian buyers only if you are operating from Australia and must charge tax there
  • It's great for selling licenses for electron apps using node-js-licensefile for validating licenses
  • It's intended to be run behind a reverse-proxy which would add it's own HTTPS - and as such DOES NOT SUPPORT HTTPS
  • You should really run this behind a HTTPS reverse proxy or add HTTPS support yourself, otherwise it won't be secure

Screenshot

  • Screenshot

Requirements

  • MySQL Server
  • SMTP Email Host
  • Account and API keys with Stripe.com payments processor
  • Server running NodeJS > 8 to host this code
  • Reverse http proxy - Apache, Nginx etc.

App Behaviour

  • Startup
    • Database will automatically migrate, creating a licenses table
    • If the database cannot connect on start, it will retry indefinitely, logging each failure
  • General
    • Logo will display if process.env.LOGO=true
    • Http Errors will be sanitized when process.env.NODE_ENV=production
  • Route /
    • Displays main payment form
    • Will display process.env.DESCRIPTION under optional logo
    • process.env.PRODUCT_PAGE_LINK, process.env.TERMS_PAGE_LINK buttons appear below the pricing table
    • Tax will be added to total if the users country matches process.env.STRIPE_GST_COUNTRY
    • Pricing table populated from process.env. vars, tax/discount pricing table rows will be hidden if 0
    • Both validation and Stripe payment errors will appear above the Submit Payment button
    • Total is re-calculated on form value change
    • Discount will be automatically applied to total, discounting the total for each additional month added
    • Will reset the session on validation errors
    • Contains the stripe payment element
  • Route /charge
    • The form action for the payment form, performs the charge and generates the license
    • Validates submitted data
    • If accessed via GET, will redirect to /
    • Redirects back to / on validation failure
    • Redirects to /completed on success
    • Creates stripe customer, charge
    • Creates license and invoice and saves in DB, emails to user
    • Doesn't halt on email send failure, but logs it so the user still gets their license in-browser
  • Route /completed
    • Displays on payment completion and license generation success
    • Will redirect to / if no completion data present (ie. user has navigated directly to /completed)
    • Text from PROCESS.ENV.COMPLETED will appear under optional logo
    • On completion of transaction will display the invoice/license as it was emailed to the user, and a button to download a file copy
    • Resets the session

Installation / Deployment Instructions

Warranty

  • No warranty expressed or implied. I assume no liaibility or responsibility for any damage this software causes. Use at your own risk.

Future

  • Free trial licenses, restricted by email
  • Download link (unique?) on completion, mention on index that the download link and license will be provided post payment
  • Product activation

License

Author

blicense's People

Watchers

Brad avatar

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.