A simple, self-hosted Node.js API for managing subscriptions and users. This repository contains the server-side code (Express + MongoDB) for creating and tracking subscription records.
- Lightweight REST API for subscription tracking
- Authentication via JWT
- MongoDB + Mongoose for data persistence
- Node.js
- Express
- MongoDB (Mongoose)
- User registration and authentication (JWT)
- CRUD operations for subscriptions
- Background/email reminder hooks (configurable)
- Middleware for request validation and error handling
Prerequisites:
- Node.js (v16+ recommended)
- npm or yarn
- A running MongoDB instance (local or hosted)
Install and run locally:
git clone https://github.com/pallapothu30/subscription-tracker-api.git
cd subscription-tracker-api
npm installCreate an environment file at the project root (for example .env) and provide the values used by the app (example keys shown below):
# Server
PORT=5500
# Database
DB_URI=
# JWT
JWT_SECRET=
JWT_EXPIRES_IN=1d
# Optional: other service keys (only if you enable related features)
# ARCJET_KEY=
# QSTASH_TOKEN=Start the server in development:
npm run devThe API will be available at http://localhost:5500 by default.
- Remove or rotate any sample/placeholder keys before deploying to production.
- Do not commit secrets to version control. Use environment variables or a secrets manager.