Chatyx Backend

π Description
Chatyx backend is an MVP monolith message service implemented in Go. The project will evolve
towards a microservice architecture. The target design is described in this page.
π Features
Already done:
- β
Support groups and dialogs
- β
Support for sending text messages both via REST and Websocket
- β
Add and remove participants for group chats
- β
Participants can leave from group chats
- β
Block partners in dialogs
Not done yet:
- β Support uploading images
- β View unread messages
- β Show online/offline statuses of users, as well as when the user was last online
- β Notifications if user isn't online
- β Support cross-device synchronization
π§ Installation
Using single docker container
docker run --rm --volume=$(PWD)/configs:/chatyx-backend/configs \
--publish=8080:8080 --publish=8081:8081 --detach \
--name=chatyx-backend mortalis/chatyx-backend:latest
# Apply migrations
docker exec chatyx-backend ./migrate -path=./db/migrations/ -database 'postgres://<POSTGRES_USER>:<POSTGRES_PASSWORD>@<POSTGRES_HOST>:<POSTGRES_PORT>/<POSTGRES_DB>?sslmode=disable' up
Manually building from source code
git clone [email protected]:Chatyx/backend.git chatyx-backend && cd chatyx-backend
make build
# Apply migrations
./bin/migrate -path=./db/migrations/ -database 'postgres://<POSTGRES_USER>:<POSTGRES_PASSWORD>@<POSTGRES_HOST>:<POSTGRES_PORT>/<POSTGRES_DB>?sslmode=disable' up
# Run the application
./build/chatyx-backend --config=<PATH_TO_THE_CONFIG>
βοΈ Configuration
Basic configuration defined as a single YAML file:
You can configure part of parameters with environment variables like these:
POSTGRES_USER, POSTGRES_PASSWORD, etc. The full list of supported environment variables
are described in a config file after comment prefix # env: .
To run the application with substituted config you should perform:
$ ./chatyx-backend --config=<PATH_TO_THE_CONFIG>
π How to use
After running the application you can use REST API for creating groups and dialogs, adding participants
sending messages and so on. See swagger documentation http://localhost:8080/swagger for more details.
Also, available to you WebSocket API for sending and receiving messages in the real time.
(by default at ws://localhost:8081). For getting that you should generate code for your
language from proto file and use MessageCreate to
send messages and Message to receive message.
See documentation for more details.