Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
/ msg Public archive

Msg is gRPC-based backend for messaging written in golang.

License

Notifications You must be signed in to change notification settings

ArtyomArtamonov/msg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

98550de · May 31, 2022

History

44 Commits
May 14, 2022
May 22, 2022
May 28, 2022
May 28, 2022
May 4, 2022
May 26, 2022
May 31, 2022
May 22, 2022
May 28, 2022
May 27, 2022
May 22, 2022
May 22, 2022
May 18, 2022
May 20, 2022
May 20, 2022
May 27, 2022
May 27, 2022

Repository files navigation

Msg

ci

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

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

$ docker-compose up -d