Building a Short Video Social Distribution Platform: Recommendation Algorithm and Multi-Platform Adaptation
Building a Short Video Social Distribution Platform: Recommendation Algorithm and Multi-Platform Adaptation
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.
Last month I took on a project where the client wanted to build a short video social distribution platform focused on local recommendations and instant interaction. The system needed to support geo-location filtering, content recommendation algorithms, real-time private messaging, and a multilingual frontend. From receiving the source code to going live with testing took about 5 days, and several technical points encountered along the way are worth documenting.

Feature Module Testing
Geo-Location Recommendation Mechanism
The core of this system is LBS-based content distribution. The backend allows you to set a recommendation radius, and when users open the app they’ll see short video content from the same city or nearby areas first. During testing I found that location accuracy depends on frontend permission acquisition—iOS requires configuring NSLocationWhenInUseUsageDescription in info.plist, while Android needs a separate request for ACCESS_FINE_LOCATION.
The recommendation algorithm uses hybrid sorting based on distance weight plus content popularity. There’s a backend parameter to adjust the distance ratio, defaulting to 0.6. If you want popular content to spread across regions more easily, you can lower this value to around 0.4. The code is in RecommendService.java, around line 120 there’s a calcScore method that’s pretty straightforward to modify.
Real-Time Messaging and Task Distribution
The system comes with WebSocket persistent connections, allowing real-time private messaging between users. When I deployed it I used Netty for message push, with configuration in the netty node of application.yml. Note that the port shouldn’t conflict with the main service—I usually set it to 9001.

The task distribution module is quite interesting. Admins can publish activity tasks (like completing video watching, liking, sharing, etc.), and users earn points rewards after completion. This feature is configured in the backend’s task management section and supports custom task types and reward rules. The database table is t_activity_task with a pretty clear field design—if you’re doing custom development you can directly extend the task condition fields.
Multilingual Frontend Adaptation
The frontend uses the uni-app framework, which naturally supports multi-platform compilation. Language packs are in the /lang directory, with Chinese, English, and Traditional Chinese provided by default. I added Thai and Vietnamese for the client by simply copying en.js to th.js and then registering it in main.js. The switching logic reads the lang field from localStorage, which gets written after login.
💡 Pitfall Alert: Before launching multilingual versions, definitely test payment callbacks. Some third-party interfaces (like Stripe) return different data formats based on region. I ran into an issue where the amount field included a currency symbol in the Thai environment, causing parsing failures. I had to add regex sanitization in PaymentController to resolve it.
Deployment Essentials and Environment Configuration
Server Selection
This system’s backend is the classic Java Spring Boot + MySQL + Redis stack. My test environment used a 4-core 8GB cloud server, which handled 500 concurrent users without pressure. For production I recommend 8-core 16GB, deploying Redis to a separate machine and enabling MySQL master-slave replication.

OSS storage is essential. Video file uploads use Alibaba Cloud OSS. Configuration is in application-prod.yml—just fill in the AccessKey and Bucket name. Remember to enable CDN acceleration, otherwise users will experience video lag. I configured pay-as-you-go by traffic for the client, running about 300GB per month with costs around 200 yuan.
Database Initialization
SQL scripts are in the /doc directory, split into three files: schema.sql for table structure, data.sql for base data, and update.sql for version update patches. Don’t mess up the import order—create tables first, then insert data. One detail to note: the invite_code field in the t_user table needs a unique index, otherwise you’ll get duplicate invitation code bugs.
Backend Permission Configuration
The default admin account is admin/123456. First thing after logging in is to change the password. Menu permissions are controlled in the sys_menu table. If you want to create sub-accounts for operations staff, you can create a new role in role management and then check the corresponding menu permissions. I usually separate finance-related menus to avoid operational mistakes.

Custom Development Suggestions and Target Users
The code structure is fairly standard with controller-service-mapper three-layer separation. If you want to add features, just extend the corresponding layer. I added a video review feature for the client by calling Alibaba Cloud’s content security API in VideoService, then adding a review list page in the backend—took half a day total.
Who’s it suitable for? If you’re building social products or need to set up a local life service platform, this system can cover about 80% of requirements. Especially for scenarios requiring geo-location recommendations like local dating, local service bookings, or regional event publishing—it’s ready to use out of the box. The tech stack is mainstream Java ecosystem, so finding developers for maintenance is convenient.
Unsuitable scenarios: If you want to build a product with tens of millions of DAU like TikTok, this architecture definitely won’t hold up—you’d need to refactor into microservices with database sharding. Also, if you have particularly high algorithm requirements, like needing complex user profiling recommendations, you’d need to introduce machine learning models. The simple sorting algorithm in the source code wouldn’t be sufficient.
Common Questions
Q: Is there a limit on video upload size?
A: The default limit is 100MB, configured in spring.servlet.multipart.max-file-size in application.yml. If you want to increase it, remember to also modify nginx’s client_max_body_size parameter, otherwise you’ll get 413 errors. I usually set it to 200MB—anything larger and I recommend guiding users to compress.
Q: Can the recommendation algorithm be customized?
A: Yes. RecommendService has several weight parameters: distance_weight for distance weighting, hot_weight for popularity weighting, and time_weight for time decay weighting. You can adjust these three values based on business needs. For example, if doing local services, increase distance_weight to 0.7; if distributing trending content, lower it to 0.3.
Q: What payment methods are supported?
A: The source code integrates Alipay and WeChat Pay, both using official SDKs. If you want to integrate Stripe or PayPal, you’ll need to write your own adapter. I integrated Stripe once before—mainly handling webhook callbacks and currency conversion. The code wasn’t much, maybe two or three hundred lines.
Q: Does language switching affect existing data?
A: No. Language switching only affects frontend display text; backend data is stored uniformly. But one thing to note: if your content titles and descriptions need multilingual versions, you’ll need to add corresponding fields in the database table, like title_en, title_th, and then return the appropriate field based on user language.
Overall this system has decent code quality and sufficient functionality. If you happen to need to build a similar content social platform, you can use it as a base framework and save a lot of development time. If you run into any issues during deployment, check the README documentation in the source code—it’s quite detailed.
Disclaimer: This article is for technical education only. Please comply with local laws and regulations, and do not use for any illegal purposes.
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 #Social Platform #LBS Recommendation #uni-app #Java Development
-
Alipay QR Code Scan
-
WeChat Scan Pay