Yaser-123/PayLoop
โก PayLoop - Subscription management platform with automated workflows, multi-currency support, JWT authentication, and Arcjet security.
๐ PayLoop
Smart Subscription Management & Automated Reminder System
Never miss a subscription renewal again with intelligent automated reminders
๐ Live Demo โข ๐ Documentation โข ๐ ๏ธ Installation
โจ What is PayLoop?
PayLoop is a comprehensive subscription management ecosystem that transforms how you track and manage recurring payments. Built with enterprise-grade security and intelligent automation, it delivers personalized renewal reminders through sophisticated workflow orchestration.
๐ฏ Core Value Proposition
- Zero Missed Renewals: Advanced 4-tier reminder system (7โ5โ2โ1 days)
- Enterprise Security: Multi-layered protection with Arcjet integration
- Intelligent Workflows: Upstash-powered automation that adapts to your schedule
- Universal Compatibility: Support for all major payment methods and currencies
๐ Key Features
๐ Security & Authentication
๐ Smart Management
|
๐ Intelligent Reminders
๐ณ Payment Integration
|
๐ ๏ธ Tech Stack
| Backend | Database | Security | Workflow | Tools |
|---|---|---|---|---|
| Node.js + Express | MongoDB + Mongoose | Arcjet + JWT | Upstash Workflow | Day.js + Nodemailer |
โก Quick Start
Prerequisites
Node.js v16+ | MongoDB | Upstash Account | Arcjet Account1๏ธโฃ Clone & Install
git clone https://github.com/Yaser-123/PayLoop.git
cd PayLoop
npm install2๏ธโฃ Environment Configuration
Create .env.development.local:
# Server Configuration
PORT=5500
SERVER_URL=http://localhost:5500
NODE_ENV=development
# Database
DB_URI=your_mongodb_connection_string
# Authentication
JWT_SECRET=your_super_secure_jwt_secret
JWT_EXPIRES_IN=1d
# Security (Arcjet)
ARCJET_KEY=your_arcjet_key
ARCJET_ENV=development
# Workflow Engine (Upstash)
QSTASH_URL=http://127.0.0.1:8080
QSTASH_TOKEN=your_qstash_token
# Email Service
EMAIL_PASSWORD=your_gmail_app_password3๏ธโฃ Launch Application
# Development Mode
npm run dev
# Production Mode
npm start๐ API Documentation
๐ Authentication Endpoints
POST /api/v1/auth/sign-up - Register New User
POST /api/v1/auth/sign-up
Content-Type: application/json
{
"name": "Mohamed Yaser",
"email": "1ammar.yaser@gmail.com",
"password": "securePassword123"
}Response:
{
"success": true,
"message": "User created successfully!",
"data": {
"userId": "64a7f8b2c1d2e3f4a5b6c7d8",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}POST /api/v1/auth/sign-in - User Login
POST /api/v1/auth/sign-in
Content-Type: application/json
{
"email": "1ammar.yaser@gmail.com",
"password": "securePassword123"
}๐ Subscription Management
POST /api/v1/subscriptions - Create Subscription
POST /api/v1/subscriptions
Authorization: Bearer <your_jwt_token>
Content-Type: application/json
{
"name": "Netflix Premium",
"price": 15.99,
"currency": "USD",
"frequency": "monthly",
"category": "premium",
"startDate": "2025-01-15T00:00:00.000Z",
"paymentMethod": "credit_card"
}Supported Values:
- Categories:
basic,premium,enterprise - Payment Methods:
credit_card,paypal,bank_transfer - Frequencies:
daily,weekly,monthly,yearly - Currencies:
USD,EUR,GBP,INR
GET /api/v1/subscriptions/user/:userId - Get User Subscriptions
GET /api/v1/subscriptions/user/64a7f8b2c1d2e3f4a5b6c7d8
Authorization: Bearer <your_jwt_token>๐๏ธ Project Architecture
PayLoop/
โโโ ๐ app.js # Application entry point
โโโ โ๏ธ config/
โ โโโ arcjet.js # Security configuration
โ โโโ env.js # Environment management
โ โโโ nodemailer.js # Email service setup
โ โโโ upstash.js # Workflow client
โโโ ๐ฎ controllers/
โ โโโ auth.controller.js # Authentication logic
โ โโโ subscription.controller.js # Subscription operations
โ โโโ user.controller.js # User management
โ โโโ workflow.controller.js # Automated workflows
โโโ ๐๏ธ database/
โ โโโ mongodb.js # Database connection
โโโ ๐ก๏ธ middlewares/
โ โโโ arcjet.middleware.js # Security layer
โ โโโ auth.middleware.js # JWT verification
โ โโโ error.middleware.js # Error handling
โโโ ๐ models/
โ โโโ subscription.model.js # Subscription schema
โ โโโ user.model.js # User schema
โโโ ๐ฃ๏ธ routes/
โ โโโ auth.routes.js # Authentication routes
โ โโโ subscription.routes.js # Subscription routes
โ โโโ user.routes.js # User routes
โ โโโ workflow.routes.js # Workflow routes
โโโ ๐ง utils/
โโโ email-template.js # Email templates
โโโ send-email.js # Email utilities
๐ Intelligent Workflow System
PayLoop's workflow engine automatically:
- ๐ฏ Workflow Creation: Triggers when new subscription is added
- ๐ Smart Scheduling: Calculates optimal reminder timing
- ๐ Multi-Tier Alerts: 7โ5โ2โ1 day reminder sequence
- โก State Management: Handles active/inactive/pending states
- ๐ Auto-Cleanup: Stops workflows for expired subscriptions
Workflow Timeline Example
๏ฟฝ Subscription Created โ ๐ Workflow Initiated
โฐ 7 Days Before โ ๐ง First Reminder
โฐ 5 Days Before โ ๐ง Second Reminder
โฐ 2 Days Before โ ๐ง Third Reminder
โฐ 1 Day Before โ ๐ง Final Reminder
๐ณ Renewal Date โ ๐ Workflow Complete
๐ Enterprise Security
Authentication Layer
|
Protection Layer (Arcjet)
|
๐ Deployment Guide
Production Environment Setup
-
Environment Configuration
# Create production environment file touch .env.production.local # Set production variables NODE_ENV=production DB_URI=your_production_mongodb_uri
-
Platform Deployment (Render/Heroku/Vercel)
# Build command npm install # Start command npm start
-
Environment Variables (Set in your hosting platform)
DB_URI- Production MongoDB connectionJWT_SECRET- Production JWT secretARCJET_KEY- Production Arcjet keyQSTASH_TOKEN- Production Upstash token
๏ฟฝโ๐ป About the Developer
๐ค Contributing
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
๏ฟฝ License
This project is licensed under the MIT License - see the LICENSE file for details.
๏ฟฝ PayLoop - Smart Subscription Management
Built with โค๏ธ by Mohamed Yaser
โญ Star this repo if you find it helpful!