Deployment Process (WeChat)
This guide provides step-by-step instructions for deploying the SBM CRM Platform WeChat Mini Program to the WeChat Official platform.
Prerequisites
Before beginning the deployment process, ensure you have:
- WeChat Developer Tools installed and configured
- Access to the WeChat Official Account Platform (
https://mp.weixin.qq.com/) - Valid WeChat Official Account credentials
- Environment variables configured for production
Step 1: Open WeChat Developer Tools
Launch the WeChat Developer Tools application and open your project workspace.
Step 2: Build the Application
-
Open the terminal within WeChat Developer Tools or your system terminal.
-
Configure production environment variables:
- Copy the environment template file:
cp .env.example .env.production - Edit
.env.productionand set all required secret environment variables for production.
- Copy the environment template file:
-
Build the WeChat Mini Program:
npm run build:weappThe build process will generate the compiled application files ready for upload.
Step 3: Upload to WeChat Official Platform
-
In WeChat Developer Tools, click the Upload button.
-
Fill in the required information:
- Version Number: Specify the version identifier (e.g.,
1.0.0) - Project Notes: Provide a brief description of changes in this version
- Version Number: Specify the version identifier (e.g.,
-
Click Upload to submit the application to the WeChat Official platform.
Keep detailed notes about each version to track changes and facilitate rollback if needed.
Step 4: Publish to Production
After uploading, you need to publish the version through the WeChat Official Account Platform.
Access Version Management
-
Navigate to WeChat Official Account Platform and sign in with your WeChat account credentials.
-
Navigate to Version Management > Version Management in the platform menu.
Trial Version (Optional)
Before releasing to production, you can test the application using a trial version:
-
Select the uploaded version and click Grant to Trial Version.
-
Configure the trial version settings:
- Set the page path for testing
- Confirm the configuration
-
A QR code will be generated for the trial version, which can be used for internal testing and validation.
Trial versions allow you to test the application with a limited number of users before the official release.
Production Release
To publish the version to production:
-
Select the uploaded version and click Submit for Review.
-
Complete the submission form:
- Fill in all required information
- Provide any additional details requested by WeChat
-
Review all settings and click Confirm to submit for review.
WeChat may require 1-7 business days to review your submission. Ensure all information is accurate before submitting.
Post-Deployment
After the review is approved:
- Monitor the application for any issues
- Verify all features are working as expected
- Check analytics and user feedback
- Document any deployment-specific notes for future reference
Troubleshooting
If you encounter issues during deployment:
- Build failures: Verify all environment variables are correctly set in
.env.production - Upload errors: Check your network connection and WeChat Developer Tools version
- Review rejection: Review WeChat's feedback and address any compliance issues before resubmitting