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
| What | How |
|---|---|
| A CloudBase environment | Create one — free for new users |
| A mini program AppID | Register at WeChat MP platform, then copy it from Development - Development Settings |
| WeChat DevTools | Download 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.
| Situation | What you see | What to do |
|---|---|---|
| You are on a test account | The CloudBase button in DevTools is greyed out | Test accounts do not support CloudBase. Register a real mini program |
| Wrong login method when enabling CloudBase | The environment exists but the mini program cannot use it | When 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 accounts | The CloudBase console does not list your environment | DevTools 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 list | The connector is connected but no environment is selectable | Sign 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.
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:
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:
Read https://docs.cloudbase.net/skill.md and tell me what it can doUse 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
| Symptom | Cause | Fix |
|---|---|---|
| "CloudBase not initialized" on compile | AppID missing, or the environment is not bound to the mini program | Fill the AppID in DevTools (Details - Basic Info), then bind the environment in the CloudBase console |
| Home page shows an empty list | The collection exists but has no data, or permissions block reads | Add one test document in the console first, to tell data from permissions |
| Items you published are invisible to neighbors | The collection still uses the default "creator only" permission | Change it to "all users can read, creator can write" |
| Images do not render | The collection stores a local temp path instead of a fileID | Make 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.
Related
- Connect CloudBase MCP: switching tools or connection modes
- WeChat mini program docs
- CloudBase docs