SubManager is a Node.js-based subscription management system designed to help users manage, track, and automate workflows for their subscriptions. It provides authentication, user management, subscription tracking, email notifications, and workflow automation features. The project uses MongoDB for data storage and integrates with third-party services for email and security.
- User Authentication: Secure login and registration using JWT.
- Subscription Management: Add, update, delete, and view subscriptions.
- Email Notifications: Automated email reminders and notifications using Nodemailer.
- Workflow Automation: Custom workflows for subscription events.
- Security: Arcjet integration for enhanced security.
- Environment Configuration: Centralized config management for environment variables and service credentials.
app.js # Main application entry point
eslint.config.js # ESLint configuration
package.json # Project metadata and dependencies
config/ # Configuration files for services and environment
controllers/ # Route controllers for business logic
auth.controller.js
subscription.controller.js
user.controller.js
workflow.controller.js
middlewares/ # Express middlewares (auth, error handling, etc.)
models/ # Mongoose models for MongoDB
routes/ # Express route definitions
utils/ # Utility functions (email templates, send email)
database/ # Database connection setup
- Node.js (v18+ recommended)
- npm
- MongoDB instance (local or cloud)
- Clone the repository:
git clone https://github.com/Gaurav0203Shetty/SubManager.git cd SubManager - Install dependencies:
npm install
- Configure environment variables:
- Copy
config/env.js.exampletoconfig/env.jsand update values as needed (MongoDB URI, email credentials, etc).
- Copy
npm startThe server will start on the port specified in your environment configuration.
POST /api/auth/register— Register a new userPOST /api/auth/login— Login and receive JWT
GET /api/user/profile— Get user profilePUT /api/user/profile— Update user profile
GET /api/subscription— List subscriptionsPOST /api/subscription— Add a subscriptionPUT /api/subscription/:id— Update a subscriptionDELETE /api/subscription/:id— Delete a subscription
GET /api/workflow— List workflowsPOST /api/workflow— Create a workflow
- MongoDB: Set your connection string in
config/env.js. - Email: Configure SMTP settings in
config/nodemailer.js. - Arcjet: Security configuration in
config/arcjet.js. - Upstash: For caching or other integrations, see
config/upstash.js.
- Linting:
npm run lint
- Testing: (Add your test framework and instructions here)
- Fork the repository
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/YourFeature) - Create a new Pull Request