The author has been concerned about cloud development for a long time, recently began to do before a group purchase small program reconstruction and migration to the cloud development, while the source code open source, welcome interested friends to exchange.

  • Code warehouse
  • Print screen
  • The case shows

Technology selection

Small program

  • The underlying framework: Taro 3.0 (React)
  • Interface: Vant
  • State machine: SWR

Management background interface

  • The underlying framework: React
  • Interface: eui
  • State machine: SWR

The service side

  • CloudBase cloud development

Taro is now in the 3.x era and allows developers to develop with full React, Vue and other frameworks. As a heavy React user, I naturally chose Taro among many frameworks (and then Kbone).

Because the development of the shopping class small program so will choose a praise open source Vant control library.

In the aspect of State Machines, a more lightweight Hook scheme is chosen. Two libraries React – Query and SWR are investigated in Hook scheme. Generally speaking, SWR is more lightweight and convenient.

In terms of control library at the management end, most of the domestic React system will choose ANTD control library. To tell the truth, the author is an early adoptee and tried Microsoft’s open source FabricUI library in the last open source project (Lucky_Bilibili_Web). This time, I’m looking at the Elastic open source EUI. After I use it, I feel very experienced! It is too convenient to develop some pure tool applications with this control library.

At the end of this article, I will give you a picture 1 of using this control library as a tool application, which is completely combined with EUI controls. You can have a feel for it.

Server side, the author concerned about Serverless for a long time, before is a lot of foreign resources, but also very greedy Google’s Firebase. The author before the development of small programs are self-purchase server, self-built server, but also need to daily server operation and maintenance, trouble and effort. Thank you very much for joining Tencent Cloud in the construction of Serverless ecology, so that domestic developers can also use Serverless services without obstacles. Cloudbase cloud development team has repackaged Serverless, reducing the complexity of Serverless learning, and achieving out-of-the-box, one-button deployment.

Database design

Product, interface display related tables

User, order, payment related tables

Administrator related list

Key technical points

The author also encountered a variety of problems and difficulties in the development of this small program. I consulted a lot of information in the community and did a variety of tests and found the answer. I really want to put all the summaries here once. Talk is cheap,Show me the code. After that, there will be some technical realization schemes summarized by the author and sent separately with private goods.

Small program related:

Use the Zan Vant control library in Taro

See the source code:

/mini/config/index.js   //line 51
/mini/config/index.js   //line 16

Markdown renders in the applet

See the source code

/mini/config/index.js   //line 74
/mini/src/hooks/useProducts.ts   //line 40
/mini/src/pages/detail/detail.tsx   //line 165


See the source code

/mini/src/pages/order/detail/detail.tsx     //line 71


Taro uses CSS in JS

See the source code

/mini/config/index.js   //line 39
/mini/src/conponents/product-list/index.tsx   //line 10

Custom Nav with Tabber

See the source code

/mini/src/app.config.ts    //line 41
/mini/src/app.config.ts    //line 95

CI CD continuous integration

See the source code


Manage background related

Subject switch

See the source code


Integrated CloudBase

See the source code


The management side realizes the refund

Note: Refunds in the small process cloud development only support the mobile phone terminal to make the request. I made a modification here and realized the refund in the form of HTTP API

See the source code

/manage/src/lib/tcb.ts   //line 18
/manage/src/hook/useOrderMuation.ts   //line 81


Statistical analysis of data

See the source code



EUI implements convenient operations similar to ANTD Form

Note: Here is my private product in the source code I left a special Ext folder, and the form control of EUI for the second encapsulation. The core library used is rc-field-form, thanks to the original author

See the source code


Subscribe to news

See the source code


Cloud development custom login, custom permissions, initialization data

See the source code

/cloudbaserc.json //line 8
/cloudbaserc.json //line 18
/cloudbaserc.json //line 192


/manage/src/hook/useUser.ts   //line 33

The above is a number of key technical points in the source code annotation.

A key deployment

Finally, you are welcome to try deploying this project to Cloud Development with one click.

There are a number of environment variables that are used in the deployment process. See this article for information on how to obtain the environment variables.

If you want small programs available, the cloud development environment must be a small program opened cloud development environment.

If the deployment fails, please check whether the pay-as-you-go mode has been opened.

When all the variables are ready, click the button below to deploy it

The management end:

Small program:

The appendix

  • The user manual
  • Print screen
  • The case shows

  1. The tool class application developed with EUI is shown in the figure ↩