Skip to content

thedarkking01/Subscription-Tracker

Repository files navigation

node.js express.js mongodb

A Subscription Management System API

📋 Table of Contents

  1. 🤖 Introduction
  2. ⚙️ Tech Stack
  3. 🔋 Features
  4. 🤸 Quick Start
  5. 🕸️ Snippets (Code to Copy)
  6. 🔗 Assets

🤖 Introduction

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.

⚙️ Tech Stack

  • Node.js
  • Express.js
  • MongoDB

🔋 Features

👉 Advanced Rate Limiting and Bot Protection: Secure the whole app with Arcjet.

👉 Database Modeling: Models and relationships using MongoDB & Mongoose.

👉 JWT Authentication: User CRUD operations and subscription management.

👉 Global Error Handling: Input validation and middleware integration.

👉 Logging Mechanisms: For better debugging and monitoring.

👉 Email Reminders: Automating smart email reminders with workflows using Upstash.

and many more, including code architecture and reusability.

👽 API WORKFLOW

API WORKFLOW

🤸 Quick Start

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

Prerequisites

Make sure you have the following installed on your machine:

Cloning the Repository

git clone https://github.com/thedarkking01/Subscription-Tracker.git
cd subscription-tracker-api

Installation

Install the project dependencies using npm:

npm install

Set Up Environment Variables

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

# 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 dev

Open http://localhost:5500 in your browser or any HTTP client to test the project.

🕸️ Snippets

Dummy JSON Data
{
  "name": "Elite Membership",
  "price": 139.00,
  "currency": "USD",
  "frequency": "monthly",
  "category": "Entertainment",
  "startDate": "2025-01-20T00:00:00.000Z",
  "paymentMethod": "Credit Card"

}

🔗 Links

About

This a Fully Backend Production Grade API !!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published