Client Environment

Setup the Poocho messenger chat client

Start Docker Swarm

  • Navigate inside the repo with cd poocho-messenger

  • Get your IP with curl ifconfig.co

  • Run docker swarm init --advertise-addr {SERVER_IP}

  • Build Docker images and run Docker services; sh build.sh

  • Open browser; http://xxx.xxx.xxx.xxx or http://yourdomain.com

Setup Environment for React Client (Dev)

  • Run cd client

  • Create local environment file with sudo nano .env

REACT_APP_NATS_HOST = localhost:4222
REACT_APP_API_URL = http://localhost:5050
  • Create production environment file with sudo nano .env.production

REACT_APP_NATS_HOST = xxx.xxx.xxx.xxx:4222
REACT_APP_API_URL = http://xxx.xxx.xxx.xxx:5050
  • Run cd /root/home/poocho-messenger to return back to the root.

Setup Database

  • Open another terminal

  • Run PG_CONTAINER_ID=$(docker ps --filter name=messages-db --format "{{.ID}}")

  • Run docker exec -ti $PG_CONTAINER_ID psql -U postgres -c "CREATE DATABASE underdog;

Start Docker Swarm

  • Run docker swarm init --advertise-addr {SERVER_IP}

  • Build Docker images and run Docker services; sh build.sh

First run of build script
  • Open browser; http://xxx.xxx.xxx.xxx or http://yourdomain.com

Open the web browser to

Page

URL

Default route (/login)

Last updated

Was this helpful?