Giter Club home page Giter Club logo

ultimate-saas-ts's Introduction

🚀⚡️🧑‍💻 Ultimate SAAS template Typescript/Next.js/NextAuth.js/Prisma/Stripe/Tailwindcss/Postgresql

My template to quickstart a SAAS project

Stop losing time implementing authentication and payment over and over again.
Focus on what brings value to your customers

Demo

https://utlimate-saas-js.vercel.app

Features

  • Authentication with NextAuth.js (Own Your Data ✅)
    • Email with magic link
    • Github
    • Many other oauth providers available check their docs
  • Payment with Stripe
    • Stripe checkout
    • Stripe billing portal
    • Stripe webhooks (products / prices are synced)
  • Hosted on vercel for free

Stripe

Check the stripe section of this repo as the steps are very similar

Postgresql

A postgresql db is needed to deploy the app.
You can have a very small instance for free on heroku


Made with

  • Typescript
  • Next.js
  • NextAuth.js
  • Prisma
  • Postgresql
  • Stripe
  • Tailwindcss

Develop

# create .env 
cp .env.example .env

# install dependencies
yarn

# Launch pgsql and maildev
yarn docker:start

# migrate and seed the database
yarn prisma:migrate:dev

yarn prisma:seed

# install stripe cli 
https://stripe.com/docs/webhooks/test

stripe login

stripe listen --forward-to http://localhost:3000/api/stripe/webhook

# start server
yarn dev

Inspirations

ultimate-saas-ts's People

Contributors

everonegraham avatar gmpetrov avatar kuttim avatar kyh 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  avatar  avatar

ultimate-saas-ts's Issues

Build on Vercel fails

Forking this repo and attempting to deploy the fork to Vercel with defaults results in the following error:

[23:10:21.336] Cloning github.com/abrichr/rvubot.com (Branch: master, Commit: 2b987b9)
[23:10:21.945] Cloning completed: 608.372ms
[23:10:22.232] Looking up build cache...
[23:10:22.365] Build Cache not found
[23:10:22.414] Running "vercel build"
[23:10:23.054] Vercel CLI 28.4.12-5b68066
[23:10:23.463] Installing dependencies...
[23:10:23.888] yarn install v1.22.17
[23:10:23.967] [1/4] Resolving packages...
[23:10:24.299] [2/4] Fetching packages...
[23:10:39.563] [3/4] Linking dependencies...
[23:10:39.566] warning " > @next-auth/[email protected]" has incorrect peer dependency "next-auth@>=4".
[23:10:39.568] warning "next > styled-jsx > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
[23:10:39.571] warning " > [email protected]" has unmet peer dependency "@types/node@*".
[23:10:46.241] [4/4] Building fresh packages...
[23:10:53.041] $ prisma generate || true
[23:10:54.531] Prisma schema loaded from prisma/schema.prisma
[23:10:56.489] 
[23:10:56.489] ✔ Generated Prisma Client (3.0.2) to ./node_modules/@prisma/client in 221ms
[23:10:56.489] You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
[23:10:56.490] ```
[23:10:56.490] import { PrismaClient } from '@prisma/client'
[23:10:56.490] const prisma = new PrismaClient()
[23:10:56.490] ```
[23:10:56.572] Done in 32.69s.
[23:10:56.609] Detected Next.js version: 11.1.2
[23:10:56.612] Running "yarn run build"
[23:10:56.981] yarn run v1.22.17
[23:10:57.022] $ next build
[23:10:58.016] info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
[23:10:58.780] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[23:10:58.781] This information is used to shape Next.js' roadmap and prioritize features.
[23:10:58.781] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[23:10:58.781] https://nextjs.org/telemetry
[23:10:58.781] 
[23:10:58.881] Browserslist: caniuse-lite is outdated. Please run:
[23:10:58.882] npx browserslist@latest --update-db
[23:10:58.882] 
[23:10:58.882] Why you should do it regularly:
[23:10:58.882] https://github.com/browserslist/browserslist#browsers-data-updating
[23:10:58.915] info  - Checking validity of types...
[23:11:05.808] Failed to compile.
[23:11:05.808] 
[23:11:05.808] ./pages/api/auth/[...nextauth].ts:14:7
[23:11:05.809] Type error: Type 'string | undefined' is not assignable to type 'string'.
[23:11:05.809]   Type 'undefined' is not assignable to type 'string'.
[23:11:05.809] 
[23:11:05.809] �[0m �[90m 12 | �[39m  providers�[33m:�[39m [�[0m
[23:11:05.809] �[0m �[90m 13 | �[39m    �[33mFacebookProvider�[39m({�[0m
[23:11:05.810] �[0m�[31m�[1m>�[22m�[39m�[90m 14 | �[39m      clientId�[33m:�[39m process�[33m.�[39menv�[33m.�[39m�[33mFACEBOOK_ID�[39m�[33m,�[39m�[0m
[23:11:05.810] �[0m �[90m    | �[39m      �[31m�[1m^�[22m�[39m�[0m
[23:11:05.810] �[0m �[90m 15 | �[39m      clientSecret�[33m:�[39m process�[33m.�[39menv�[33m.�[39m�[33mFACEBOOK_SECRET�[39m�[33m,�[39m�[0m
[23:11:05.810] �[0m �[90m 16 | �[39m    })�[33m,�[39m�[0m
[23:11:05.810] �[0m �[90m 17 | �[39m    �[33mGitHubProvider�[39m({�[0m
[23:11:05.855] error Command failed with exit code 1.
[23:11:05.857] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[23:11:05.879] Error: Command "yarn run build" exited with 1

More readable mangled portion:

23:11:05.809 | 12 \|   providers: [
23:11:05.809 | 13 \|     FacebookProvider({
23:11:05.810 | > 14 \|       clientId: process.env.FACEBOOK_ID,
23:11:05.810 | \|       ^
23:11:05.810 | 15 \|       clientSecret: process.env.FACEBOOK_SECRET,
23:11:05.810 | 16 \|     }),
23:11:05.810 | 17 \|     GitHubProvider({

image

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.