We have market where vessel owners and cargo owners can communicate each other and make deals. Customers put their positions in system. There are 2 types of it:
- PositionVessel
- PositionCargo
After customers put their position, they can find opposite, that match to their parameters (I simplify that part to one parameter, but here may be very complex algorithm). Also users can search use any others type of searching (not implemented). If one user find matched position, he send Offer, that create Discussion, where users chat each others.
I put a Domain layer in app/modules
API in api/api
– root folders in 'app' directory can't be modules.
In app/workers
– RabbitMQ watchers (or any other workers)
Messaging on RabbitMQ Gems:
- Bunny – RabbitMQ client
- sneakers – watching on Rabbit queues. Can work same as Sidekiq. Idea from blog post
TODO:
- build node.js api and communicate with rails (req/res type communication)
I made this code as an example of the some (not all) principles of DDD in RoR. And how RoR can be part of SOA architecture.