CloudBase Framework Documentation

repository·master·Indexed 24 days ago

https://github.com/tencent/cloudbase-framework

An official full-stack deployment tool from Tencent CloudBase for hosting frontend and backend applications on a Serverless architecture. It includes plugins for container deployment (@cloudbase/framework-plugin-container), authentication (@cloudbase/framework-plugin-auth), and Dart servers (@cloudbase/framework-plugin-dart), as well as builders for Next.js and static assets. It provides a JSON Schema for cloudbaserc.json configuration and supports multiple languages including Node.js, PHP, Java, Go, Dart, and Deno.

Tokens
46.5K
Snippets
106
Records
232
Agent score
82%

What's inside CloudBase Framework

  1. Overview of the Online Meeting application architecture

    master

    The online video meeting application is a WebRTC-based application built using Tencent CloudBase. It leverages the following technologies:

    • CloudBase Framework: Used for project directory structure generation and one-click deployment.
    • Simple Peer: A WebRTC library used for peer-to-peer communication.
    • CloudBase Cloud Functions: Handles backend logic, including scheduled tasks.
    • CloudBase Database: Manages application data.
    • CloudBase Static Website Hosting: Hosts the frontend application.
    • React & Ant Design: Used for building the user interface.
  2. What is CloudBase Framework

    master
    CloudBase Framework is an open-source, cloud-native tool for integrated front-end and back-end deployment. It supports mainstream front-end frameworks and allows for one-click hosting and deployment of both front-end and back-end services on an integrated cloud platform. It supports multiple platforms including Mini Programs (小程序), Web, Flutter, and backend services.
  3. Deploy a Next.js SSR application with @cloudbase/framework-plugin-next

    master
    The @cloudbase/framework-plugin-next plugin allows you to deploy Next.js Server-Side Rendering (SSR) applications to the Tencent CloudBase environment. It provides a high-performance Node SSR service with automatic elastic scaling, meaning you don't need to manually manage underlying functions or containers. You can use this plugin alongside other plugins like the Website or Function plugins for integrated cloud development.
  4. View application examples built with CloudBase Framework

    master

    The CloudBase Framework is used to power a wide variety of production applications, ranging from large-scale enterprise tools to open-source community projects. Examples include:

    • Enterprise & Large Scale: 企业微信 (WeCom), 腾讯直播 (Tencent Live), 腾讯云微搭低代码平台 (Tencent Cloud Low-Code), 腾讯云开源应用中心 (Tencent Cloud Open Source App Center), and 健康码 (Health Code).
    • Community & Open Source:
      • CMS & Content: CloudBase CMS, Twikoo 评论 (Twikoo Comments), Waline 评论系统 (Waline Comment System).
      • Utilities: OneDrive 图床 (OneDrive Image Hosting), 兰空图床 (Lsky Pro), NiceUp, and 可道云网盘 (KodExplorer).
      • Web & Tools: Pagic, CloudBase TodoList, and ShowMess 实时弹幕 (Real-time Danmaku).

    You can find more examples and contribute your own by participating in the community discussions.

  5. Best practices for deploying Deno applications

    master

    When deploying Deno applications to CloudBase, network issues during the container build phase can cause remote dependency loading to fail.

    Recommended Strategy: Local Bundling Instead of relying on the cloud environment to fetch remote dependencies, bundle your application into a single, dependency-free JavaScript file before deployment using the deno bundle command. This significantly increases deployment success rates.

    Development Tip Use tools like denon to manage development execution, environment variables, and permissions, similar to how nodemon is used in Node.js.

  6. Customize WeChat Mini Program instances using ext_json

    master
    In the context of building SaaS products via WeChat Third-party Platforms, developers can use the ext_json configuration to allow tenants to customize their mini-program instances. While the SaaS provider defines a standard template (including Cloud Functions and Cloud Databases), individual merchants (tenants) provide personalized configurations through ext_json. This enables a 'low-code' approach where the application's behavior or appearance is modified via configuration rather than code changes.
  7. Understand the CloudBase Framework Architecture

    master

    The CloudBase Framework is structured into three primary layers designed for cloud development and resource orchestration:

    1. CLI Layer: Adapts to mainstream application frameworks, enabling seamless one-click integration, development, and deployment.
    2. Application Framework Layer: Provides SDKs and components for various languages and frameworks, abstracting underlying cloud resources.
    3. CI/CD Layer: Handles cloud deployment, code platform integration, grayscale releases, and upgrade rollbacks.
  8. Understanding the SaaS Maturity Model (Level 0-4)

    master

    The SaaS maturity model describes the evolution of software delivery from custom development to highly scalable, decentralized systems. The levels are defined as follows:

    • Level 0 (Chaos): Custom development for each client.
    • Level 1 (Managed Chaos): Configurable software.
    • Level 2 (Multi-Tenant, Highrise): Configurable and multi-tenant (single instance serving multiple tenants).
    • Level 3 (Multi-Tenant, Build-Out): Scalable, configurable, and multi-tenant.
    • Level 4 (Utopia): Similar to Level 3, but utilizes an efficient way to run different versions of the software on different "instances," allowing for true decentralization and isolation.
  9. How the CloudBase Framework plugin mechanism works

    master

    The framework uses a plug-in mechanism to integrate application frameworks and cloud resources with minimal configuration. Plugins handle specific lifecycle stages such as construction, deployment, development, and debugging for independent units (e.g., static websites or Node.js applications).

    Key details:

    • Configuration: Plugins are configured in the cloudbaserc.json file (YAML support is planned for the future).
    • Automatic Detection: For front-end frameworks, the framework can automatically identify and fill in plugin configurations.
    • Combination: Multiple plugins can be used together in a single project.

    Automatic detection workflow:

    1. Run cloudbase init --without-template to generate the initial project configuration.
    2. Run cloudbase framework deploy to automatically detect, generate plugin configuration files, and deploy.
  10. How CloudBase Framework plugins work

    master

    CloudBase Framework uses a plugin mechanism to handle the building, deployment, development, and debugging of independent units within an application. Plugins can manage different types of resources, such as static websites or Node.js applications, and can be composed together in a single project.

    Plugin configurations are defined in a cloudbaserc file. Currently, only JSON format is supported, though YAML support is planned for the future.