This is a bullet activity project deployed with Tars, which contains 3 services. Covers Http, Tcp services, uses Mysql, Redis storage, including user login, session verification, user information acquisition, bullet creation, bullet acquisition and other functions. Many aspects of normal business development have been covered.
QD.ActHttpServer.obj is an http service that provides a fixed port to the outside. This is a business service. It calls the back-end User and Comment services to complete the business. QD.ActCommentServer.CommentObj is a tcp service, which mainly provides the writing and obtaining of comments and is stored in Redis. QD.UserService.UserObj is a TCP, which mainly provides user information acquisition, user login, and user session verification. Relevant data is saved in Mysql.
index.html is a front-end page that connects to the http service to achieve a barrage display. act.tars.local.conf is the nginx configuration user_info.sql is the user information table for QD.UserServer service
[
{
"host": "mysql.tarsActDemo.local", //This is your mysql address
"port": 3306,
"username": "root",
"password": "password",
"db": "tars_test",
"charset": "utf-8",
"instanceName": "default"
}
]
Import user_info.sql into your mysql.
Modify the redis configuration in src/ENVConf.php in QD.ActCommentServer and set your own redis ip and port
In turn cd to the src directory of each service, execute composer install, and install composer dependencies
In turn cd to the src directory of each service and execute composer run-script deploy to package the code
Deploy three services, QD.ActHttpServer is an http service, you need to fix a port, choose non-tars service, the other two are tcp services, the port is arbitrary, choose tars service. (Note that the ServantName configured on the platform during deployment must be the same as the full name I wrote above. If you need to modify it, please modify tars.proto.php, actComment.proto.php and userInfo.proto.php and generate a new protocol (Medium code)
Configure your nginx and proxy_pass to the IP address and port of your QD.ActHttpServer service
Copy index.html to your /data/website/tarsact/
Open act.tars.local to see if it is accessible
Enter a username yong password 123456 and perform the following login
Try a barrage
Refresh, has the barrage you sent out? Congratulations O(∩_∩)O