Fictional newsletter with subscription to improve knowledge about online payments.
This project has a lot of third party dependencies. Follow instructions carefully!
yarn install
-
Install stripe-cli to attach webhooks to your local enviroment.
-
Create a new database in faunaDB.
- Create 2 collections: [users, subscriptions] (no schema needed)
-
Configure some github account to OAuth
- Clone .env.example as .env.local
Most of variables are pretty straightforward, except "STRIPE_WEBHOOK_SECRET"
stripe listen --forward-to localhost:3000/api/webhooks
After that you should see something like that in your terminal:
This is your "STRIPE_WEBHOOK_SECRET"
FaunaDB is a NoSQL Database, but you have to create some indexes to get things working:
- user_by_email
- user_by_stripe_customer_id
- subscription_by_id
- subscription_by_status
- subscription_by_user_ref
Now you're good to go!
yarn dev
- Thiago Vasconcellos - Initial work - ThiagoVasconcellos
This project is licensed under the MIT License - see the LICENSE.md file for details