Skip to content

Subscription based application with Next.js, Prismic CMS, Stripe and FaunaDB

Notifications You must be signed in to change notification settings

iwataniKenji/ignews

Repository files navigation

Summary

📙 About 🖼️ Preview 📖 How to Start 💡 Features 💻 Technologies

✔️ Ig.news project finished ✔️

📙 About

Ig.news is a serverless website based on Next.js framework usage and has an authentication functionality that allows the user to get access to written content about the ReactJS world if he is logged in or a preview of the original content if he's not.

The access is allowed trough a payed monthly subscription and the authentication uses Github to get the user's basic information.

In conclusion, this application was used to implement and learn unit testing basic concepts and tips on how to set Vercel config and environment variables settings.

This project is originally created on Ignite from Rocketseat and made by Kenji Iwatani


🖼️ Preview

Project overview:

ignews website overview

Tests coverage report:

ignews website tests coverage report overview

📖 How to Start

Starting this repository:

# Clone this repository
$ git clone https://github.com/iwataniKenji/ignews

# Access the project directory
$ cd ignews

Creating and setting the project:

It's required an account on Stripe (for payment system), Fauna (for database functionality), and Prismic (to create publications of the website).

# Install dependencies
$ yarn

# On ".env.example" file, fill the environment variables according to the instructions provided
$

# Rename the config file
$ ren ".env.example" ".env.local"

# Execute stripe to listen the events from webhooks
$ stripe listen --forward-to localhost:3000/api/webhooks

# Initialize and open local host
$ yarn dev

Running tests:

# Run tests
$ yarn test

💡 Features

  • Static website with SSG
  • Github authentication
  • Subscription and payment system using Stripe
  • Redirect when not authenticated
  • Validation of active subscriptions
  • Prevents duplicated customers accounts
  • Posts preview functionality for non-subscribed users
  • Backend independent (serverless website)
  • Unit tests implemented and covering most of the application

💻 Technologies