Whitepaper v2.5.0

Enterprise SaaS Platform for ERP Deployment Built from scratch — Powers ERPNext, Odoo, and more

A comprehensive whitepaper outlining our advanced multi-tenant SaaS platform that revolutionizes how enterprises deploy, manage, and scale ERP systems with AI-driven automation, seamless provisioning, and enterprise-grade security.

60+
Database Models

Comprehensive data structure for enterprise management

200+
API Endpoints

RESTful API for seamless integration and automation

50+
Shell Scripts

Automated deployment and management scripts

99.9%
Uptime Target

Enterprise-grade reliability and availability

Independent SaaS Core Platform

Our platform is a standalone, multi-tenant SaaS architecture built from the ground up. It serves as the foundation engine that can automatically generate, deploy, and manage complete ERP systems like ERPNext and Odoo as fully isolated tenant instances.

  • Not a fork or modification of any existing ERP
  • Original codebase developed entirely by Techstation
  • ERP-agnostic architecture – can deploy multiple ERP solutions
Core SaaS Platform

Multi‑tenant management, billing, users, automation

ERP Deployment Engine

Generates fresh ERP instances (ERPNext, Odoo, etc.)

Tenant Instances

Fully isolated ERP systems for each customer

Platform Overview

The Managely SaaS Platform is a robust, scalable solution designed to manage the complete lifecycle of ERP system deployments with advanced SaaS management capabilities.

Built with modern web technologies, the platform supports multi-tenancy, role-based access control, geo-based access control, and seamless integration with external services. It handles everything from user registration and authentication to subscription management, automated deployment, license validation, add-on marketplace, and maintenance scheduling.

60+ Database Models

Comprehensive data structure for enterprise management

200+ API Endpoints

RESTful API for seamless integration

Real-time Processing

WebSocket support for live updates

Background Workers

Automated job processing system

Project Components

This platform consists of three integrated projects:

1
System Creation

Allows users to create systems and view project details and packages.

2
SaaS Management

Provides full SaaS management and control with comprehensive features.

3
Worker Module

Background processing system for automated operations and scheduled tasks.

System Architecture

High-Level Architecture
┌─ Presentation Layer
├─ Web Browser (Bootstrap UI)
└─ Mobile Browser
├─ Application Layer
├─ Flask Application
├─ Socket.IO Server
├─ Background Scheduler
└─ API Gateway
├─ Service Layer
├─ User Management Service
├─ Billing & Wallet Service
├─ Deployment Service
└─ License Management Service
├─ Data Layer
├─ PostgreSQL Database
├─ Redis Cache
└─ File Storage
└─ External Services
├─ Payment Gateways
├─ Email/SMS Services
└─ Third-party APIs
Technology Stack
Component Technology
Backend Framework Flask (Python 3.9+)
Database PostgreSQL 13+
Caching Redis
Frontend Bootstrap 5, JavaScript
Real-time Socket.IO, WebSockets
Task Queue APScheduler
Authentication JWT, OAuth 2.0
Deployment Automated Deployment Scripts
Key Design Patterns
Repository Pattern Data access abstraction
Factory Pattern Object creation patterns
Observer Pattern Event-driven notifications
Strategy Pattern Commission calculation

Core Features

Advanced Security

  • Dual-layer license validation
  • Role-based access control
  • GeoIP-based filtering
  • Device fingerprinting
  • Two-factor authentication

Billing & Subscriptions

  • Multi-tier package system
  • Wallet-based payments
  • Automated invoicing
  • Loyalty points system
  • Special pricing agreements

Deployment Management

  • Multi-server deployment
  • Automated launch creation
  • Domain management
  • Resource monitoring
  • Backup management

User Management

  • Multi-role system (15+ roles)
  • Team collaboration tools
  • Referral system with commissions
  • Activity tracking
  • Google OAuth 2.0 integration

Add-On Marketplace

  • Extensible add-on system
  • Package-restricted availability
  • Real-time installation tracking
  • Background worker integration
  • Dependency management

Worker Module

  • Background job processing
  • Email queue management
  • Scheduled tasks
  • Maintenance scheduling
  • Health monitoring

Core Modules

Comprehensive security layer with license validation and multiple authentication methods.

license_validation.py

def _ensure_license(app, fatal=False):
    try:
        ok, status, _, msg = _validate_now(app)
        _LIC_CACHE["validate"].update({
            "ts": time.time(),
            "valid": ok,
            "status": status,
            "expiry": None,
            "msg": msg
        })
        if not ok:
            _quiet_log("License invalid or expired.")
            if fatal:
                time.sleep(0.2)
                os._exit(3)
        return ok
    except Exception:
        _quiet_log("License check failed.")
        if fatal:
            time.sleep(0.2)
            os._exit(3)
        return False
                                    

Flexible billing system supporting multiple payment methods and subscription models.

billing_processor.py

def process_invoice_payment(invoice):
    # Check wallet balance
    wallet = Wallet.query.filter_by(user_id=invoice.user_id).first()
    if float(wallet.balance or 0.0) < float(invoice.amount or 0.0):
        return {"error": "Insufficient wallet balance"}
    
    # Mark invoice paid
    invoice.status = 'paid'
    
    # Activate subscription
    if invoice.subscription:
        subscription.status = 'active'
    
    # Deduct wallet and create transaction
    wallet.balance -= invoice.amount
    transaction = WalletTransaction(...)
    db.session.add(transaction)
    
    db.session.commit()
    return {"success": True}
                                    

Background job processing system for automated operations and scheduled tasks.

worker_operations.py

def claim_next_operation(status='pending'):
    # Check maintenance status
    if is_maintenance_active():
        logger.info(f"[{WORKER_ID}] Maintenance active, skipping.")
        return None
    
    # Query with row locking for concurrent safety
    candidate = (
        db.session.query(SaaSOperation)
        .filter_by(status=status)
        .order_by(priority_order, SaaSOperation.created_at.asc())
        .with_for_update(skip_locked=True)
        .first()
    )
    
    if candidate:
        # Update operation status
        candidate.status = 'in_progress'
        candidate.started_at = datetime.now(timezone.utc)
        db.session.commit()
        return candidate
    
    return None
                                    

Extensible add-on system with installation tracking and availability rules.

addon_installer.py

def install_app_by_portal():
    # Validate add‑on and launch eligibility
    addon = AddonApp.query.get_or_404(addon_app_id)
    launch = Launch.query.filter_by(domain_url=launch_domain).first_or_404()
    
    # Business rule checks
    if addon.requires_paid_subscription and not user_package:
        return jsonify({"error": "Paid subscription required"}), 403
    
    # Create installation record
    new_install = UserInstalledAddon(
        user_id=launch.user_id,
        addon_app_id=addon.id,
        launch_id=launch.id,
        install_session_id=secrets.token_hex(8),
        status='inprogress'
    )
    
    # Queue SaaS operation
    new_op = SaaSOperation(
        operation_type='INSTALL_ADDON',
        script_name='install_app_by_portal.sh',
        status='pending'
    )
    
    db.session.add_all([new_install, new_op])
    db.session.commit()
    
    return jsonify({"success": True, "message": "Installation queued"})
                                    

System Workflows

User Registration Flow
1
User visits registration page
2
GeoIP country validation
3
Email uniqueness check
4
Create user record & wallet
5
Send verification email/SMS
6
Verify user code
7
Redirect to dashboard
Launch Creation Flow
1
Validate user subscription
2
Check domain availability
3
Create launch record
4
Queue deployment task
5
Worker processes task
6
Execute deployment script
7
Update launch status
8
Send notifications

Technical Details

Database Schema Example
database_schema.sql

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    email VARCHAR(255) UNIQUE NOT NULL,
    google_id VARCHAR(255),
    referral_code VARCHAR(50),
    is_staff INTEGER DEFAULT 0,
    is_active BOOLEAN DEFAULT true,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE saas_operations (
    id SERIAL PRIMARY KEY,
    operation_type VARCHAR(100),
    script_name VARCHAR(255),
    arguments TEXT,
    status VARCHAR(50) DEFAULT 'pending',
    priority VARCHAR(20) DEFAULT 'medium',
    assigned_worker_id VARCHAR(50),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE subscriptions (
    id SERIAL PRIMARY KEY,
    user_id INTEGER REFERENCES users(id),
    package_id INTEGER REFERENCES packages(id),
    status VARCHAR(50) DEFAULT 'waiting_payment',
    price DECIMAL(10,2),
    start_date TIMESTAMP,
    end_date TIMESTAMP,
    auto_renew BOOLEAN DEFAULT true
);
                            
Configuration Example
config.py

# Database Configuration
DATABASE_URL=postgresql://user:pass@localhost/XYZ
SECRET_KEY=XYZ

# Worker Configuration
WORKER_ID=worker-01
WORKER_MODE=public
CHECK_INTERVAL=5

# External Services
LICENSE_VALIDATE_URL=XYZ
GEOIP_DB_PATH=XYZ

# Feature Flags
BLOCK_NEW_USERS_BY_COUNTRY=True
ENABLE_WHATSAPP_VERIFICATION=True
ENABLE_GOOGLE_OAUTH=True

# Cache TTLs (seconds)
LIC_VALIDATE_TTL_SECONDS=604800    # 7 days
USER_SESSION_TTL=86400             # 24 hours

# Performance Settings
MAX_DATABASE_CONNECTIONS=20
BACKGROUND_WORKER_THREADS=4
                            

Dashboard Interfaces

User Control Panel

Complete user experience for system and subscription management

Admin Control Panel

Complete platform, customer, and resource management

Test Our ERP Deployment Technology — Live & Instant

Experience how our technology deploys a full ERP system in minutes. A real, hands-on preview of the engine powering our SaaS architecture.

Real deployment
Full access
No credit card required

Building Your Own Platform? We Can Help

If you're developing your core SaaS/ERP platform and need:

  • Ready-made multi-tenant architecture
  • Automated deployment & hosting management
  • Integrated billing & subscription system
  • Advanced security & dual licensing
We don't just sell products—we build the solution that fits your business

The technology you see here is the same foundation we use for custom enterprise solutions