Simple end-to-end encrypted messenger.
For start project follow these steps:
- Clone project
git clone https://github.com/mohsenHa/messenger.git
cd messenger- Create .env file
cp serve/.env.compose.example serve/.envif you want you can update variables.
In windows please check the EOL of the line it must be Unix(LF) otherwise your config not work.
-
Generate RSA Key pairs (KeySize: 2048) and store to
src/key -
Start docker compose
Windows:
.\serve\docker-compose.bat up -dLinux:
./serve/docker-compose.bash up -dYou must set below host in host file:
127.0.0.1 SERVICE_NAME.local
Note: The SERVICE_NAME is configured in .env file.
- Done.
Now you can test APIs with postman or use sample golang client. For run client run this command.
Windows:
.\serve\docker-compose.bat exec app go run ./cmd/client/ ARG1 ARG2Linux:
./serve/docker-compose.bash exec app go run ./cmd/client/ ARG1 ARG2Hint:
- ARG1: this argument (default:user) is used to store user details in the file user.json.
- ARG2: this argument (default:127.0.0.1:8088) is the base url of the server.
You can run the client command in separate command line with different user file and start chat between together.
- Base API URL:
http://SERVICE_NAME.local - Health check API URL:
http://SERVICE_NAME.local/health-check - Profiler URL:
http://SERVICE_NAME.local/profiler/debug/pprof/ - PHPMyAdmin URL:
http://SERVICE_NAME.local/db_manager/ - Rabbitmq manager URL:
http://SERVICE_NAME.local/rabbitmq_manager/ - Traefik dashboard URL:
http://127.0.0.1:8080
Note: The SERVICE_NAME is configured in .env file.
username: guest
password: guest
username: root
password: password
Example of .env file:
SERVICE_NAME=messenger
COMPOSE_PROJECT_NAME=messenger
#SERVE_APPLICATION=not_serve
SERVE_APPLICATION=do_serve
#SERVE_WITH_AIR=yes
SERVE_WITH_AIR=no
GO_IMAGE_NAME=golang
GO_IMAGE_VERSION=1.22
SERVICE_NAME: Used for URLs of the servicesCOMPOSE_PROJECT_NAME: Used for compose project nameSERVE_APPLICATION: Used for serve or not serve the applicationSERVE_WITH_AIR: Used for serve with air for development. It is a live reload for golang.
You can use the demo server with bellow command. Run it in two cmd and use different user file name (user1, user2).
cd src
go run ./cmd/client/ user1 ichat.liara.run