Simple Chat is a simple Go-based HTTP server that uses websockets and an optional gRPC microservice for authorization.
For full operation of the service, it is necessary to start the authorization service bordviz/sso-grpc
To migrate to the database, run the following command from the root of the project:
go run cmd/migrations/main.go --action=upTo start the application, you need to run the following commands in the root of the project:
go build -o build/main cmd/simple-chat/main.go./build/mainOr run without creating a binary
go run cmd/simple-chat/main.goIMPORTANT If you have made changes to the configuration files, check them against the parameters specified in docker-compose.yml
To start a project using Docker, run the following command from the root of the project:
docker-compose up -dTo stop, use:
docker-compose downIf you are running a project using Docker and the env mode is dev or prod, you can monitor logs using the Grafana Loki service. To access the service, go to http://localhost:3000, enter root as login and chat-root as password. In the menu, open the Dashboards tab and select the added Chat logs dashboard.
To use the API, you can download the Postman collection Postman Collection
The images below show an example of using a websocket for a chat room:
In order for the websocket to work properly, you need to send the token to the user in Headers

