https://github.com/artyomartamonov/msg
Msg is gRPC-based backend for messaging written in golang.
https://github.com/artyomartamonov/msg
chat docker docker-compose go golang grpc grpc-go jwt jwt-authentication message postgresql protobuf protocol-buffers rabbitmq
Last synced: 6 months ago
JSON representation
Msg is gRPC-based backend for messaging written in golang.
- Host: GitHub
- URL: https://github.com/artyomartamonov/msg
- Owner: ArtyomArtamonov
- License: mit
- Created: 2022-04-22T18:06:39.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-31T14:31:50.000Z (almost 4 years ago)
- Last Synced: 2024-11-16T00:42:16.877Z (over 1 year ago)
- Topics: chat, docker, docker-compose, go, golang, grpc, grpc-go, jwt, jwt-authentication, message, postgresql, protobuf, protocol-buffers, rabbitmq
- Language: Go
- Homepage:
- Size: 259 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Msg
[](https://github.com/ArtyomArtamonov/msg/actions/workflows/ci.yml)
Msg is gRPC-based backend for messaging written in golang.
## Goals
Future goals:
- Implement message service which will allow users to send messages to chat rooms
- Unit tests and github workflow
Already achieved:
- Authentication and authorization with JWT and refresh tokens
- PostgreSQL as persistance storage
- gRPC and protobuf service creation with help of Makefile and well-prepared code organization
## Compiling proto messages
Run
```
$ make proto-c
```
For that to work you need to install
```
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
```
## Env variables
Create .env file and put it in a project root
.env file has to contain
```env
API_HOST=":50051"
MESSAGE_HOST=":50052"
JWT_SECRET="s3cr3t"
JWT_DURATION_MIN=15
REFRESH_DURATION_DAYS=90
POSTGRES_DB="dbname"
POSTGRES_USER="dbuser"
POSTGRES_PASSWORD="dbuserpassword"
PGADMIN_DEFAULT_EMAIL="example@example.com"
PGADMIN_DEFAULT_PASSWORD="password"
PGADMIN_CONFIG_SERVER_MODE="False"
RABBITMQ_DEFAULT_USER="user"
RABBITMQ_DEFAULT_PASS="password"
```
## Run
```console
$ docker-compose up -d
```