This project is the backend assignment for the TikTok Tech Immersion Program 2023. It is a simple Instant Messaging platform backend built on Golang, Protobuf, Kitex, Redis and Docker. It is built using this demo template.
Run:
docker compose up -d
in the same directory as
docker-compose.yml
:
Send a POST
request to localhost:8080/api/send
(using Postman or curl) in this format:
eg. Send message "hello" from alex to ben:
curl -X POST 'localhost:8080/api/send?chat=ben:b&sender=alex&text=hello'
Send a GET
request to localhost:8080/api/pull
in this format:
eg. Pull all messages between alex and ben:
curl 'localhost:8080/api/pull?chat=alex:ben&cursor=0&limit=10&reverse=false'
** cursor is the earliest epoch to retrieve messages by time
** limit is the max number of messages to retrieve
** reverse decides whether messages are sorted in ascending order (earliest first)