We can use the docker-compose we wrote to quickly set up the runtime environment.
docker-compose up -d
After that, we need to update the config file. You just need to do the following two things:
- Open
./config/config_example.yaml
and complete the configuration according to the comments in the file (This is not much, most of it we have already set up for you.). - Rename the above file as
config.yaml
.
We have greatly simplified the commands using Makefile, and all you need to do is:
- We have 6 services:
api
,user
,follow
,chat
,video
, andinteraction
. To run a specific service, go to the root directory and execute it by make
make api # or others
- Start each of the 6 services one by one (this may require opening 6 or more terminals).
- Makefile will automatically help you build the binary program and the necessary script configuration, and move these artifacts to the
output
folder in the root directory. Finally, it will automatically run them for you.
To facilitate your testing (even though it does not comply with go test specifications), we have placed all the test files in the test
directory under the root directory. You only need to run the following program to let go test automatically execute the tests for you.
go test ./test/...
you can also send request by yourself, just step in .postman
folder and import json file into postman!