Giter Site home page Giter Site logo

minimum-viable-saas's Introduction

Minimum Viable SaaS

A feature-complete membership app in less than ~400 lines of code.

Built with

  • Next.js
  • Firebase Auth
  • Firebase Firestore
  • Firebase Stripe Extension
  • Stripe Customer Portal
  • Tailwind

Features

  • Login/Logout
  • 2 product tiers (Basic and Premium) with 2 price plans each (monthly and yearly)
  • Subscription management, card management, and plan cancellation via Stripe Customer Portal
  • Basic-only content
  • Premium-only content

Background

I saw a tweet about a new Firebase Firestore Extension for Stripe's new customer billing portal. This new portal lets end-users change plans and update their billing info via stripe.com instead of in your app--saving you thousands of lines of UI code and headaches.

Anyways, after seeing this, I had to see just how many lines it code it would take to build a minimally viable membership/saas site.

Turns out it takes less than 300-400 lines of code. It took me around 2 hours to figure this all out, but that's because I semi-forgot how Firebase worked (hint: subscriptions).

Most of the code comes straight from the next-firebase-authentication Next.js example. After that it's almost entirely ripped from the Stripe sample.

While I'm still not a fan of Firebase, I think this setup is by far the fewest possible lines of code required to get $$$$ selling some software as a service.

minimum-viable-saas's People

Contributors

jaredpalmer 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

minimum-viable-saas's Issues

FirebaseError: Missing or insufficient permissions.

I'm wracking my brain here. I have this all setup appropriately with Stripe, Firebase, .env values, Firebase db rules etc. But for some reason I'm seeing this error being throw here:

// in pages/index.js
...
    db()
      .collection('content-basic')
      .get()
      .then(unwrapCollection)
      .then(
        (content) => setBasicContent(content),
        (e) => console.log(e)
        // ^^^^^ FirebaseError: Missing or insufficient permissions. ^^^^^^
      );
...

I created content-basic and content-premium collections in Firebase as well, created products in Stripe, etc. I just cannot seem to squash this error. Any help would be greatly appreciated ๐Ÿ˜„

Don't like firebase?

Curious what you don't like about firebase?

Also, if you don't like it, why don't you use some other pieces? For example, if you don't like Firestore use Fauna as an example.

NextJs issue

Hi there, I know this project was created quite some time ago. I am trying to use it to setup a subscription with firebase and stripe. I've been fighting with stripe and firebase for sometime now and every repository I use always throws some kind of an error. I was very close to getting yours to work. I'm running into an issue and no matter what I do it won't load the local server or build the project.
Here is the error below:
Localhost start
syntax error .next\prerender-manifest.json: Unexpected end of JSON input
at parse ()

npm run build:
Creating an optimized production build .ReferenceError: React is not defined

It's basically saying that pre-render-manifest.json is missing. I've tried different next versions but still get an error. I've been stuck on stripe/ firebase for a while and can't get it to work. Any help is beyond appreciated.

Missing file

Seems like .env.local.example got nuked at some point, which makes it harder to follow the setup guide.

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.