This tutorial will take you step-by-step through building a fully functional subscription-based platform. Along the way, you’ll learn about Express.js a web application framework for Node.js.
What we are building.
We want to build a subscription-based platform, where customers will need to subscribe to one of our plans to access our content some of our plans include Weekly, monthly plans.
This article will be broken into Modules.
1:Overview of dependencies, project setup, and server setups.
3:Cron job setup
1:Nodejs must be installed
So guy's let get our hands dirty
Where we will be starting our development server,
On a successful server setup in your console, you should have
Now let's create our plan model file
Now let's create our plan controller file
Now we need to create our helper file for payment and calculating user next payment date
Now let's create our Signup controller file where we will write our logic to register a user as well as charge the user
for the payment, we will be using paystack but feel free to use any payment gateway.
At this point, we need to set up a cron job to deactivate account once the subscription ends
Other Features that can be added to this includes but not limited to :
And if you will like to Have this in part two of this article do let me know in the comment section