Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qneyrat/web-pubsub-example

:rocket: Web pub/sub architecture example
https://github.com/qneyrat/web-pubsub-example

example go postgresql rabbitmq symfony websocket

Last synced: 2 months ago
JSON representation

:rocket: Web pub/sub architecture example

Awesome Lists containing this project

README

        

# Web Pub/Sub Architecture
Example with simple chat

## ARCHI:
![schema](docs/schema.png)

## 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
```

* Start Chat with user test2:
```
> $ go run main.go auth test1 test1 --api=symfony.dev --ws=localhost:4000

```