Welcome to the Subscription Tracker API, a powerful and scalable backend solution designed to help users manage their subscriptions efficiently. Built with Node.js, Express.js, and MongoDB, this API provides a robust foundation for subscription management, complete with advanced features like JWT authentication, rate limiting, automated email reminders, and more. Whether you're building a subscription management app or integrating subscription tracking into your existing system, this API is here to simplify your workflow.
Here’s a glimpse of the technologies and tools used to build this API:
Category | Technology |
---|---|
Backend | Node.js, Express.js |
Database | MongoDB (with Mongoose for ODM) |
Authentication | JSON Web Tokens (JWT) |
Security | Arcjet (Rate Limiting & Bot Protection) |
Email Automation | Upstash (Serverless Redis) & Nodemailer |
Logging | Custom logging mechanisms for debugging and monitoring |
Environment | Dotenv for environment variable management |
- User Authentication: Secure JWT-based authentication for user registration, login, and management.
- Subscription Management: Create, read, update, and delete (CRUD) operations for subscriptions.
- Database Modeling: Efficient data modeling using MongoDB and Mongoose for seamless data management.
- Global Error Handling: Centralized error handling and input validation for a smooth user experience.
- Logging & Monitoring: Built-in logging mechanisms for debugging and performance monitoring.
- Rate Limiting & Bot Protection: Protect your API from abuse with Arcjet’s advanced security features.
- Automated Email Reminders: Set up smart email workflows using Upstash and Nodemailer to notify users about subscription renewals.
- Modular Codebase: Clean, reusable, and well-structured code for easy maintenance and scalability.
Follow these steps to set up the Subscription Tracker API on your local machine.
Before you begin, ensure you have the following installed:
Clone the repository to your local machine:
git clone https://github.com/hamawebdev/subscription-tracker-api.git
cd subscription-tracker-api
Install all the required dependencies using npm:
npm install
Create a .env.local
file in the root directory and add the following environment variables:
# 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=
Start the development server:
npm run dev
Once the server is running, open http://localhost:5500 in your browser or use an HTTP client like Postman to test the API.