Skip to content

Sweta-82/SaaSify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SaaSify - Complete MERN Hosting Platform

πŸŽ‰ ALL PHASES COMPLETE πŸŽ‰

A production-ready hosting and domain management platform built with the MERN stack - similar to WHMCS.

πŸ“‹ Project Status

  • βœ… Phase 1: Authentication & Core Setup
  • βœ… Phase 2: Domain Management
  • βœ… Phase 3: Payments & Billing
  • βœ… Phase 4: Frontend UI

πŸ› οΈ Technology Stack

Backend: Node.js, Express, MongoDB, Redis, BullMQ, JWT, Razorpay, Stripe, GoDaddy API Frontend: React 19, Vite 7, React Router 7, Tailwind CSS 4, Zustand, Axios

πŸš€ Quick Start

Prerequisites

  • Node.js 16+
  • MongoDB
  • Redis

Backend Setup

cd backend
npm install
cp .env.example .env  # Configure environment variables
npm run dev           # Starts on http://localhost:5000

Frontend Setup

cd frontend
npm install
cp .env.example .env  # Configure API URL
npm run dev           # Starts on http://localhost:5173

✨ Key Features

Authentication & Security

  • JWT authentication with refresh tokens
  • Role-based access control (Admin/Client)
  • Two-factor authentication (2FA)
  • Email verification
  • Password reset functionality
  • Rate limiting & brute force protection

Domain Management

  • Domain search across multiple TLDs
  • Real-time availability checking
  • Domain registration via GoDaddy API
  • Domain transfer management
  • DNS record management (A, AAAA, CNAME, MX, TXT, SRV)
  • Domain contacts management
  • Domain lock/unlock
  • Auto-renewal system
  • Expiry tracking & notifications

Billing & Payments

  • Automated invoice generation
  • Multiple payment gateways:
    • Razorpay (Indian market)
    • Stripe (International)
    • Wallet payments
  • Invoice PDF generation
  • Email invoice delivery
  • Payment reminders
  • Late fee calculation
  • Service suspension workflow

Wallet System

  • Customer wallet balances
  • Add funds functionality
  • Pay invoices from wallet
  • Transaction history
  • Admin balance adjustments

Automation & Background Jobs

  • Domain expiry monitoring (daily)
  • Auto-renewal processing (daily)
  • Transfer status updates (hourly)
  • Payment reminders (3 days before due)
  • Service suspension (7 days overdue)
  • Service termination (30 days suspended)
  • Email notifications

Frontend Features

  • Responsive React application
  • User dashboard with overview stats
  • Domain management interface
  • Invoice listing & payment
  • Wallet management
  • User profile & settings
  • Mobile-responsive design

πŸ“ Project Structure

SaaSify/
β”œβ”€β”€ backend/              # Express.js API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/       # Database, Redis, indexes
β”‚   β”‚   β”œβ”€β”€ cron/         # Scheduled jobs (6 cron jobs)
β”‚   β”‚   β”œβ”€β”€ middleware/   # Auth, validation, error handling
β”‚   β”‚   β”œβ”€β”€ models/       # Mongoose schemas (10 models)
β”‚   β”‚   β”œβ”€β”€ modules/      # Feature modules (8 modules)
β”‚   β”‚   β”œβ”€β”€ queues/       # BullMQ queues
β”‚   β”‚   β”œβ”€β”€ services/     # Business logic
β”‚   β”‚   β”œβ”€β”€ workers/      # Background workers (5 workers)
β”‚   β”‚   └── utils/        # Helpers, logger, encryption
β”‚   └── storage/          # File storage
β”‚
β”œβ”€β”€ frontend/             # React + Vite application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/       # API configuration
β”‚   β”‚   β”œβ”€β”€ store/        # Zustand state management
β”‚   β”‚   β”œβ”€β”€ services/     # API services (6 services)
β”‚   β”‚   β”œβ”€β”€ layouts/      # Layout components
β”‚   β”‚   β”œβ”€β”€ components/   # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/        # Page components (13 pages)
β”‚   β”‚   └── App.jsx       # Main app with routing
β”‚   └── public/           # Static assets
β”‚
└── docs/                 # Documentation

πŸ“š API Documentation

60+ API Endpoints organized into modules:

  • Authentication (13 endpoints): Register, login, 2FA, email verification, password reset
  • Domains (17 endpoints): Search, register, transfer, DNS, contacts, renewal
  • Invoices (9 endpoints): List, view, pay, generate PDF, admin operations
  • Payments (7 endpoints): Razorpay & Stripe integration, webhooks, refunds
  • Wallet (6 endpoints): Balance, transactions, add funds, pay invoices
  • Cart (8 endpoints): Add, update, remove items, coupon, checkout

See backend/SaaSify_API_Collection.postman_collection.json for full API documentation.

πŸ—„οΈ Database Models

  1. User: Authentication & roles
  2. Client: Customer profiles
  3. Domain: Domain registrations
  4. Product: Service catalog
  5. Order: Purchase orders
  6. Service: Active services
  7. Invoice: Billing documents
  8. Transaction: Payment records
  9. Wallet: Customer balances
  10. ActivityLog: Audit trail

πŸ” Environment Variables

Backend .env

NODE_ENV=development
PORT=5000

MONGODB_URI=mongodb://localhost:27017/saasify
REDIS_URL=redis://localhost:6379

JWT_SECRET=your-secret-key
JWT_REFRESH_SECRET=your-refresh-secret

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-password

GODADDY_API_KEY=your-godaddy-key
GODADDY_API_SECRET=your-godaddy-secret

RAZORPAY_KEY_ID=your-razorpay-key
RAZORPAY_KEY_SECRET=your-razorpay-secret

STRIPE_SECRET_KEY=your-stripe-secret
STRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key

Frontend .env

VITE_API_URL=http://localhost:5000/api

πŸ§ͺ Testing

Import the Postman collection:

backend/SaaSify_API_Collection.postman_collection.json

πŸ“– Documentation

🎯 Future Enhancements

  • Support ticket system
  • Live chat integration
  • Advanced analytics & reporting
  • Bulk domain operations
  • Hosting services (Shared, VPS, Dedicated)
  • Mobile application
  • White-label solution

πŸ› Troubleshooting

MongoDB connection error: Ensure MongoDB is running on port 27017 Redis connection error: Start Redis with redis-server Frontend can't connect: Check VITE_API_URL matches backend URL Workers not running: Start with npm run workers in backend folder

πŸ“¦ Deployment

See PROJECT_COMPLETE.md for detailed deployment instructions.

πŸ“„ License

Proprietary - All rights reserved

πŸ™ Acknowledgments

Built with modern technologies and best practices for production-ready hosting platforms.


Version: 1.0.0
Last Updated: January 2025
Status: Production Ready βœ…

About

Hosting Management Automation System (HMAS)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors