A backend API for managing user subscriptions, authentication, and recurring billing or renewal tracking.
This project is a subscription management backend built to handle core production-style API workflows such as user authentication, subscription storage, protected routes, validation, and error handling.
It is designed as a practical backend project that can be extended with reminders, scheduled jobs, analytics, admin features, and deployment to a VPS or cloud platform.
- User registration and login
- Token-based authentication
- Protected API routes
- Create, read, update, and delete subscriptions
- Track renewal dates and billing cycles
- Centralized error handling
- Input validation
- Scalable folder structure for production-style backend apps
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT for authentication
- dotenv for environment configuration
- Nodemon for development
subscription-tracker/
├── src/
│ ├── controllers/
│ ├── database/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── utils/
│ ├── app.js
│ └── server.js
├── .env
├── .gitignore
├── package.json
└── README.mdMake sure you have installed:
- Node.js
- npm
- MongoDB Atlas account or local MongoDB instance
- Git
Clone the repository:
git clone https://github.com/revolution737/subscription-tracker-api.git
cd subscription-tracker-apiInstall dependencies:
npm installCreate a .env file in the root directory and add:
PORT=5000
NODE_ENV=development
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_super_secret_key
JWT_EXPIRES_IN=1dAdd any extra variables your project uses, such as mail service credentials, rate-limiting keys, or scheduled job configuration.
Start the development server:
npm run devStart in production mode:
npm starthttp://localhost:5000/api/v1POST /auth/register- Register a new userPOST /auth/login- Log in an existing user
GET /users/me- Get the logged-in user profile
GET /subscriptions- Get all subscriptions for the logged-in userGET /subscriptions/:id- Get a single subscriptionPOST /subscriptions- Create a new subscriptionPUT /subscriptions/:id- Update a subscriptionDELETE /subscriptions/:id- Delete a subscription
{
"name": "Netflix",
"price": 499,
"currency": "INR",
"billingCycle": "monthly",
"category": "Entertainment",
"startDate": "2026-03-01",
"renewalDate": "2026-04-01",
"paymentMethod": "Credit Card"
}"scripts": {
"dev": "nodemon src/server.js",
"start": "node src/server.js"
}The API uses centralized error handling to return consistent error responses and improve maintainability across routes and controllers.
This project can be deployed to:
- VPS servers
- Render
- Railway
- DigitalOcean
- AWS EC2
For VPS deployment, you can use:
- Nginx as a reverse proxy
- PM2 for process management
- MongoDB Atlas for database hosting
- Email reminders before renewal dates
- Subscription analytics dashboard
- Admin panel
- Role-based access control
- Swagger API documentation
- Unit and integration testing
- Docker support
- CI/CD pipeline
This project is for educational and portfolio purposes. Update the license section based on how you plan to publish or distribute the repository.
Your Name
GitHub: https://github.com/
Would you like me to make this more accurate to the exact course stack and route names instead of keeping it generic?