A modern Node.js + Express + MongoDB application for managing subscriptions, users, and subscription plans — the backend API powering a subscription-based platform.
- 📘 Introduction
- ⚙️ Tech Stack
- ⭐ Features
- 🚀 Quick Start
- 💻 Snippets (Code to Copy)
- 📸 Demo
- 🔗 Links
A Subscription Management System API built with Node.js, Express, and MongoDB. It provides secure user authentication, subscription handling, and structured data modeling with Mongoose. The system includes production-grade features such as rate limiting, bot protection, centralized error handling, logging, and automated email workflows.
- Node.js
- Express.js
- MongoDB
🔐 Advanced Security Controls: Arcjet integration provides bot protection and rate-limiting capabilities throughout the system.
📨 Automated Email Notifications: Upstash Workflows enable scheduled and event-driven reminder emails.
🗃️ Database Modeling: MongoDB and Mongoose are used to define structured models and establish clear relationships.
🎫 JWT-Based Authentication: Secure token-based workflows support user management and subscription operations.
🔧 Modular Architecture: The codebase is organized for scalability, maintainability, and reusability across different parts of the application.
Prerequisites
- Git
- Node.js
- npm
- MongoDB
Clone the repository
git clone https://github.com/Sumit-531/Subscription-Tracker.git
cd Subscription-TrackerInstallation
Install the project dependencies using npm:
npm installSet Up Environment Variables
Create a file named .env.local in the root directory of the project and add the required environment variables as shown below:
# PORT
PORT=5500
SERVER_URL="http://localhost:5500"
# ENVIRONMENT
NODE_ENV=development
# DATABASE
DB_URI=
# JWT AUTH
JWT_SECRET=
JWT_EXPIRES_IN="1d"
# ARCJET
ARCJET_KEY=
ARCJET_ENV="development"
# UPSTASH
QSTASH_URL=http://127.0.0.1:8080
QSTASH_TOKEN=
# NODEMAILER
EMAIL_PASSWORD=Running the Project
npm run devTest the API
After starting the server, the API will be accessible at: http://localhost:5500 Requests can be made through a web browser or any HTTP client (e.g., Insomnia, Postman) to verify the endpoints.
Dummy JSON Data
{
"name": "Sports Pro",
"price": 200,
"currency": "BDT",
"frequency": "weekly",
"category": "sports",
"startDate": "2025-11-15T00:00:00.000Z",
"paymentMethod": "Credit Card"
}User Account Creation Example
Example response returned by the API when creating a new user account.
User Sign-in Example
Example response returned by the API when signing in an existing user.
Rate Limit Enforcement Example
Example showing Arcjet enforcing rate limits when too many API requests are made.
Automated Subscription Reminder Email Example
![]()
Automated subscription reminder email example sent to users.
- Arcjet - https://arcjet.com/
- Upstash - https://upstash.com/
- MongoDB - https://www.mongodb.com/
- Node.js - https://nodejs.org/en