Cloud Hosting

A comprehensive cloud infrastructure management system built with Frappe Framework for managing customers, resources, billing, and support.

Install Cloud Hosting

bench get-app https://github.com/mohamedgamal45031/cloud-hosting

Add the Frappe Gems badge to your README

Maintain Cloud Hosting? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=mohamedgamal45031%2Fcloud-hosting)](https://frappegems.com/gems/apps/mohamedgamal45031/cloud-hosting)

About Cloud Hosting

Cloud Hosting Management Module

A comprehensive cloud infrastructure management system built with Frappe Framework for managing customers, resources, billing, and support.

Overview

This module provides a complete solution for cloud hosting providers to manage their business operations including:

  • Customer Management: Track customer information, account status, and billing details
  • Resource Management: Manage cloud resources (VPS, storage, databases, etc.) with lifecycle tracking
  • Billing & Payments: Automated invoice generation, payment processing, and financial tracking
  • Support System: Ticket management with automated assignment and SLA tracking
  • Role-based Access: Separate interfaces for staff and customers with appropriate permissions
  • Portal Experience: Self-service customer portal and comprehensive staff dashboard

Architecture

Core DocTypes

  1. Cloud Customer: Central customer record with contact info, billing details, and account status
  2. Cloud Resource: Individual cloud resources with specifications, pricing, and lifecycle management
  3. Cloud Invoice: Billing documents with automated generation and payment tracking
  4. Cloud Invoice Item: Line items for invoices (child table)
  5. Cloud Payment: Payment records with gateway integration support
  6. Support Ticket: Customer support requests with assignment and resolution tracking

Relationships

Cloud Customer (1) ←→ (many) Cloud Resource
Cloud Customer (1) ←→ (many) Cloud Invoice
Cloud Customer (1) ←→ (many) Cloud Payment
Cloud Customer (1) ←→ (many) Support Ticket
Cloud Invoice (1) ←→ (many) Cloud Invoice Item
Cloud Invoice (1) ←→ (many) Cloud Payment

Roles & Permissions

Cloud Staff Role

  • Full access to all DocTypes
  • Can create, read, update, and delete all records
  • Access to staff dashboard and administrative functions
  • Can process payments and manage customer accounts

Cloud Customer Role

  • Limited access to their own records only
  • Can view their resources, invoices, and tickets
  • Can create support tickets and update profile
  • Access to customer portal interface
  • Cannot modify billing or resource configurations

Features

Customer Management

  • Comprehensive customer profiles with contact and billing information
  • Account status tracking (Active, Suspended, Cancelled)
  • Credit limit and payment terms management
  • Automated balance calculations
  • Customer portal access with role-based permissions

Resource Management

  • Support for multiple resource types (VPS, Storage, Database, CDN, etc.)
  • Lifecycle management (Pending → Active → Suspended → Cancelled)
  • Automated billing date calculations
  • Resource specifications and configuration tracking
  • IP address and hostname management

Billing System

  • Automated monthly invoice generation
  • Multiple billing cycles (Monthly, Quarterly, Annual)
  • Tax calculation and management
  • Payment terms and due date automation
  • Outstanding balance tracking
  • Email notifications for invoices and overdue payments

Payment Processing

  • Multiple payment method support
  • Payment status tracking and validation
  • Automatic invoice updates upon payment
  • Refund processing capabilities
  • Payment confirmation emails

Support System

  • Ticket categorization and prioritization
  • Automatic assignment based on department and workload
  • SLA tracking with response time metrics
  • Status updates with customer notifications
  • Internal notes and resolution tracking

Portal & Dashboard

  • Customer Portal: Self-service interface for customers
    • Dashboard with key metrics and alerts
    • Resource management and usage viewing
    • Invoice viewing and payment processing
    • Support ticket creation and tracking
  • Staff Dashboard: Comprehensive management interface
    • Business metrics and KPIs
    • Financial overview and alerts
    • Resource utilization statistics
    • Support ticket management
    • Quick actions and bulk operations

Installation

Prerequisites

  • Frappe Framework (v13+)
  • ERPNext (optional, for enhanced accounting features)

Setup Steps

  1. Install the app:

    bench get-app cloud_hosting /path/to/cloud_hosting
    bench install-app cloud_hosting
    
  2. Run setup script:

    bench execute cloud_hosting.cloud_hosting.setup.setup_cloud_hosting
    
  3. Create roles and permissions:

    bench migrate
    
  4. Setup email configuration (optional):

    • Configure SMTP settings in ERPNext
    • Customize email templates as needed

Configuration

  1. Create initial staff user:

    • Create a user with "Cloud Staff" role
    • This user will have access to the management dashboard
  2. Configure naming series:

    • Invoices: INV-.YYYY.-
    • Payments: PAY-.YYYY.-
    • Tickets: TKT-.YYYY.-
  3. Setup customer portal:

    • Enable portal in website settings
    • Configure portal menu items
    • Customize branding and styling

Usage

For Cloud Staff

  1. Customer Onboarding:

    • Create Cloud Customer record
    • Set payment terms and credit limits
    • Create initial cloud resources
    • Send welcome email with portal access
  2. Resource Management:

    • Provision new resources through Cloud Resource DocType
    • Update resource specifications and pricing
    • Monitor resource lifecycle and billing dates
    • Handle suspension/activation as needed
  3. Billing Operations:

    • Generate monthly invoices automatically
    • Process payments and update account balances
    • Handle overdue accounts and collections
    • Generate financial reports
  4. Support Management:

    • Monitor ticket queue and assignments
    • Respond to customer inquiries
    • Track resolution times and SLAs
    • Manage escalations and follow-ups

For Customers

  1. Portal Access:

    • Login with registered email address
    • View dashboard with account overview
    • Access all account information and history
  2. Resource Management:

    • View active resources and specifications
    • Monitor usage and performance (if integrated)
    • Request new resources or modifications
    • Track resource billing and costs
  3. Billing & Payments:

    • View invoices and payment history
    • Make payments online (with gateway integration)
    • Download invoice PDFs
    • Update billing information
  4. Support:

    • Create support tickets
    • Track ticket status and responses
    • Access knowledge base (if implemented)
    • Rate support experiences

Customization

Adding Custom Fields

# Example: Add custom field to Cloud Customer
custom_fields = {
    "Cloud Customer": [
        {
            "fieldname": "tax_id",
            "label": "Tax ID",
            "fieldtype": "Data",
            "insert_after": "company"
        }
    ]
}
create_custom_fields(custom_fields)

Custom Resource Types

Edit the resource_type field options in Cloud Resource DocType:

VPS
Cloud Storage
Dedicated Server
Load Balancer
Database
CDN
Backup Service
Monitoring Service
Custom Service

Email Templates

Customize email templates in the Email Template DocType:

  • Customer Welcome
  • Resource Activation
  • Invoice Notifications
  • Payment Confirmations
  • Support Updates

Portal Customization

  • Modify templates in cloud_hosting/www/cloud-portal/
  • Update styling in the HTML templates
  • Add custom JavaScript for enhanced functionality

Integration

Payment Gateways

Extend the make_payment API method to integrate with:

  • Stripe
  • PayPal
  • Square
  • Bank payment gateways

Monitoring Systems

Integrate with monitoring tools to populate resource usage data:

  • Prometheus
  • Grafana
  • CloudWatch
  • Custom monitoring APIs

Provisioning Systems

Connect with infrastructure providers:

  • AWS API
  • DigitalOcean API
  • Custom virtualization platforms

API Reference

Customer Portal APIs

All APIs require authentication and return JSON responses.

Get Portal Data

GET /api/method/cloud_hosting.api.customer_portal.get_customer_portal_data

Create Support Ticket

POST /api/method/cloud_hosting.api.customer_portal.create_support_ticket
Parameters: subject, description, priority, category

Make Payment

POST /api/method/cloud_hosting.api.customer_portal.make_payment
Parameters: invoice, amount, payment_method

Get Resource Usage

GET /api/method/cloud_hosting.api.customer_portal.get_resource_usage
Parameters: resource

Development

Project Structure

cloud_hosting/
├── cloud_hosting/
│   ├── doctype/           # DocType definitions
│   ├── www/               # Web pages and portal
│   ├── api/               # API endpoints
│   ├── fixtures/          # Default data
│   └── setup.py           # Installation script
├── hooks.py               # App configuration
└── README.md

Adding New Features

  1. New DocType: Create in cloud_hosting/doctype/
  2. New API: Add to cloud_hosting/api/
  3. New Portal Page: Create in cloud_hosting/www/
  4. Custom Scripts: Add to respective DocType folders

Testing

Run tests with:

bench run-tests --app cloud_hosting

Support & Contributing

Getting Help

  • Review this documentation
  • Check Frappe Framework documentation
  • Create GitHub issues for bugs
  • Join the community forum

Contributing

  1. Fork the repository
  2. Create feature branch
  3. Make changes with tests
  4. Submit pull request

License

MIT License - see LICENSE file for details.

Changelog

Version 0.0.1 (Initial Release)

  • Core DocTypes and relationships
  • Basic customer and resource management
  • Invoice generation and payment tracking
  • Support ticket system
  • Customer portal and staff dashboard
  • Role-based permissions
  • Email notifications
  • API endpoints for portal integration

Related Accounting apps for Frappe & ERPNext

  • Books — Free Accounting Software
  • Lending — Open Source Lending software
  • Payments — A payments app for frappe
  • Banking — Load your bank transactions into ERPNext and reconcile them with your vouchers.
  • Erpnext Quota — App to manage ERPNext Site, User, Company and Space limitations
  • Utility Billing — The Utility Billing & Property Management App is a powerful addition to ERPNext, designed to streamline utility billing, property leasing, and tenant management. Ideal for municipal utilities, real estate managers, and property developers.
  • Expense Request — ERPNext Expense Requests
  • Vendor Payments — A frappe app that has workflows and reports to make payments to vendors by a company and track them