Skip to main content

Build a neighborhood idle-items mini program with CloudBase

One prompt in, one runnable mini program out: neighbors list books, clothes, and gadgets they no longer use, and whoever lives closest gets them first. The AI writes the pages, cloud functions, and collections; you register the account and approve the steps.

Three things to prepare​

WhatHow
A CloudBase environmentCreate one — free for new users
A mini program AppIDRegister at WeChat MP platform, then copy it from Development - Development Settings
WeChat DevToolsDownload and install and sign in by QR code. To let the AI drive compile and preview, use the Nightly build with CLI enabled

⚠️ Put the AppID into DevTools before enabling CloudBase. Without an AppID you only get a test account, and the CloudBase environment cannot be bound — every step after that fails.

Get the accounts aligned first​

If any of these four is off, none of the generated code runs, and the failures look unrelated.

SituationWhat you seeWhat to do
You are on a test accountThe CloudBase button in DevTools is greyed outTest accounts do not support CloudBase. Register a real mini program
Wrong login method when enabling CloudBaseThe environment exists but the mini program cannot use itWhen the login page appears, choose WeChat MP platform, not Tencent Cloud account — the environment then binds to the current mini program automatically
DevTools and CloudBase use different Tencent Cloud accountsThe CloudBase console does not list your environmentDevTools uses the Tencent Cloud account bound to the mini program. Check it is the same one; if not, bind the mini program to the target account
The AI tool shows an empty environment listThe connector is connected but no environment is selectableSign in with WeChat MP platform and pick the same mini program account

The Tencent Cloud account must be verified with real-name information, otherwise creating an environment fails and the console only shows a small notice in the corner.

Connect CloudBase​

Pick the AI tool you already use and follow the setup. Any MCP-capable client works; you do not need to switch tools.

Client

This client ships CloudBase built in. Setup follows its own marketplace or connectors, and the site follows your login state — nothing to pick here.

Configure your AI tool to connect with CloudBase capabilities. Supports local and remote connection. See connection modes.

Step 1: Install / Configure CloudBase

Open connector:

Open in WorkBuddy

Use the built-in connector

1. In the WorkBuddy conversation interface, click the Connect App button at the bottom left of the input box 2. Find Tencent CloudBase in the popup, click to enter the detail page, and click Connect to enable

Once enabled, you can use CloudBase capabilities directly in the conversation.

Use the slash command

Type `/cloudbase` in a conversation to pick the CloudBase Skill, then describe what you need.

Bundled experts

WorkBuddy expert center ships four CloudBase experts; Full-Stack Engineer covers the most ground, and the other three are listed in the WorkBuddy setup guide.

Step 2: Chat with AI

Enter the following in your AI chat in order:

prompt
Read https://docs.cloudbase.net/skill.md and tell me what it can do
Use CloudBase Skills: 循环里查 users,帮我改成批量查询

Send this to the AI​

Build me a WeChat mini program for recycling idle items in a neighborhood, using CloudBase.

Features:
1. Home: card list of items (cover image, title, category, distance), with category filter and keyword search
2. Detail: image carousel, description, publish time, publisher contact, favorite button
3. Publish: multi-image upload, title, description, category, price (0 means free), current location
4. Profile: items I published, items I favorited

Requirements:
- Native mini program + CloudBase, no third-party UI library. Light cards, rounded corners, generous whitespace
- Use the CloudBase identity for login instead of building an account system: after wx.cloud.init, identify users in cloud functions with cloud.getWXContext().OPENID
- Upload images with wx.cloud.uploadFile to cloud storage, store only the fileID in collections
- Two collections: items (title, desc, category, price, images, location, status, openid, createTime) and favorites (itemId, openid)
- items: read open to all users, write restricted to the creator; favorites: creator-only read and write
- When done, open the project in WeChat DevTools and list the steps I need to do by hand

Then let it work. It builds pages, writes cloud functions, creates collections, and stops only where your confirmation is required.

What happens under the hood​

Three stages. You only click when creating CloudBase resources and when DevTools opens.

read the request → scaffold the mini program → write 4 pages + 2 cloud functions
→ create items / favorites collections and set permissions
→ launch WeChat DevTools with the project → compile and preview

Where people get stuck​

SymptomCauseFix
"CloudBase not initialized" on compileAppID missing, or the environment is not bound to the mini programFill the AppID in DevTools (Details - Basic Info), then bind the environment in the CloudBase console
Home page shows an empty listThe collection exists but has no data, or permissions block readsAdd one test document in the console first, to tell data from permissions
Items you published are invisible to neighborsThe collection still uses the default "creator only" permissionChange it to "all users can read, creator can write"
Images do not renderThe collection stores a local temp path instead of a fileIDMake sure upload results (cloud://...) are what gets saved

Make the AI better at mini programs​

WorkBuddy's expert center has a CloudBase mini program expert: it breaks down requirements, structures pages, and picks the right CloudBase API for each job, so you do not re-explain the platform every time.

See CloudBase experts on WorkBuddy.