Toy application displaying the power of docker-compose and modular web application design.
Service | Description |
---|---|
Web | Nginx proxy for Front and Api |
Api | HTTP API that allows listing existing events |
Front | React/Webpack/Node app for HTML interface |
Worker | Listens on "events" Rabbit exchange and saves incomming events into a database |
Create events database table:
docker-compose up db &
docker-compose exec db su -c 'createdb events' postgres
This is the most dubious part. Maybe it could be done programaticaly?
Start the app:
docker-compose up
Publish an event:
docker-compose exec worker publish '{ "event": "yohohoho!" }'
List API actions:
$ curl localhost:3000
{ "supported_actions": ["GET /events"] }
List events:
$ curl localhost:3000
[{"id": 1, "description": {"event":"hello"}]
HTML:
Visit locahost
in your browser to observe stored events.