Code Monkey home page Code Monkey logo

node-stripe-membership-saas's Introduction

Node Stripe Membership SaaS

This project is a boilerplate express app for creating a membership/subscription site with Stripe, Mailgun, mongodb and swig. Inspired by sahat/hackathon-starter and RailsApps/rails-stripe-membership-saas. It also handles stripe webhooks.

Check out the demo!

System Requirements

  • mongodb
  • nodejs

Getting Started

First update /server/config/secrets.js with the following credentials:

  • Stripe API keys and plan info
  • Mailgun for sending forgot/reset password confirmations.
  • session secret
  • google analytics id

Install dependencies with npm install.

Start the server with node server.

Note: Stripe webhooks can be recieved at https://your-url.com/stripe/events.

Heroku Deployment

heroku create your-awesome-saas-product
heroku addons:add mongohq
heroku config:set SESSION_SECRET='your_secret';
heroku config:set STRIPE_KEY='sk_test_example'
heroku config:set STRIPE_PUB_KEY='pk_test_example'
heroku config:set MAILGUN_USER='example.org'
heroku config:set MAILGUN_PASSWORD='key-secret'
heroku config:set GOOGLE_ANALYTICS='UA-XXXXXX-1'

Want add a heroku deploy button? Pull requests welcome :]

node-stripe-membership-saas's People

Contributors

benrlodge avatar eddywashere avatar kensodev avatar nayrrod avatar raymondware 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

node-stripe-membership-saas's Issues

usage of mail templates in stripe-webhook-middleware

I'm seeing some mail template + setup in your stripe-webhook-middleware. This seems to setup a mail templates per stripe event. Am I correct this is temporary/ unfinished code, since I can't find the actual code (presumably pubsub events to which sending of mailtemplates should be registered).

Any other membership solutions other than this repo?

Hi there,
First of all thank you for this great repo; it's seriously a kickass piece of work and it just works.
However, out of curiosity; since this repo has not been updated for so long I wonder if anyone would know that if there is any other repo/work that provides membership in a similar fashion as this repo?
If so would you be kind enough to leave a link here please.

Thank you all,
Best,

Amir

Requiring mailgun at boot is pretty annoying

Hackathon-starter I believe comes with nodemailer build in by default. I don't use Mailgun, I don't really want to have to set it up to poke around and see how subscriptions work with Stripe. Just a suggestion ๐Ÿ‘๐Ÿป

Unable to Change Plans

Unable to get the app to recognize created subscription plans from the test stripe account. It only every says - No such plan: "name of plan"

Clone can't change plan

I cloned this and no modification other than keys into secrets.js. I can not change plans at all. I only tested with the direct clone as my application doesn't recognize a card when I input it.

i get a 500 error when sending emails?

i used:
User: Default SMTP Login
Password: Default Password

are those correct?
All the DNS entries validated ok in Mailgun.

Im not sure if i need to configure something else.

Issue to insert plan correctly

Hello! Thanks for this good repo.
I cloned this repo and I tried to change plan based on my stripe account.
https://dashboard.stripe.com/test/subscriptions/products, here what I need to copy and paste to the secrets.js
in secrets.js I can see plans and planData variable.
but I don't know what info need to copy for this variables.

there is Product and Product has only one plan, and plan has the info like ID, Created, Nickname, Product.. I can't get make sense what info I need to copy and paste to secrets.js for the plan.

for now, I'm getting error like this.
No such plan: [$PLAN_NAME]

How can cc number/last4 be first added?

I'm trying to enter CC info for the first time, but the controller is looking for req.user.stripe.last4 before I ever have a chance to post the CC info, so I get the Please add a card to your account before choosing a plan. error.

How is the CC first added? Is it added somewhere else?

My bad, I moved the billing.js file and never required it back in.

Error after first run

Hello,
Having an issue with the software. It works prefectly the first time it is launch. However if I stop and start the software, I get the following error.

!!! MONGOOSE WARNING !!!

This is an UNSTABLE release of Mongoose.

Unstable releases are available for preview/testing only.

DO NOT run this in production.

body-parser deprecated bodyParser: use individual json/urlencoded middlewares server/index.js:64:9
body-parser deprecated undefined extended: provide extended option node_modules/body-parser/index.js:105:29
connect-mongo deprecated auto_reconnect option is deprecated. Use autoReconnect instead server/index.js:81:10
Express server listening on port 3000
/root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
TypeError: Cannot read property 'length' of undefined
at processResults (/root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1581:31)
at /root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1619:20
at /root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1157:7
at /root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1890:9
at Server.Base._callHandler (/root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:448:41)
at /root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:481:18
at MongoReply.parseBody (/root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at null. (/root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:439:20)
at emit (events.js:107:17)
at null. (/root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13)
at emit (events.js:110:17)
at Socket. (/root/node-stripe-membership-saas/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:439:22)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)

Any help you could offer to resolve this issues, would be greatly appreciated. I am running on SmartOS with version 0.12.6 node, mongodb-3.0.3.

Server won't start for me

Definitely something wrong on my end but could you help point out the problem?

Here's what I see after running node server

127:macrodb sevgevorkyan$ node server
body-parser deprecated bodyParser: use individual json/urlencoded middlewares server/index.js:64:9
body-parser deprecated undefined extended: provide extended option node_modules/body-parser/index.js:85:29
connect-mongo deprecated auto_reconnect option is deprecated. Use autoReconnect instead server/index.js:81:10
Express server listening on port 3000
MongoDB Connection Error. Make sure MongoDB is running.

/Users/sevgevorkyan/virtualenvs/macrodb/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/mongo_client.js:409
throw err
^
Error: failed to connect to [localhost:27017]
at null. (/Users/sevgevorkyan/virtualenvs/macrodb/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:555:74)
at emit (events.js:106:17)
at null. (/Users/sevgevorkyan/virtualenvs/macrodb/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15)
at emit (events.js:98:17)
at Socket. (/Users/sevgevorkyan/virtualenvs/macrodb/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
at Socket.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:419:13)

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.