This is a coding test. I decided to use Docker for this one given the many applications involved and wanting to avoid setup issues.
Note that you need to wait for each service to start up before starting the next one.
- Clone the repo.
cd
into repo.- run
docker-compose up queue
- run
docker-compose up consumer
- run
docker-compose up frontend
- run
docker-compose up producer
- Head to localhost:8080 and, optionally, open up the console log to see all received messages
Here's a list of services involved:
Service | Description | Available at |
---|---|---|
Frontend | React frontend to display messages | localhost:8080 |
Producer | NodeJS service that produces 20 messages per second and puts them on RabbitMQ | localhost:3000 |
RabbitMQ | Queue that receives messages | localhost:15672 |
Consumer | NodeJS service that consumes messages from RabbitMQ and sends them to Frontend service via websockets. | localhost:3001 |
Unidirectional data flow architecture:
graph LR
A[Producer] -- RabbitMQ --> B((Consumer))
B --> D{Frontend}
- Utilize functional components and hooks in the frontend
- Trigger producer start and stop from frontend
- Add tests for services