- cargo
- docker-compose
- sqlx
- Go into
server
- Create a file called
.env
with the following content
DATABASE_URL=postgres://root:root@127.0.0.1:5432/signal_db
DATABASE_URL_TEST=postgres://test:test@127.0.0.1:3306/signal_db_test
REDIS_URL=redis://127.0.0.1:6379
SERVER_ADDRESS=127.0.0.1
HTTPS_PORT=443
HTTP_PORT=80
if you are on linux and do not want to sudo the program, you can change the HTTPS and HTTP ports to your liking.
- Go into
server/cert
- Generate certificates by running the following
./generate_cert.sh
- Go back into
server
- Start the database by running the following command
docker-compose up
- Start the server by running the following command
cargo run
- Go into
client
- Create a file called
.env
with the following content
HTTPS_SERVER_URL=https://localhost:443
HTTP_SERVER_URL=http://localhost:80
DATABASE_URL=sqlite://./client/client_db/dev.db
DATABASE_URL_TEST=sqlite::memory:
CERT_PATH=../server/cert/rootCA.crt
- Go into
client/client_db
- Execute the following command
cargo sqlx database create -D sqlite://dev.db && cargo sqlx migrate run -D sqlite://dev.db
- Go back into
client
- Start the client by running the following command
cargo run
As an example, two clients should then be created and messages between them will be send.
If you do not want to use HTTPS and WSS you can run the server and client with --no-tls
and then they will just communicate over HTTP and WS
- Go into
server
- Close the database and run the following command
docker-compose down -v
- Go into
client/client_db
and run the following command
rm alice.db* && rm bob.db*