Random Rabbit
Using, Python - Flask - React
Randomic Rabbit is a web service that generates random numbers at random time intervals, and sends them to the connected user in real time.
No memory about generated numbers is maintained.
Given:
- A server that generates random numbers at random time intervals
- Sends them to the connected user in real time.
- No memory about generated numbers is maintained.
The closest thing I know that I use for this is a messaging broker. So I thought to give him a shoot.
I used RabbitMQ in the simplest configuration that I found here
After this, the missing part is create a web interface that dynamically show the keys.
Requirements
-
Install RabbitMQ and run RabbitMQ server for the standalone version I used: $ ./rabbitmq-server
-
Python3
-
For install all python libraries needed please use: $ pip install -r requirements.txt
How to run
1- run rabbitMQ server
Run is the message broeker
2- run randomRabbitServer/RandomRabbit_server.py
Run the token generator, I will send message to any User connected to the same queue
3- run rabbitUser/RandomRabbit_receiver.py
Run the RandomRabbit receiver that provide two way to ispect what he has received:
- /html
- /json
4- on rabbitUser/webapp run: npm start
A more dyanamic wait to visulize Received data, in a Comodore64 style UI...well, kind of...
What is missing...
Also know as "Opsy, I finished the time"
-
RabbitMQ confguration: It works out of the box
-
Test: Shame on me, I should have make at least a couple of unit test
-
Makefile ( and easy start stop whould be great)
-
gitignore ... ...