Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roblaszczak/reservation-system
Using https://watermill.io/ Go library building event-driven application.
https://github.com/roblaszczak/reservation-system
Last synced: 27 days ago
JSON representation
Using https://watermill.io/ Go library building event-driven application.
- Host: GitHub
- URL: https://github.com/roblaszczak/reservation-system
- Owner: roblaszczak
- Created: 2019-03-17T18:26:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-13T13:57:44.000Z (over 5 years ago)
- Last Synced: 2024-10-04T19:44:29.281Z (about 2 months ago)
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Room Reservation System
Example application created for the presentation on [GopherCon Russia 2019 (slides)](https://speakerdeck.com/roblaszczak/event-driven-application-made-easy-with-watermill).
There are 3 versions of this application:
- [`1.0`](1.0/cmd/) - just HTTP handler
- [`2.0`](2.0/cmd/) - using [Watermill](https://watermill.io/) to handle payment initialization in the background
- [`3.0`](3.0/) - using [Watermill CQRS component](https://watermill.io/docs/cqrs/) for initializing payments and counting bookingsDatabase adapters (in memory in this case) and domain layer is shared by all application versions.
Warning: this repository is using some Watermill unreleased features, which are still not released, like `NewPoisonQueueWithFilter` or `CorrelationIDWithAutogenerate`. They are now on `cqrs-fix` branch and will be released in `v0.4.0`.
## Up and running
For v2.0 and v3.0 you need Kafka. You can use docker-compose to run it:
docker-compose up
If you need some help with docker-compose setup, you should check our article about local [Golang development environment](https://threedots.tech/post/go-docker-dev-environment-with-go-modules-and-live-code-reloading/).
And then you should run `cmd/main.go` from application version which you want to run.
cd 3.0/cmd/
go run .### Booking a room
You can book a room using REST API using [https://httpie.org/](HTTPie).
http POST localhost:6060/book-room RoomID=10 StartTime=2018-09-22T12:42:31Z EndTime=2018-09-22T12:42:31Z GuestsCount:=2 PaymentChannel="paypal" -v
### TODO
- [ ] Update Watermill to the last release (some changes to CQRS need to be merged to the Watermill's `master` from `cqrs-fix` branch)
- [ ] Some code cleanups and TODO's fixes
- [ ] Slides link
- [ ] Detailed description## Support
Please join us on the `#watermill` channel on the [Gophers slack](https://gophers.slack.com/): You can get invite [here](https://gophersinvite.herokuapp.com/).