Skip to content

A production-ready Subscription Management System with real users, real money, and real business logic with JWT authentication, database modeling, API architecture, security, automated workflows, and much more!

License

Notifications You must be signed in to change notification settings

SrjAdhikari/Subscription-Tracker-Backend

Repository files navigation


Project Banner

node.js express.js mongodb mongoose arcjet upstash nodemailer License

🚀 Production-Ready Subscription Tracker API

A scalable and secure backend service for managing recurring subscriptions. This RESTful API allows users to authenticate, manage subscription plans, receive email reminders, and store data reliably using a MongoDB database.


  1. 📌 Introduction
  2. 🎯 Features
  3. 🛠️ Tech Stack
  4. ⚙️ Setup Instructions
  5. 🔐 Environment Variables
  6. 📄 License

Build a production-ready Subscription Management System API that handles real users, real money, and real business logic.

Authenticate users using JWTs, connect a database, create models and schemas, and integrate it with ORMs. Structure the architecture of your API to ensure scalability and seamless communication with the frontend.


  1. 🔐 JWT Authentication – Secure login and registration flow.
  2. 🧠 Smart Subscription Management – Track services, renewal dates, categories, and payment methods.
  3. 📬 Automated Email Reminders – Scheduled email notifications using Upstash QStash.
  4. 🌐 RESTful Architecture – Clean and consistent routing design.
  5. 🧱 MongoDB + Mongoose – Schema-based data modeling.
  6. ⚙️ Global Error Handling – Centralized middleware for clean debugging.
  7. 🛡️ Rate Limiting – Protection against brute force and bot traffic.

Technology Description
Node.js Runtime environment for executing JavaScript
Express.js Backend web application framework
MongoDB NoSQL database for flexible document storage
Mongoose ODM for MongoDB
JWT Secure user authentication
Upstash QStash Serverless queue to manage background jobs
Nodemailer Sends transactional emails

Follow these steps to set up the project locally on your machine.

Prerequisites

Make sure you have the following installed on your machine:

Clone the Repository

git clone https://github.com/SrjAdhikari/Subscription-Tracker-Backend.git
cd Subscription-Tracker-Backend

Installation

Install the project dependencies using npm:

npm install

Run the Project

npm run dev

Open http://localhost:5500 in your browser or Postman to test the project.


Set Up Environment Variables

Create a .env.local file in the root of your project and add the following variables:

# PORT
PORT=5500
SERVER_URL="http://localhost:5500"

# ENVIRONMENT
NODE_ENV=development

# DATABASE (Get MongoDB URI from your MongoDB Atlas or local MongoDB setup)
DB_URI=

# JWT AUTH (Generate a secure random string for JWT_SECRET)
JWT_SECRET=
JWT_EXPIRES_IN="1d"

# ARCJET (Get your Arcjet key from https://arcjet.com)
ARCJET_KEY=
ARCJET_ENV="development"

# UPSTASH (Get your QStash URL and token from https://upstash.com)
QSTASH_URL=http://127.0.0.1:8080
QSTASH_TOKEN=

# NODEMAILER (Use your email service provider's SMTP password)
EMAIL_PASSWORD=

This project is licensed under the MIT License. See the LICENSE file for details.



Made with ❤️ by Suraj Adhikari

About

A production-ready Subscription Management System with real users, real money, and real business logic with JWT authentication, database modeling, API architecture, security, automated workflows, and much more!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published