This training is a news project that will be consuming some public apis including a subscription payments api.
Published Project
https://dev-news-front-nextjs.vercel.app/
On Subscription use the card number: 4242 4242 4242 4242
Any expiration date and any security code
Install Project
yarn
Run Project Local
yarn dev
Run Project's Tests
yarn test
Build Project
yarn build
Run Project Production
yarn start
Stripe - Create account in: stripe.com > register all your information, account name,...
Click: developers > API Keys > Reveal test key
Click: developers > API Keys > Copy public key
Click: developers > Webhooks > Test in local enviroment >
> follow steps for install CLI > Copy Key in your SO's Terminal
GitHub - On your Github, go to settings and click: Developer settings > OAuth Apps > New OAuth App Save all registers.
Take Client ID
Generate Client secrets and Copy Client ID.
Be careful, if you lose the secret, you'll have to create another one.
FaunaDB - Create account on FaunaDB. Create Database. Create collections: users (email, stripe_customer_id) and subscriptions (id, userId, status, priceId). Create Indexes:
- subscription_by_id: data.id
- subscription_by_status: data.status
- subscription_by_user_ref: data.userId
- user_by_email: data.email
- user_by_stripe_customer_id: data.stripe_customer_id
Go to Side Menu: Security > New Key > Copy Secret e paste here
NextAuth
For now in a local environment, use any code, generate one here: https://djecrety.ir/
Primic CMS - Create account. Create Custom Types (UID, Title, Content with Rich Text). Set type Repeatable and name as "Post". Create some documents on side menu Documents.
Go to Settings > Api & Security > copy "entry point for your api access"
Go to Settings > Generate and copy a permanent master access tokens