web-pubsub-example

module
v0.0.0-...-71add2c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2018 License: MIT

README

Web Pub/Sub Architecture

Example with simple chat

ARCHI:

schema

Start project:

  • Copy env vars in wsb:
> $ cp wsb/.env.dist wsb/.env
  • Setup wsb and client (download vendor files):
> $ go get -u github.com/golang/dep/cmd/dep # if dep is not already installed
> $ dep ensure
  • Start containers:
> $ docker-compose up
  • Create database and setup API:
> $ docker-compose exec php composer install
> $ docker-compose exec php bin/console doctrine:schema:create
> $ docker-compose exec php bin/console app:setup
  • Setup RabbitMq:
> $ docker-compose exec rabbitmq sh /etc/rabbitmq/setup.sh
  • Restart containers:
> $ docker-compose up

Run CLI Client:

  • Get dependencies:
> $ cd client
> $ go get .
  • Start Chat with user test1:
> $ go run main.go auth test1 test1 --api=symfony.dev --ws=localhost:4000
yo <enter>
  • Start Chat with user test2:
> $ go run main.go auth test1 test1 --api=symfony.dev --ws=localhost:4000
<new message>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL