Skip to content
项目

rwieruch/nextjs-firebase-authentication

在 GitHub 查看

关于

Next.js + Firebase 入门模板

开发工具

这些数字如何统计

实测星标增长

24小时
0
7天
-1
15天
-1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

My Course Platform

Build Status Greenkeeper badge

Server-Side User Management with

  • GraphQL (Tutorial) and Firebase (Tutorial)
    • Sign In
    • Sign Up
    • Sign Out
    • Email Change
    • Password Change
    • Password Reset

Client and Server-Side Protected Routes with

  • Next.js Authorization and Firebase Session

Payment with

  • Stripe
  • PayPal

Styling with

Type Support with

  • TypeScript

Tested Code Base with

Environment Variables with

Absolute Imports with

Sentry

More Features

  • Discounts with Coupons
  • Affiliate Marketing with Partner Program

Installation

  • git clone [email protected]:rwieruch/nextjs-firebase-authentication.git
  • cd nextjs-firebase-authentication
  • See other installation instructions below ...
  • yarn install
  • yarn run dev
  • Visit http://localhost:3000/

.env file

Create a .env file. If using git, add it to your .gitignore file.

Values may differ for development and production:

BASE_URL=http://localhost:3000

FIREBASE_API_KEY=
FIREBASE_AUTH_DOMAIN=
FIREBASE_DATABASE_URL=
FIREBASE_PROJECT_ID=
FIREBASE_STORAGE_BUCKET=
FIREBASE_MESSAGING_SENDER_ID=
FIREBASE_APP_ID=

PAYPAL_CLIENT_ID=
PAYPAL_CLIENT_SECRET=

STRIPE_CLIENT_ID=
STRIPE_CLIENT_SECRET=
STRIPE_WEBHOOK_SECRET=

COUPON_SALT=
COUPON_URL=
FIREBASE_ADMIN_UID=

SENTRY_DSN=

REVUE_TOKEN=

SLACK_TOKEN=

CONVERTKIT_API_KEY=
CONVERTKIT_FORM_ID=

S3_ENDPOINT=
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_BUCKET=

DATABASE_TYPE=
DATABASE_HOST=
DATABASE_PORT=
DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_NAME=
DATABASE_SSL_CERTIFICATE=

.firebaseServiceAccountKey.json file

Visit here for Firebase Admin SDK and generate a firebaseServiceAccountKey.json file from there which should be in your project's root folder. If using git, add it to your .gitignore file.

Admin Account

If you want to have an account with Firebase admin claims, create this Firebase account first via UI, then set the user account's uid in .env with FIREBASE_ADMIN_UID, and restart your server.

Stripe CLI for Webhook in Development Mode

Stripe CLI

stripe login
# follow instructions
stripe listen --forward-to localhost:3000/api/stripe-webhook
# copy and paste secret

The secret can be used in .env:

STRIPE_WEBHOOK_SECRET=secret

Then fake a request with Stripe CLI stripe payment_intents create --amount=100 --currency=usd will work. Make sure the application is running too. Or use the web application's Stripe Checkout feature for real.

探索相关项目

加载中…