Skip to content

Checking your reading list…

Retry verification

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Build a Smart Garbage Classification Mini‑Program with Uni‑App and SpringBoot

Build a Smart Garbage Classification Mini‑Program with Uni‑App and SpringBoot

This article introduces a WeChat mini‑program that uses uni‑app for the front end and SpringBoot for the back end to provide text, voice, and image‑based garbage classification, and walks through the required setup, dependencies, and deployment steps.

Today TJ discovered an interesting small project and decided to share it.

Many cities have implemented garbage classification, and this WeChat mini‑program serves as a handy tool to quickly identify the correct waste category.

WeChat Mini‑Program: Garbage Recognition Assistant

The project, built with uni‑app , offers text search, voice recognition, and image OCR, allowing users to input queries manually, speak them, or upload pictures to determine the waste type.

The backend is powered by SpringBoot 2 , with Swagger2 for RESTful API documentation, a MySQL database, and Mybatis‑Plus for data access.

The installation steps include six main points:

Prepare the environment: JDK 8+, uni‑app via HBuilder, and an IDE such as Eclipse or IDEA for the backend.

Configure Baidu AI services for voice and image recognition (5 × 10⁴ free API calls) and set appid, apikey, secretkey in the backend configuration.

Create a MySQL database named garbageSort and import the provided garbagesort.sql file.

Start the backend:

Locate the uniapp-api module in the backend directory.

Edit application.yml with database credentials and Baidu API settings.

Run UniappApiApplication to launch the service.

Start the frontend: open the frontend folder in HBuilder, then run to the mini‑program simulator or open the compiled dist/dev/mp-weixin in WeChat DevTools.

Start the web portal: open the web directory in IDEA, adjust application-druid.yml for database info, and run WebApplication.java to access the management system at http://localhost:8082.

The project is compact yet polished, making it an excellent learning example; interested developers can download the source code and explore further extensions.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

Report an issue with this article
WeChat Mini-ProgramSpringBootuni-appgarbage classification

Reader feedback

Was this useful?

Useful0

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion