Software | Version | Importance |
---|---|---|
🐳 Docker | 20.10.6 | Required |
🐙 Docker Compose | 1.29.1 | Required |
🔗 cURL | 7.68.0 | Required |
🐃 GNU Make | 4.2.1 | Required |
.
├── etc <- Infrastructure configurations
│ ├── psql
│ │ └── scripts
│ ├── python
│ └── rabbitmq
├── img
└── src <- Source code
├── movie_service
│ ├── api
│ │ └── routes
│ └── movie
│ └── infrastructure
└── robot_service
- Run
make prepare
. - Fill the file
config.py
with your own credentials.⚠️ WARNING⚠️ : all the constants on theconfig.py.example
file work correctly, you only have to change theOMDB_API['KEY']
variable if you want. - Run
make dc
, this may take a while. - Run
make API_KEY=8031c622 import-movies
. The8031c622
is my personal API KEY, this key shouldn't be shared. - Run
make rate
, this command starts the movie rating task, and queues the best 5 movies on RabbitMQ (robot). This robot rates every 30 seconds, this time can be modified onFREQUENCY_RATE
variable insrc/robot_service/config.py
file. - Run
make get-movies
, get the best ranked movies from RabbitMQ.
Port | Description |
---|---|
8090 | Main Service |
8091 | Robot |
15672 | RabbitMQ (UI) |
5672 | RabbitMQ (internal) |
5432 | PostgreSQL |
Endpoint | Type/Port | Description |
---|---|---|
/movie/import | GET/8090 | Import movies from the IMDB API |
/rate | GET/8091 | Rating each 5 random movies. |
/best | GET/8091 | Get the best rated movies and send to RabbitMQ queue |
/movie | GET/8090 | Obtain the 5 best rated movies from RabbitMQ queue |
- We can found the documentation on this link.
- We can get the API Key by registering from this link (with free 1000 API calls per day)
- We can found the documentation on this link.
make prepare
cp -n src/movie_service/config.py.example src/movie_service/config.py
cp -n src/robot_service/config.py.example src/robot_service/config.py
cp -n ./etc/psql/.env.example ./etc/psql/.env
make dc
make API_KEY=8031c622 import-movies
- See the database
- Rate and get movies
- The
config.py.example
values should be empty and do not have to be versioned. - The
movie_service
androbot_service
should be separated on different repositories. - Input data validator.
- No unit and integration testing.
- No postman documentation.