Background and Introduction

CloudBase is an integrated cloud service platform with serverless architecture. Developers do not need to care about server construction and management, but only need to write business code and call the cloud capabilities provided by native, so they can quickly build complete small programs/games, H5, Web, mobile apps and other applications. Cloud development is the leading practice of Serverless concept in China, serving more than 500,000 developers.

In the process of developers using the cloud, we collected feedback and requirements for the following scenarios:

  1. Existing businesses, such as websites and back-end services, hope to be hosted on cloud development platforms, but there is no small transformation cost
  2. Inability to cover development languages, frameworks, and existing application delivery methods
  3. When the application uses multiple cloud development resources at the front and back ends, it is expected to reduce the cost of release and achieve continuous delivery
  4. Adding additional cloud capabilities to an application requires manual configuration on the console

Based on the above scenario, we want to design a tool to solve the above problem, and we want to have the following features:

  1. Seamless hosting of applications: Users do not need to change their development habits or modify the code to adapt to cloud resources such as cloud functions, but can directly host applications on the cloud development platform
  2. Introduce a low-level resource layer that supports customization: Introduce containerized deployment solutions to host various development languages, frameworks, and existing application delivery methods
  3. Declarative description of cloud resources: Each part of an application can be described in a unified description language, which supports unified deployment of the front and back ends
  4. Simple to use: users do not need to care about the details of the underlying resources and the underlying declaration file, only need limited business parameters, can be hosted to the cloud development platform

The core idea is to allow developers to develop and deploy applications in an integrated way.

CloudBase Framework is a front-end and back-end integrated deployment tool for cloud development based on the above integration concept. Developers do not need to change service codes, and the front-end and back-end one-click hosting is deployed on the cloud development platform, enjoying the advantages of accelerated access and flexible o&M. It has the following features:

1. Cloud Development product

Launched by cloud development, the core code has been open source on Github

Github.com/TencentClou…

(Welcome to give our project a Star, support us to do better ~)

2. Cloud native and integration

The front and back ends are deployed in a cloud environment based on the Serverless architecture, providing flexibility and scalability

3. Reduce costs

Flexible capacity expansion based on usage, charging based on usage, greatly saving resource costs

4. Be efficient and fast

Easy to use, with a lot of powerful back-end capabilities built in, just need to develop the business logic

This section describes the core features of the CloudBase Framework and provides a quick start guide.

Highlight 1: One-click deployment

The first core highlight of the CloudBase Framework is that it enables one-click deployment. Common applications can be deployed to cloud development with zero configuration without changing service codes.

For example, the project created based on the Vue CLI tool as shown in the figure automatically detects the project Framework and language when the CloudBase Framework deployment command is executed, and the project configuration is confirmed and saved interactively, realizing one-click application publishing. One command implements application deployment, automatically configures COS object storage, DNS, domain name, and other capabilities, such as HTTPS secure access and CDN access acceleration.

Support for common frameworks and languages

CloudBase Framework supports front-end frameworks such as Vue and React as well as SSR frameworks such as Nuxt. Applications developed based on Node, such as Express and Koa, can also be hosted with one click. In addition, other back-end applications (PHP, Java, Go, etc.) can also be deployed with the underlying Serverless cloud application capabilities. It is worth mentioning that Dart Server can be deployed to achieve cloud integration of Dart language with Flutter. This is also a great complement to Dart’s language and ecosystem by domestic cloud vendors.

Automatic detection frame

In terms of lowering the threshold for users to use, we have realized the function of automatic detection. For common front-end frameworks, we do not need to write configuration, and can realize the automatic identification project construction and release default configuration

No complex adaptation

There is no need to learn complex server configuration and change code, just enter business parameters to deploy

Can cooperate with CI/CD

It works perfectly with your existing workflow and can be used with CI/CD tools for continuous deployment. For example, Github can automatically deploy the front and back end of an application with just a few lines of code, and you can also add manual verification steps to the CI/CD process to Review the release process.

    - name: Deploy to CloudBase
      run: |
        npm i @cloudbase/cli
        cloudbase login --apiKeyId ${{secrets.SECRETID}}  --apiKey ${{secrets.SECRETKEY}}
        cloudbase framework:deploy
Copy the code

Highlight 2: Integration, easy to expand

Platform integration

CloudBase is an integrated cloud service platform with serverless architecture. Developers do not need to care about server construction and management, and it provides a lot of cloud capabilities out of the box

Project integration

The front-end and back-end of a project developed using the CloudBase Framework can be developed and maintained in the same project. This is very similar to applets development, which can be developed and distributed in an integrated way within the IDE.

Integrated deployment of the front and rear ends

As shown in the preceding example, an integrated application with front-end code, cloud functions, and server code only needs to invoke a command of the CloudBase Framework to deploy the entire application in the cloud for unified management and maintenance.

Out-of-the-box native cloud capabilities

The cloud development integration platform provides out-of-the-box native cloud capabilities without learning the underlying resource configuration, operation and management.

For example, in the cloud development platform, we need to deploy static website, do not care about the object storage and CDN management; You do not need to configure the gateway layer and computing resources to deploy the HTTP service. When we need to use a cloud database, we do not have to worry about the disaster recovery of the database instance.

Easily add more back-end capabilities

More back-end capabilities can be easily introduced out of the box

  • Login authentication: Use the SDK to implement login authentication
  • Cloud database: A built-in NoSQL database that creates collections and indexes declaratively
  • Cloud Access: Introduces HTTP access support
  • Cloud call: a few lines of code to implement wechat open ability call
  • Cloud functions: Lightweight computing power
  • Cloud storage: Enables file storage and download
  • Serverless Cloud Application: Use Kubenetes containers in a minimalist way
  • Expansion capability: free of developing and installing CMS content management system and other expansion capabilities

More technical documentation: Cloudbase.net? From =10004

Authors efficiency

The CloudBase Framework provides integrated development and deployment functions to easily migrate applications to an integrated cloud development platform. Enterprises and individual developers can use this solution to improve business efficiency and save business costs.

Develop faster

  • Integrate cloud development with multiple SDKS
  • Out of the box back-end capabilities

Faster deployment

  • One-click deployment to declaratively create cloud resources
  • Automatic and fast elastic capacity expansion and shrinkage

Access to faster

  • More node coverage
  • High performance and high availability

With 500,000 developers and 700 million users per day, the availability guarantee can be 99.90%

Save worry and save money

The cloud development platform features o&M free, full hosting, and payment by volume. Compared with traditional application deployment, the cost of deploying applications through CloudBase saves o&M costs, idle rental costs, and multi-role communication costs.

For example, the wechat Reading team has brought great efficiency improvement with the help of “mini program · cloud development”. In the 10 months since its launch, the wechat Reading mini program has issued 349 versions in total, and its development efficiency is 4 times and 2 times that of the corresponding APP and H5 respectively.

Cloud development has also dramatically changed the division of labor and the capabilities of its teams. In the past, the team was divided according to front-end development, Node.js development and operation and maintenance personnel, but now the front-end is responsible for full-stack development.

Ecology and Plugins

CloudBase Framework has the characteristics of openness, and this scheme is designed by means of microkernel and plug-in. Kernel level to solve the plug-in, build life cycle and other issues, according to the specific scene through the plug-in to achieve.

For example, website plug-in is designed to deal with this kind of problem for hosting websites of different technology stacks, which can solve front-end page construction, static resource deployment and domain name processing.

Developers can also develop different plug-ins to be published on NPM based on their specifications by specifying their NPM package names.

CloudBase Framework provides the following plug-ins:

The plug-in The latest version The plugin is introduced
@cloudbase/framework-plugin-website
One-click Deployment of web applications
@cloudbase/framework-plugin-node
One-click Deployment of Node applications (supporting underlying deployment as functions or Serverless cloud applications)
@cloudbase/framework-plugin-nuxt
One-click DEPLOYMENT of Nuxt SSR applications
@cloudbase/framework-plugin-function
One-click deployment of functional resources
@cloudbase/framework-plugin-container
One-click deployment of cloud application container services
@cloudbase/framework-plugin-dart
One-click Deployment of the Dart cloud application
@cloudbase/framework-plugin-database
One-click declarative deployment cloud development NoSQL cloud database

Quick start

  1. Install CloudBase CLI

First, you need to install the latest CloudBase command line tool

npm install -g @cloudbase/cli@latest
Copy the code
  1. Log in to the cli tool

After the login, the user will switch to the Tencent Cloud console for account authorization. If no account exists, the user can open the account on the console

cloudbase login
Copy the code
  1. Initialize an application

The CloudBase command line tool makes it very easy to create an application. If you use it in an existing application, you can run CloudBase init –without-template

cloudbase init
Copy the code

Initialize the application by interactively creating the environment and selecting a template

You can also specify the template ID directly to create the corresponding project, for example

cloudbase init --template nuxt-ssr
Copy the code

The following application templates are supported:

The name of the Application Example Introduction Template id
Vue applications Vue + cloud function + static website deployment vue
The React application React + Cloud + Static site deployment react-starter
React Full stack applications React + Cloud function + Static website deployment + cloud database react-demo
Nuxt SPA application Nuxt SPA + cloud functions + static website deployment nuxt-spa
Nuxt SSR application Nuxt SSR + server deployment + Static website deployment nuxt-ssr
Koa application Koa + server deployment koa-starter
Express application Express + server deployment express-starter
Nest application Nest + server deployment nest-starter
Example node.js cloud functions Node. Js function of cloud node-starter
PHP cloud function example PHP function of cloud php-starter
Example Java cloud functions Java cloud function java-starter
VuePresss website application VuePresss + Static website deployment vuepress
Node. Js cloud applications Node.js + Serverless Cloud application deployment node
Aqueduct (Dart Server) cloud application Aqueduct (Dart Server) + Serverless Cloud application deployment dart
  1. The deployment of application

Next, just go into the project directory and invoke the command to deploy

cloudbase framework:deploy
Copy the code

After the deployment is successful, you can access it using the address prompted on the command line:

Framework.service.tcloudbase.com/express-sta…

vision

CloudBase Framework is dedicated to creating an integrated Framework. Currently, it has implemented an integrated deployment tool. In the future, it will introduce an integrated runtime library and an integrated CI/CD workflow to help services deploy services on a future-oriented cloud development platform more quickly and easily, improving efficiency and saving costs.

  1. Integration thought
  2. Integrated platform
  3. All-in-one deployment tool
  4. Integrated runtime library: Simplifies the development process with a runtime framework that enables powerful functionality with less code
  5. Integrated CI/CD workflow: Integrated code repository push for built-in automated cloud build and deployment

Open source contributions

We welcome all developers to contribute to the CloudBase Framework so that the project can help developers improve their productivity.

Github address: github.com/TencentClou…

Participate in the contribution

  • Actively participate in Issue discussions, such as answering questions, providing ideas, or reporting errors that cannot be resolved
  • Write and improve project documentation
  • Submit patch optimization code
  • Identify items on your todo list

Cloud Development (TCB) is a cloud native integrated development environment and tool platform provided by Tencent Cloud. It provides developers with highly available, automatic and flexible expansion of back-end cloud services, including computing, storage, hosting and other serverless capabilities, which can be used for cloud integrated development of various end applications (small programs, Public account, Web application, Flutter client, etc.) to help developers build and manage back-end services and cloud resources in a unified manner, avoiding tedious server construction, operation and maintenance during application development. Developers can focus on the implementation of business logic, with lower development threshold and higher efficiency.

The product documentation: cloud.tencent.com/product/tcb

Technical documentation: Cloudbase.net

Technical exchange plus Q group: 601134960

Latest news follow wechat official account [Tencent Yunyun Development]

Win more wonderful scan QR code to learn more