flexmoney-backend

Story

Sukhdam Yoga Classes are one of the premiere yoga institues of india, they have there schools setup in different different cities, where they teach yoga.
They wanted us to create a platform for online onboarding of students, so that they dont have to visit the center always, and can also help in increasing there popularity and customer, their classes are of month on month basis, and the fees is also supposed to be paid in that manner, you can only pay fees once in a month, no matter which day you paid the fees, one will only be eligible for the remaining days of the month

My Solution

I Created a simple Registeration form for students which will ask for most of the required information which can be easily provided online, and then will create a user dashboard, from where the student can pay the fees, right now the dashboard only has batch selection and fees paying facility but it can grow up to have much more
The fees was supposed to be paid on a month on month basis and after the completion of month the usability of the dashboard has to be removed so for that, implimented a job scheduler which in the morning of japanese time which is typically around midnight of india will update all the active users dashboard to inactive, and will have payment option available to them

Technical Details

Technology Used

Architecture - Model-View-Controller with layers of Services that are abstractions to manipulate the data.
API - JavaScript (NodeJS) , function based
Database - MongoDB
Database Querying - Mongoose
Database Hosting - Mongo Atlas
Auth - JSON web token
API Hosting - Vercel
Frontend - NextJS, JavaScript
Developer Tooling - Prettier

Reasons for selection of MongoDB (NoSQL) server over any SQL server

  1. Easy to setup, and faster to use
  2. More Familarity with MongoDB and realted libraries
  3. MongoDB atlas works as a great and reasonable database service as per our use, we might even be able to work in its free tier for our current specifications

Models

User Model

user-model



Bill Model

bill-model



Relation between the 2 Collections is of common unique email id

relation

API LLDs

  1. Registeration API
    reg-1
    reg-2



  1. Login API
    log



  1. Payment API or Update API or Status Update API
    update-status