Short Video Content Distribution Platform: Recommendation Algorithm and Geolocation Service Integration
Short Video Content Distribution Platform: Recommendation Algorithm and Geolocation Service Integration
Disclaimer: This article is for technical education and demonstration only. It is not professional or financial advice. Any real-world deployment must comply with applicable laws and regulations.
Recently helped a client in the local services sector deploy a content distribution platform focused on geolocation recommendations and short video feeds. The frontend uses Uniapp to package into both mini-program and H5 formats, while the PHP backend handles video distribution and user matching logic. The client wanted a “nearby users” recommendation mechanism similar to Douyin’s city-wide feature but more lightweight. After getting the whole system running, I found several pitfalls worth documenting.

Feature Testing: How Geolocation Recommendations Work
The core of this system is LBS (Location-Based Services) combined with content recommendation. When users open the app, it automatically retrieves their location, and the backend calculates distance based on latitude and longitude, prioritizing content from users within 3-50 kilometers on the homepage. The frontend calls Amap API, while the backend uses Geohash algorithm for range queries, which is much faster than directly calculating latitude-longitude distances.
Video Stream Distribution Logic
The backend includes a content moderation dashboard where administrators can approve or reject videos, supporting both Qiniu Cloud and Alibaba Cloud OSS storage solutions. User-uploaded short videos are automatically compressed and transcoded into three quality levels (SD 480p, HD 720p, FHD 1080p), adaptively loading based on network conditions. During testing, I found the default transcoding queue would easily get backed up, so I switched to asynchronous processing with a Redis queue for stability.

Multi-Language Frontend Adaptation
The client wanted to target the Southeast Asian market, requiring support for Chinese, English, Thai, and Vietnamese. The frontend uses the Vue i18n plugin, with all copy extracted into JSON configuration files, switching languages by reading the corresponding locale file. For RTL layouts like Arabic, you need to handle flex-direction and text-align separately in CSS, otherwise the layout breaks.
Highlight: The system includes a real-time communication module using Workerman for WebSocket persistent connections. Users can send text, images, and voice messages with latency typically under 100ms. With adequate server specs, a single machine can handle 5000+ concurrent online users.
Deployment Challenges
Strict Environment Requirements
Server minimum is 2 cores with 4GB RAM, but 4 cores with 8GB and SSD is recommended. PHP version must be 7.4 or 8.0, requiring ffmpeg extension for video transcoding, plus Redis for caching and message queues. Database uses MySQL 5.7 with decent table structure design—user tables, video tables, and message tables all have sharding optimization.
Two Nginx configuration changes needed: first, set client_max_body_size to 200M to support large video uploads; second, set fastcgi_read_timeout to 300 seconds, otherwise transcoding tasks will timeout with 502 errors. For SSL certificates, I recommend Let’s Encrypt with auto-renewal to avoid manual replacement every three months.

Payment Gateway Integration
The backend supports membership recharge and tipping features, integrating WeChat Pay, Alipay, and PayPal channels. WeChat Pay requires configuring three parameters: APPID, merchant ID, and API key, with callback URLs needing publicly accessible domains. During testing, I noticed sandbox environment callbacks would occasionally drop, so I recommend testing small-amount orders directly with production keys.
Customization and Extensibility
The source code structure is quite clean. The frontend uses Vue component-based development with each page as an independent .vue file, making UI modifications convenient. The backend uses ThinkPHP 6 framework with standard MVC layering—controller layer handles requests, model layer operates the database, and service layer contains business logic.
I added a “content reporting” feature for the client, allowing users to report violating videos that automatically enter the moderation queue. The changes were minimal: add a report button on the frontend to call the API, create a new report method in the backend controller to write to the database, then add a filter condition on the admin dashboard list page. The entire workflow took half a day.

Suitable Use Cases
This system works well for vertical domains like local services, interest-based social networking, and skill-sharing platforms. If you’re building a stranger social network or city-wide service platform, geolocation recommendation is essential. The Uniapp frontend can be packaged directly into WeChat mini-programs, H5, and native apps across three platforms, saving redundant development costs.
It’s not suitable for large-scale UGC content platforms because the moderation mechanism is fairly basic, lacking AI-powered content filtering and sensitive word detection, relying on manual review. If daily active users exceed 10,000, I recommend integrating Alibaba Cloud Content Security or Tencent Cloud Tianyu for automated screening.
Frequently Asked Questions
Q: Does it support iOS App Store submission?
A: The frontend is a native app packaged with Uniapp and can be submitted to the App Store, but Apple’s review process is strict for social apps, requiring user agreements, privacy policies, and content moderation mechanism documentation. Payment features must use Apple’s In-App Purchase (IAP) rather than direct WeChat or Alipay transactions.
Q: Can it be modified to support live streaming?
A: The source code doesn’t include a built-in live streaming module, but you can integrate third-party streaming services. I previously integrated Qiniu Cloud Live SDK, which requires modifying the frontend player component and adding a live room management module to the backend. Workload is about a week. For complex features like co-hosting or PK battles, I recommend using Agora or Tencent Cloud TRTC solutions directly.
Q: Does multi-language switching affect SEO?
A: The frontend is a single-page application (SPA), which isn’t SEO-friendly. For multi-language SEO, consider switching to server-side rendering (SSR) or refactoring the frontend with Nuxt.js. Another approach is creating separate H5 landing pages for each language using traditional PHP template engines, which will yield much better search engine crawling results.
Q: How much server bandwidth is needed?
A: Video traffic consumption is substantial. With 500 daily active users each watching 10 short videos at 5MB per video, that’s 25GB of traffic. Bandwidth should be at least 10Mbps, or use CDN acceleration for distribution. Alibaba Cloud OSS with CDN costs approximately 0.15 yuan/GB, cheaper than buying server bandwidth directly.
Overall, this system uses a mainstream tech stack with reasonably detailed documentation and comments. Developers with PHP and Vue experience should find it accessible. If you’re just setting up a test environment, following the official documentation step-by-step takes about half a day. For production deployment, I recommend thorough stress testing, especially for video transcoding and concurrent connections—identifying bottlenecks in advance prevents post-launch failures.
Disclaimer: This article is for technical education only. System deployment must comply with local laws and regulations. Any illegal or improper use is prohibited.
Disclaimer: This article is for technical education and demonstration only. It is not professional or financial advice. Any real-world deployment must comply with applicable laws and regulations.
#Short Video System #Geolocation Services #Vue Development #Content Distribution #Social Platform
-
Alipay QR Code Scan
-
WeChat Scan Pay