SaaS Manager is a comprehensive system for managing multiple ERPNext instances. It consists of:
- Main App: Installed on your main server to manage all client sites
- Client App: Installed on each client ERPNext instance to sync data and enforce limits
cd /path/to/your/bench
bench get-app sass_manager
bench --site [your-main-site] install-app sass_manager
bench --site [your-main-site] migrate- Go to SaaS Manager > Subscription Package
- Create packages with:
- Package Name (e.g., "Basic", "Premium", "Enterprise")
- Package Code (unique identifier)
- Maximum Users allowed
- Price and Currency
- Features (optional)
The app automatically sets up scheduled jobs:
- Hourly: Placeholder for server-side tasks
- Daily: Check subscription expiry
- Weekly: Optional cleanup tasks
The API endpoints are automatically available:
/api/method/sass_manager.api.site_api.register_site/api/method/sass_manager.api.site_api.sync_site_data/api/method/sass_manager.api.site_api.get_subscription_status/api/method/sass_manager.api.site_api.update_subscription
See CLIENT_SETUP.md for detailed client-side setup instructions.
From the client site, the registration happens automatically on first sync, or manually:
from sass_manager.utils.client_sync import register_client_site
api_key = register_client_site(
site_name="Client Site Name",
company="Company Name",
client_type="ERP"
)In the main app:
- Go to SaaS Manager > Site Registration
- Find the registered site
- Set:
- Subscription Package
- Subscription Start Date
- Subscription End Date
- Subscription Status: Active
- Is Active: ✓
- Go to SaaS Manager > Site Data Sync
- View synced data from client sites
- Create custom reports using the data
- Site Registration: Manage all client sites
- Subscription Packages: Define packages with user limits
- Site Data Sync: Receive and store synced data
- User Deposits: Track payments
- Reports: Generate usage and revenue reports
- Automatic Sync: Syncs data hourly to main app
- User Limit Enforcement: Enforces user limits based on package
- Subscription Status Check: Checks subscription from main app
curl -X POST https://your-main-app.com/api/method/sass_manager.api.site_api.register_site \
-H "Content-Type: application/json" \
-d '{
"site_url": "https://client-site.com",
"site_name": "Client Site",
"company": "Company Name",
"client_type": "ERP"
}'curl -X POST https://your-main-app.com/api/method/sass_manager.api.site_api.sync_site_data \
-H "Content-Type: application/json" \
-d '{
"api_key": "your-api-key",
"data": {
"total_sales_invoices": 100,
"active_users": 5,
"company": "Company Name"
}
}'Use the report API to get summaries:
import frappe
from sass_manager.api.reports import get_site_summary, get_package_statistics
# Get overall summary
summary = get_site_summary()
# Get package statistics
package_stats = get_package_statistics()- Check client site configuration (
site_config.json) - Verify API key is correct
- Check Error Log on both main and client sites
- Ensure main app is accessible from client site
- Verify hooks are configured on client site
- Check subscription package has
max_usersset - Verify subscription is active
- Check Error Log for limit check errors
- Check subscription dates in Site Registration
- Verify daily scheduled job is running
- Manually update subscription status if needed
For issues or questions:
- Email: akingbolahan12@gmail.com
- Check Error Log in ERPNext
- Review API documentation in README.md