macOS setup
Instructions
Install Docker and make sure it is up to date.
Clone the repo with
git clone https://github.com/yalefox/poocho-messenger
Open terminal and navigate to the root of the repo.
Make sure Docker is open.
Run
docker swarm init
(Note: this only needs to be run the first time
Swarm initialized: current node (kfgchus63c3b6ew9nyrx93gya) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-41k14i127ao4m6ncj6mmu5bq4w3mqvirdl8igb417wn4v5wlez-5q0rfq8bc7qh6gdjmr654fiw1 192.168.65.3:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
Run
cd client
to navigate to/client
directory.Create a local environment file with
sudo nano .env
Paste the following, save and exit.
REACT_APP_NATS_HOST = localhost:4222
REACT_APP_API_URL = http://localhost:5050
REACT_APP_AWS_REGION=us-east-1
REACT_APP_AWS_POOL_ID=us-east-1_Qccxby2tn
REACT_APP_AWS_CLIENT_ID=5foo8qktllsqfd8c91kh7bq8i6
REACT_APP_AWS_POOL_DOMAIN=poochodemo.auth.us-east-1.amazoncognito.com
REACT_APP_AWS_POOL_CALLBACK_URL=http://localhost
Navigate to Root Directory
Navigate to the root folder of the project.
Create a new local environment file with
sudo nano .env
POSTGRES_HOST=messages-db
POSTGRES_USER=postgres
POSTGRES_PASS=postgres
POSTGRES_DB=underdog
AWS_REGION=us-east-1
AWS_POOL_ID=us-east-1_Qccxby2tn
AWS_CLIENT_ID=5foo8qktllsqfd8c91kh7bq8i6
NATS_URL=nats://nats:4222
API_PORT=5050
Start Local Environment
Build Docker Images and run services with
sh build.sh
The first time you run this will take some time, it took 3 minutes and 45 seconds on my local.

Setup Local Database
Open a new terminal window and run:
PG_CONTAINER_ID=$(docker ps --filter name=messages-db --format "{{.ID}}")
docker exec -ti $PG_CONTAINER_ID psql -U postgres -c "CREATE DATABASE underdog;"
docker service update --force underdog_apis
You will see a message that looks like this: https://dog.under.wtf/v1urQ1Gz
CREATE DATABASE
underdog_apis
overall progress: 1 out of 1 tasks
1/1: running [==================================================>]
verify: Service converged
Start local
Open your browser to
http://localhost
and you should see the following page.

Last updated
Was this helpful?