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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
