A full-featured MERN-stack SaaS platform for domain registration, web hosting, and automated billing – inspired by WHMCS.
📌 Personal Project – Building a production-grade SaaS platform to master full-stack development, system design, and real-world challenges in payment processing, domain management, and background job scheduling.
- ✅ Phase 1 (Complete): Core authentication, security, and user management
- ✅ Phase 2 (Complete): Domain management & GoDaddy API integration
- ✅ Phase 3 (Complete): Payment processing (Razorpay, Stripe) & billing automation
- ✅ Phase 4 (Complete): React frontend with responsive UI
- 🔄 Phase 5 (In Progress): Performance optimization & analytics dashboard
- 📋 Phase 6 (Upcoming): White-label solution & advanced reporting
- API response caching layer (Redis optimization)
- Advanced analytics dashboard with real-time metrics
- Payment reconciliation system
- Email template redesign
- Mobile app (React Native) planning
| Decision | Reasoning | Trade-offs |
|---|---|---|
| MongoDB | Flexible schema for evolving business requirements (invoices, orders, services) | Less suitable for complex joins; needed denormalization strategy |
| Redis + BullMQ | Reliable background job processing with retry logic; essential for domain renewals & payments | Added complexity; required monitoring for queue health |
| JWT + Refresh Tokens | Stateless auth scales better; refresh tokens reduce exposure | Must manage token rotation & blacklisting |
| Express + Modular Routes | Clear separation of concerns (auth, domains, payments modules); easier to test | Requires discipline to maintain folder structure |
| React + Zustand | Simple state management vs Redux complexity; Zustand is lightweight | Limited for highly complex state trees |
- Modular Architecture – Each feature (auth, domains, payments) is self-contained
- Repository Pattern – Data access layer (Mongoose models) separated from business logic
- Service Layer – Business logic in services (email, payment, domain services)
- Queue-Worker Pattern – Background jobs via BullMQ for async operations
- Middleware Pipeline – Express middleware for auth, validation, rate limiting, error handling
- Factory Pattern – Payment gateway selection (Razorpay vs Stripe) at runtime
Challenge: Domain registrations sometimes fail; need retry mechanism
Solution: BullMQ provides:
✅ Automatic retries with exponential backoff
✅ Persistent job storage in Redis
✅ Dead-letter queues for failed jobs
✅ Job progress tracking
✅ Webhook reliability for payment callbacks
Challenge: How to support multiple payment gateways (Razorpay & Stripe) without duplicating code?
Solution Implemented:
// Abstract payment interfaceclassPaymentGateway{createOrder(){}verifyPayment(){}handleWebhook(){}}classRazorpayServiceextendsPaymentGateway{}classStripeServiceextendsPaymentGateway{}// Factory pattern for selectionconstgetPaymentService=(gateway)=>gateway==='razorpay' ? newRazorpayService() : newStripeService();What I Learned:
- Webhook security is critical (signature verification)
- Idempotency keys prevent duplicate payments
- Payment reconciliation is complex (payment vs invoice reconciliation)
Challenge: Check 50,000+ domains daily for renewal. How to avoid timeout & database overload?
Solution Implemented:
• Cron job at 2 AM UTC (low traffic time)
• Batch processing: Process 1000 domains per batch
• Use pagination with cursor (not skip/limit)
• Update only domains within 30 days of expiry
• Log metrics: processed/failed/renewed counts
Result: Reduced job time from 15 mins → 80 seconds
What I Learned:
- Database indexing is critical (created index on expiryDate)
- Batch processing prevents memory spikes
- Cursor pagination > skip/limit for large datasets
Challenge: Prevent abuse on domain search endpoint (expensive GoDaddy API calls)
Solution:
• User-based rate limiting: 10 searches/hour
• IP-based limiting: 100 requests/15 mins
• Redis-backed rate limiter (fast, distributed-ready)
• Different limits for authenticated vs public
What I Learned:
- Rate limiting must be multi-layered
- Sliding window vs fixed window algorithms matter
- Redis is essential for distributed rate limiting
Challenge: User creates DNS record, but also needs to manage it in Route53. How to keep them in sync?
Solution:
- Primary source: MongoDB (user-facing)
- Secondary: Route53 (actual DNS)
- Sync job runs every hour
- Conflict resolution: MongoDB wins (allows local changes)
What I Learned:
- DNS propagation isn't instant
- Need health checks for DNS records
- Eventual consistency is acceptable here
Challenge: Generate 100+ invoices/day. Direct PDF generation is slow.
Solution:
- Queue-based PDF generation (BullMQ)
- Template caching (Handlebars)
- S3 storage for PDFs
- Email trigger after generation
Performance: From 2 seconds/invoice → 200ms
User Login → JWT (15m expiry) + Refresh Token (7d)
↓
Rate limiting: 5 attempts/minute
↓
2FA verification (optional but recommended)
↓
Session stored in Redis (allows logout anywhere)
↓
Refresh token rotation on each use
- ✅ Passwords: Bcrypt (10 rounds salt)
- ✅ Sensitive Data: AES-256-GCM encryption (API keys, payment tokens)
- ✅ CORS: Whitelist specific origins, block in production
- ✅ Helmet.js: Security headers (CSP, X-Frame-Options, etc.)
- ✅ Input Validation: Joi schemas on all endpoints
- ✅ SQL Injection: None (using Mongoose ODM)
- GoDaddy API key: Encrypted in database
- Razorpay/Stripe keys: Environment variables only, never logged
- Webhook secrets: Verified via HMAC-SHA256 signature
| Metric | Target | Achieved |
|---|---|---|
| API Response Time | <200ms | ✅ 120ms avg |
| Domain Search | <500ms | ✅ 350ms avg |
| Invoice Generation | <2s | ✅ 200ms (queued) |
| Dashboard Load | <1s | ✅ 600ms |
| Database Queries | N/A | ✅ Indexed |
Database Indexing
- Compound indexes on frequently queried fields
- TTL index on verification tokens (auto-cleanup)
- Text index on domain names
Redis Caching
- TLD pricing: Cached 1 hour
- User profile: Cached 30 minutes
- Domain availability: Cached 5 minutes
Frontend Optimizations
- Lazy loading routes with React.lazy()
- Image optimization with Vite
- CSS purging via Tailwind
- Production build: ~85KB (gzipped)
Backend Query Optimization
- Lean queries (select only needed fields)
- Pagination with cursor
- Batch operations where possible
- Connection pooling (MongoDB min: 2, max: 10)
- ✅ Unit Tests: Services, utilities, helpers
- ✅ Integration Tests: API endpoints with mocked external APIs
- ✅ E2E Tests: Critical user flows (registration, domain search, payment)
- ✅ Security Tests: Rate limiting, JWT validation, CORS
Backend: 85% coverage
- Services: 95%
- Middleware: 90%
- Utils: 100%
- Controllers: 75%
npm test# Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Generate coverage report| Issue | Impact | Status | Solution |
|---|---|---|---|
| Domain renewal sometimes fails silently | 🔴 High | 🔄 In Progress | Implementing retry mechanism with Slack notifications |
| GoDaddy API rate limiting | 🟡 Medium | ✅ Solved | Cache domain availability for 5 mins |
| Webhook timeout (Razorpay) | 🟡 Medium | ✅ Solved | Queue payment verification, immediate acknowledgment |
| MongoDB slow on large datasets | 🟡 Medium | ✅ Solved | Pagination + compound indexes |
| PDF generation memory leak | 🔴 High | ✅ Solved | Stream-based PDF generation + worker pool |
- ✅ Structured logging with Winston (JSON format for ELK stack)
- ✅ Error tracking ready (can integrate Sentry)
- ✅ Database query profiling enabled in development
- ✅ BullMQ dashboard for job monitoring
- ✅ Custom metrics: API latency, job success rate, payment success rate
- Scaling: How to handle 100k+ concurrent users (caching strategies, load balancing)
- Distributed Systems: Multi-region deployment, eventual consistency
- Payment Systems: PCI compliance, recurring billing, tax calculations
- Analytics: Real-time dashboards, BigQuery integration for reporting
- DevOps: Kubernetes, CI/CD pipelines, infrastructure as code
- Designing Data-Intensive Applications (by Martin Kleppmann)
- System Design Interview (by Alex Xu)
- Production-Ready Microservices (by Susan Fowler)
- JWT Authentication with refresh token rotation
- Role-Based Access Control (RBAC) – Admin & Client roles
- Two-Factor Authentication (2FA) – TOTP-based security
- Email Verification – Secure account creation
- Password Reset – Token-based recovery
- Rate Limiting – Brute force & DDoS protection
- Account Suspension – Admin controls
- Domain Search – Real-time availability checking across multiple TLDs
- GoDaddy API Integration – Automated domain registration
- Domain Transfer – Seamless domain migration with status tracking
- DNS Management – Full control over A, AAAA, CNAME, MX, TXT, SRV records
- Domain Contacts – Registrant, Admin, Tech, Billing contact management
- Domain Security – Lock/Unlock, privacy protection options
- Auto-Renewal – Automatic domain renewal before expiry
- Expiry Tracking – Email notifications for upcoming renewals
- Email Forwarding – Configure email forwarding rules
- Multi-Gateway Support – Razorpay (India) & Stripe (International)
- Wallet System – Customer balance management
- Invoice Management – Automated PDF generation & delivery
- Payment Processing – Secure payment handling with validation
- Invoice History – Complete transaction tracking
- Payment Reminders – Automated email notifications (3 days before due)
- Late Fees – Automatic calculation and application
- Service Suspension – Automatic suspension after 7 days overdue
- Service Termination – Automatic termination after 30 days suspended
- Dynamic Hosting – Managed cloud hosting with SSH/Database access
- Static Hosting – AWS S3 + CloudFront CDN deployment
- Infrastructure Management – EC2, RDS, Route53 integration
- SSL Certificates – AWS ACM integration
- Database Access – MySQL/MariaDB provisioning
- SSH Access – Secure shell credentials
- Service Status – Real-time instance monitoring
- Cron Jobs – Scheduled domain management tasks
- Background Workers – BullMQ-powered job queue
- Domain Expiry Monitoring – Daily checks (24-hour cycle)
- Auto-Renewal Processing – Automatic renewal execution
- Transfer Status Updates – Hourly status tracking
- Email Notifications – Transactional email delivery
- Service Lifecycle Management – Suspension & termination automation
- User Management – View, edit, suspend users
- Dashboard Stats – Revenue, MRR, active services overview
- Audit Logs – Complete activity tracking
- Client Credit Management – Add/deduct wallet balance
- Invoice Management – Create & manage invoices
- System Health – AWS & Database connection status
- Balance Management – Real-time wallet balance
- Add Funds – Top-up via payment gateways
- Pay Invoices – Direct wallet payment option
- Transaction History – Complete transaction log
- Admin Adjustments – Manual credit/debit operations
- Responsive Design – Mobile-first approach
- Dark/Light Mode Ready – Modern UI with Tailwind CSS
- Real-time Updates – Instant feedback on actions
- Dashboard – User overview & quick stats
- Domain Management – Intuitive domain control panel
- Invoice Portal – Download & track payments
- User Settings – Profile management & preferences
| Technology | Purpose |
|---|---|
| React 19 | UI library |
| Vite 7 | Build tool & dev server |
| React Router 7 | Client-side routing |
| Tailwind CSS 4 | Utility-first styling |
| Zustand | State management |
| Axios | HTTP client |
| React Hook Form | Form management |
| Zod | Schema validation |
| Lucide React | Icon library |
| Date-fns | Date formatting |
| React Hot Toast | Toast notifications |
| Technology | Purpose |
|---|---|
| Node.js 20+ | Runtime |
| Express 4 | Web framework |
| MongoDB | Primary database |
| Mongoose | ODM for MongoDB |
| Redis | Caching & sessions |
| BullMQ | Job queue system |
| JWT | Authentication tokens |
| Bcrypt | Password hashing |
| Winston | Logging |
| Morgan | HTTP request logger |
| Joi | Schema validation |
| dotenv | Environment variables |
| Service | Purpose |
|---|---|
| GoDaddy API | Domain registration & management |
| Razorpay | Payment processing (India) |
| Stripe | Payment processing (International) |
| SendGrid/Nodemailer | Email delivery |
| AWS Services | EC2, S3, RDS, Route53, CloudFront, ACM |
| Speakeasy | Two-factor authentication (TOTP) |
| Tool | Purpose |
|---|---|
| Jest | Unit testing |
| Supertest | API testing |
| ESLint | Code linting |
| Nodemon | Dev auto-reload |
| Concurrently | Multi-process management |
backend/
├── src/
│ ├── app.js # Express app configuration
│ ├── server.js # Server entry point
│ ├── config/
│ │ ├── database.js # MongoDB connection
│ │ ├── redis.js # Redis configuration
│ │ └── indexes.js # Database indexes
│ ├── constants/
│ │ └── enums.js # Shared enumerations
│ ├── middleware/
│ │ ├── auth.middleware.js # JWT verification
│ │ ├── errorHandler.middleware.js # Error handling
│ │ ├── rateLimit.middleware.js # Rate limiting
│ │ └── validation.middleware.js # Input validation
│ ├── models/
│ │ ├── User.js, Client.js, Domain.js
│ │ ├── Invoice.js, Transaction.js, Order.js
│ │ ├── Service.js, HostingService.js
│ │ ├── Infrastructure.js, Server.js
│ │ ├── Product.js, ActivityLog.js
│ │ └── ...
│ ├── modules/ # Feature modules
│ │ ├── auth/ # Authentication logic
│ │ ├── domains/ # Domain management
│ │ ├── hosting/ # Hosting services
│ │ ├── payments/ # Payment processing
│ │ ├── invoices/ # Invoice management
│ │ ├── wallet/ # Wallet operations
│ │ ├── clients/ # Client management
│ │ ├── cart/ # Shopping cart
│ │ ├── admin/ # Admin operations
│ │ └── aws/ # AWS integration
│ ├── services/
│ │ ├── email.service.js # Email delivery
│ │ ├── godaddy.service.js # Domain API
│ │ ├── razorpay.service.js # Razorpay payments
│ │ ├── stripe.service.js # Stripe payments
│ │ └── invoice.service.js # Invoice generation
│ ├── queues/
│ │ ├── domain.queue.js # Domain job queue
│ │ ├── hosting.queue.js # Hosting job queue
│ │ ├── dynamicHosting.queue.js
│ │ └── infra.queue.js # Infrastructure queue
│ ├── workers/ # Background job processors
│ │ ├── domainRegistration.worker.js
│ │ ├── domainRenewal.worker.js
│ │ ├── domainTransfer.worker.js
│ │ ├── infraProvision.worker.js
│ │ ├── emailNotification.worker.js
│ │ └── ...
│ ├── cron/ # Scheduled tasks
│ │ ├── domainExpiry.cron.js
│ │ ├── autoRenew.cron.js
│ │ ├── paymentReminders.cron.js
│ │ ├── serviceSuspension.cron.js
│ │ └── ...
│ ├── utils/
│ │ ├── logger.js # Logging utility
│ │ ├── response.js # Response formatting
│ │ ├── encryption.js # Data encryption
│ │ └── helpers.js # Helper functions
│ ├── templates/
│ │ └── emails/ # Email templates
│ └── constants/
│ └── enums.js # Shared enums
├── scripts/
│ ├── seed.js # Database seeding
│ ├── create-indexes.js # Create DB indexes
│ └── rebuild-indexes.js # Rebuild indexes
├── storage/
│ └── invoices/ # Invoice file storage
└── package.json
frontend/
├── src/
│ ├── App.jsx, main.jsx # App entry point
│ ├── config/
│ │ └── api.js # API configuration
│ ├── store/ # Zustand state store
│ ├── services/
│ │ ├── authService.js
│ │ ├── apiService.js
│ │ └── ...
│ ├── layouts/
│ │ ├── DashboardLayout.jsx
│ │ └── MainLayout.jsx
│ ├── pages/
│ │ ├── Home.jsx, Cart.jsx, Checkout.jsx
│ │ ├── DomainSearch.jsx
│ │ ├── auth/ # Auth pages
│ │ └── dashboard/ # Dashboard pages
│ ├── components/
│ │ ├── layout/ # Layout components
│ │ ├── common/ # Reusable components
│ │ ├── forms/ # Form components
│ │ └── ...
│ ├── assets/ # Images, icons
│ └── index.css, App.css
├── vite.config.js # Vite configuration
├── eslint.config.js # ESLint rules
└── package.json
- Node.js 18.0.0 or higher
- npm 9.0.0 or higher
- MongoDB (local or Atlas cloud)
- Redis (local or cloud instance)
- Git
git clone https://github.com/yourusername/saasify.git
cd SaaSifynpm run install:allThis installs dependencies for root, backend, and frontend.
Navigate to the backend directory:
cd backendCreate a .env file:
cp .env.example .envConfigure your .env file with appropriate values (see Environment Variables section).
Create database indexes:
npm run db:indexes(Optional) Seed sample data:
npm run db:seedNavigate to the frontend directory:
cd frontendCreate a .env file:
cp .env.example .envConfigure your API URL in .env:
VITE_API_URL=http://localhost:5000/api
RAZORPAY_KEY_ID=your_razorpay_key_id
From the root directory:
npm run devThis starts both frontend and backend concurrently.
npm run dev:fullStarts API, workers, cron jobs, and frontend.
Backend API:
cd backend
npm run devAPI runs on http://localhost:5000
Background Workers:
cd backend
npm run workerCron Jobs:
cd backend
npm run cronFrontend:
cd frontend
npm run devFrontend runs on http://localhost:5173
| Variable | Description | Example |
|---|---|---|
| Node Environment | ||
NODE_ENV | Environment (development/production) | development |
PORT | API server port | 5000 |
| Database | ||
MONGO_URI | MongoDB connection string | mongodb://localhost:27017/saasify |
MONGO_MAX_POOL_SIZE | Max connection pool size | 10 |
MONGO_MIN_POOL_SIZE | Min connection pool size | 2 |
| Redis | ||
REDIS_HOST | Redis server host | localhost |
REDIS_PORT | Redis server port | 6379 |
REDIS_PASSWORD | Redis password (if any) | `` |
REDIS_DB | Redis database number | 0 |
REDIS_TLS | Enable TLS for Redis | false |
| JWT Authentication | ||
JWT_SECRET | Secret key for JWT signing | your-super-secret-key |
JWT_EXPIRES_IN | Token expiration time | 15m |
JWT_REFRESH_SECRET | Refresh token secret | your-refresh-secret |
JWT_REFRESH_EXPIRES_IN | Refresh token expiration | 7d |
| Cookies | ||
COOKIE_SECRET | Session cookie secret | your-cookie-secret |
SESSION_SECRET | Session secret | your-session-secret |
| CORS | ||
CORS_ORIGIN | Allowed origins (comma-separated) | http://localhost:5173 |
| Frontend | ||
FRONTEND_URL | Frontend application URL | http://localhost:5173 |
| Email Service | ||
EMAIL_PROVIDER | Email provider (sendgrid/smtp) | smtp |
SMTP_HOST | SMTP server host | smtp.gmail.com |
SMTP_PORT | SMTP server port | 587 |
SMTP_USER | SMTP username | your-email@gmail.com |
SMTP_PASS | SMTP password | your-app-password |
SMTP_SECURE | Use TLS? | false |
SENDGRID_API_KEY | SendGrid API key | SG.xxxxx |
EMAIL_FROM | Sender email address | noreply@saasify.com |
EMAIL_FROM_NAME | Sender display name | SaaSify Support |
COMPANY_NAME | Your company name | SaaSify |
SUPPORT_EMAIL | Support email | support@saasify.com |
| GoDaddy API | ||
GODADDY_API_KEY | GoDaddy API key | your-api-key |
GODADDY_API_SECRET | GoDaddy API secret | your-api-secret |
GODADDY_ENV | Environment (OTE/production) | OTE |
| Razorpay | ||
RAZORPAY_KEY_ID | Razorpay Key ID | rzp_test_xxxxx |
RAZORPAY_KEY_SECRET | Razorpay Key Secret | your_secret_key |
RAZORPAY_WEBHOOK_SECRET | Razorpay Webhook Secret | your_webhook_secret |
| Stripe | ||
STRIPE_SECRET_KEY | Stripe Secret Key | sk_test_xxxxx |
STRIPE_PUBLISHABLE_KEY | Stripe Publishable Key | pk_test_xxxxx |
STRIPE_WEBHOOK_SECRET | Stripe Webhook Secret | whsec_xxxxx |
| AWS Services | ||
AWS_REGION | AWS region | us-east-1 |
AWS_ACCESS_KEY_ID | AWS access key | AKIAXXXXXXX |
AWS_SECRET_ACCESS_KEY | AWS secret key | xxxxxxxxxxxxx |
| Rate Limiting | ||
RATE_LIMIT_WINDOW_MS | Rate limit window (ms) | 900000 |
RATE_LIMIT_MAX_REQUESTS | Max requests per window | 100 |
RATE_LIMIT_DOMAIN_SEARCH | Domain search limit | 10 |
| Logging | ||
LOG_LEVEL | Log level (info/debug/error) | info |
LOG_MAX_SIZE | Max log file size | 10m |
LOG_MAX_FILES | Log retention | 7d |
| Encryption | ||
ENCRYPTION_KEY | 32-byte hex key for AES-256-GCM | your-64-char-hex-string |
ENCRYPTION_ALGORITHM | Encryption algorithm | aes-256-gcm |
| Admin Credentials | ||
ADMIN_EMAIL | Default admin email | admin@saasify.com |
ADMIN_PASSWORD | Default admin password | Admin@12345 |
| 2FA | ||
TWO_FACTOR_APP_NAME | 2FA app name for TOTP | SaaSify |
| Variable | Description | Example |
|---|---|---|
VITE_API_URL | Backend API URL | http://localhost:5000/api |
RAZORPAY_KEY_ID | Razorpay Public Key | rzp_test_xxxxx |
http://localhost:5000/api
All authenticated endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <jwt_token>
{
"success": true,
"message": "Operation successful",
"data": {},
"statusCode": 200
}| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST | /register | User registration | ❌ |
POST | /login | User login | ❌ |
POST | /refresh-token | Refresh JWT token | ❌ |
POST | /logout | User logout | ✅ |
POST | /verify-email | Verify email address | ❌ |
POST | /resend-verification | Resend verification email | ❌ |
POST | /forgot-password | Request password reset | ❌ |
POST | /reset-password | Reset password via token | ❌ |
POST | /enable-2fa | Enable two-factor authentication | ✅ |
POST | /verify-2fa | Verify 2FA token | ❌ |
POST | /disable-2fa | Disable 2FA | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET | /me | Get user profile | ✅ |
PATCH | /me | Update user profile | ✅ |
GET | /me/wallet | Get wallet balance | ✅ |
POST | /me/wallet/add | Add wallet funds | ✅ |
GET | /me/activity | Get activity logs | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET | /search | Search domains | |
GET | /availability/:domain | Check domain availability | |
GET | /tlds | Get supported TLDs | ✅ |
GET | /pricing/:tld | Get TLD pricing | ✅ |
POST | /register | Register a domain | ✅ |
GET | /my-domains | List user's domains | ✅ |
GET | /:id | Get domain details | ✅ |
POST | /transfer | Initiate domain transfer | ✅ |
POST | /renew/:id | Renew a domain | ✅ |
PUT | /dns/:domain | Update DNS records | ✅ |
GET | /dns/:domain | Get DNS records | ✅ |
DELETE | /dns/:domain/:type/:name | Delete DNS record | ✅ |
PATCH | /contacts/:domain | Update domain contacts | ✅ |
POST | /lock/:domain | Lock domain | ✅ |
PUT | /forwarding/:domain | Set email forwarding | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST | /razorpay/create-order | Create Razorpay order | ✅ |
POST | /razorpay/verify | Verify Razorpay payment | ✅ |
POST | /stripe/create-intent | Create Stripe payment intent | ✅ |
POST | /stripe/verify | Verify Stripe payment | ✅ |
GET | /transaction-history | Get payment history | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET | / | Get cart items | ✅ |
POST | /add | Add item to cart | ✅ |
PATCH | /:itemId | Update cart item | ✅ |
DELETE | /:itemId | Remove from cart | ✅ |
DELETE | /clear | Clear entire cart | ✅ |
POST | /coupon | Apply coupon code | ✅ |
POST | /checkout | Proceed to checkout | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET | / | List invoices | ✅ |
GET | /:id | Get invoice details | ✅ |
GET | /:id/pdf | Download invoice PDF | ✅ |
POST | /:id/pay | Pay invoice | ✅ |
GET | /stats | Invoice statistics | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET | /balance | Get wallet balance | ✅ |
GET | /transactions | Get transactions | ✅ |
POST | /add-funds | Add funds via payment | ✅ |
POST | /pay-invoice | Pay invoice from wallet | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST | /dynamic/create | Create dynamic hosting | ✅ |
GET | /dynamic/ | List hosting services | ✅ |
GET | /dynamic/:id | Get hosting details | ✅ |
GET | /dynamic/:id/ssh | Get SSH credentials | ✅ |
GET | /dynamic/:id/database | Get database info | ✅ |
POST | /static/create | Create static hosting | ✅ |
GET | /static/ | List static sites | ✅ |
POST | /dns/zones | Create hosted zone | ✅ |
GET | /dns/records/:domainId | Get DNS records | ✅ |
POST | /dns/records/:domainId | Create DNS record | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET | /users | List all users | ✅ Admin |
GET | /users/:id | Get user details | ✅ Admin |
PATCH | /users/:id | Update user | ✅ Admin |
DELETE | /users/:id | Delete user | ✅ Admin |
POST | /users/:id/suspend | Suspend user | ✅ Admin |
POST | /clients/:id/credit | Add client credit | ✅ Admin |
GET | /audit-logs | Get audit logs | ✅ Admin |
GET | /stats | Dashboard statistics | ✅ Admin |
Search for domains:
curl -X GET "http://localhost:5000/api/domains/search?query=example&extensions=com,net" \
-H "Authorization: Bearer YOUR_TOKEN"Register a domain:
curl -X POST "http://localhost:5000/api/domains/register" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "domain": "example.com", "period": 1, "registrant": { "firstName": "John", "lastName": "Doe", "email": "john@example.com" } }'Check wallet balance:
curl -X GET "http://localhost:5000/api/wallet/balance" \
-H "Authorization: Bearer YOUR_TOKEN"Add funds:
curl -X POST "http://localhost:5000/api/wallet/add-funds" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "amount": 100, "gateway": "razorpay" }'Get invoices:
curl -X GET "http://localhost:5000/api/invoices" \
-H "Authorization: Bearer YOUR_TOKEN"Pay an invoice:
curl -X POST "http://localhost:5000/api/invoices/{invoiceId}/pay" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "method": "wallet" }'Get DNS records:
curl -X GET "http://localhost:5000/api/hosting/dns/records/{domainId}" \
-H "Authorization: Bearer YOUR_TOKEN"Add DNS record:
curl -X POST "http://localhost:5000/api/hosting/dns/records/{domainId}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "@", "type": "A", "value": "192.168.1.1", "ttl": 3600 }'Get dashboard stats:
curl -X GET "http://localhost:5000/api/admin/stats" \
-H "Authorization: Bearer ADMIN_TOKEN"Suspend a user:
curl -X POST "http://localhost:5000/api/admin/users/{userId}/suspend" \
-H "Authorization: Bearer ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "reason": "Terms violation" }'cd backend
npm testnpm run test:watchnpm run test:coverageA Postman collection is provided:
- Import
SaaSify_API_Collection.postman_collection.json - Import
SaaSify_Environment.postman_environment.json - Configure environment variables
- Run requests against your API
- Hosting provider (AWS, Heroku, DigitalOcean, etc.)
- Environment variables properly configured
- MongoDB Atlas or self-hosted MongoDB
- Redis instance
- Domain name
Build for Production:
cd backend
npm install
npm run build # If applicableEnvironment Setup:
Ensure all production .env variables are set:
NODE_ENV=production
PORT=5000
MONGO_URI=<production_mongodb_uri>
REDIS_HOST=<production_redis_host>
JWT_SECRET=<strong_random_key>
...
Database Setup:
npm run db:indexes # Create indexesStart Server:
npm startBuild for Production:
cd frontend
npm install
npm run buildDeploy Static Files:
- Upload contents of
dist/folder to:- Netlify, Vercel, AWS S3 + CloudFront, or
- Your web server's static directory
Environment Configuration:
VITE_API_URL=https://api.yourdomain.com
RAZORPAY_KEY_ID=your_production_key
Deploy Workers (for domain registration, renewals, etc.):
cd backend
npm run workerDeploy Cron Jobs (for scheduled tasks):
cd backend
npm run cronCreate Backend Dockerfile:
FROM node:20-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 5000
CMD ["npm", "start"]Create Frontend Dockerfile:
FROM node:20-alpine as builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]Docker Compose:
version: '3.8'services:
mongodb:
image: mongo:7ports:
- "27017:27017"volumes:
- mongo_data:/data/dbredis:
image: redis:7-alpineports:
- "6379:6379"backend:
build: ./backendports:
- "5000:5000"environment:
MONGO_URI: mongodb://mongodb:27017/saasifyREDIS_HOST: redisdepends_on:
- mongodb
- redisfrontend:
build: ./frontendports:
- "80:80"depends_on:
- backendvolumes:
mongo_data:Run with Docker:
docker-compose up -dUse Let's Encrypt:
# With Certbot
sudo certbot certonly --standalone -d yourdomain.comWe welcome contributions! Here's how to get involved:
git clone https://github.com/yourusername/saasify.git
cd SaaSify
git checkout -b feature/your-feature-namegit checkout -b feature/your-feature- Follow the existing code style
- Write clean, maintainable code
- Add comments for complex logic
- Use meaningful commit messages
# Backend testscd backend && npm test# Manual testing
npm run dev:fullgit add .
git commit -m "Add feature: brief description"
git push origin feature/your-feature- Describe changes clearly
- Link related issues
- Request review from maintainers
- Naming: camelCase for variables/functions, PascalCase for classes/components
- Comments: JSDoc for functions, inline comments for logic
- Environment: Use .env.example as template
- Error Handling: Try-catch blocks with proper logging
- Validation: Joi schemas for API input validation
- Domain search hero section
- Features showcase
- Pricing display
- Call-to-action buttons
- Domain overview widget
- Recent activities
- Wallet balance
- Quick actions
- List all owned domains
- Domain details panel
- DNS management interface
- Renewal status tracking
- Invoice list with filters
- Payment history
- Wallet management
- Payment gateway options
This project is licensed under the MIT License – see the LICENSE file for details.
You are free to:
- ✅ Use commercially
- ✅ Modify the code
- ✅ Distribute copies
- ✅ Include in proprietary projects
With the only requirement:
⚠️ Include license and copyright notice
# Check MongoDB is running
mongosh
# Verify connection stringecho$MONGO_URI# Check Redis is running
redis-cli ping
# Should respond: PONG# Find process using port
lsof -i :5000
# Kill processkill -9 <PID>Error: Invalid token
# Generate new encryption key:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# Update JWT_SECRET in .env
- Verify SMTP credentials
- Enable "Less secure apps" for Gmail
- Use app-specific passwords
- Check SendGrid API key if using SendGrid
- Verify API keys are correct
- Check webhook secrets
- Ensure test mode is enabled for development
- Review payment gateway logs
- ✅ Core authentication & authorization
- ✅ Domain search & registration
- ✅ Payment processing (Razorpay, Stripe)
- ✅ Invoice & billing system
- ✅ Wallet functionality
- ✅ Basic React frontend
- 🔄 API response caching optimization
- 🔄 Advanced analytics dashboard
- 🔄 Payment reconciliation UI
- 📋 Mobile app (React Native) - Q2 2026
- 📋 Support ticket system - Q2 2026
- 📋 Advanced reporting with CSV export - Q2 2026
- Multi-currency support
- White-label solution (custom branding)
- Affiliate/reseller program
- Recurring billing with subscriptions
- Advanced security (IP whitelisting, API keys)
- GraphQL API alternative
- Kubernetes deployment ready
- ML-based pricing optimization
- AI support chatbot
- Automated domain suggestions
- Predictive analytics dashboard
- Smart renewal recommendations
For Backend Architecture:
- 📁
backend/src/modules/– Feature modules showing separation of concerns - 📄
backend/src/middleware/auth.middleware.js– JWT & 2FA implementation - 📄
backend/src/services/razorpay.service.js– Payment gateway abstraction - 📄
backend/src/workers/domainRenewal.worker.js– Background job complex logic - 📄
backend/src/cron/– Scheduled job implementations with error handling
For Frontend Quality:
- 📁
frontend/src/pages/– Complex pages like Checkout showing form handling - 📄
frontend/src/services/authService.js– API integration & error handling patterns - 📁
frontend/src/components/– Reusable component architecture with props drilling avoided - 🎨 Tailwind CSS – Mobile-first responsive design implementation
What Shows Developer Maturity:
- ✅ Error Handling: Specific error messages, try-catch blocks, error logging
- ✅ Logging Strategy: Winston with daily rotation, structured JSON logs
- ✅ Input Validation: Joi schemas on all endpoints, frontend validation too
- ✅ Code Organization: Modular structure, single responsibility, easy to test
- ✅ Configuration Management: 12-factor app principles, environment variables
- ✅ Security-First: Encryption, rate limiting, CORS, helmet.js headers
- Documentation: Check
technicaldoc.mdfor technical details - Questions/Feedback: Open an issue on GitHub
- Email:aryan@saasify.com
Built with passion for mastering full-stack development. Inspired by industry standards like WHMCS, but built from scratch to understand real-world SaaS challenges.
Technologies Used:
- Express.js community & best practices
- MongoDB & Mongoose documentation
- AWS comprehensive cloud services
- GoDaddy API documentation
- React ecosystem & patterns
Why I Built This: This project is my deep dive into building production-grade systems. It's not just CRUD operations—it's about understanding:
- How payment systems handle idempotency and reconciliation
- Why background jobs need retry mechanisms and monitoring
- How to design APIs that scale
- Real security concerns (not just auth)
- Performance optimization at scale
- Automated testing and CI/CD
What I'm Most Proud Of:
- Payment gateway abstraction that supports multiple providers
- Robust background job system with retry logic
- Clean separation of concerns across modules
- Security-first implementations (encryption, rate limiting, input validation)
- Handling real-world problems (DNS sync issues, webhook reliability, etc.)
If you're interested in discussing this project, system design, or opportunities:
- GitHub:@AryanCodeWizard
- Email:aryan@saasify.com
- LinkedIn:Connect with me
Currently Seeking: Full-Stack Developer roles / System Design discussions
Last Updated: March 2026
Active Development: Yes, still building and learning! 🚀
Feel free to star ⭐ if this project helped you learn something new!