Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ssola/python-flask-microservice
Skeleton of a Microservice built with the Flask
https://github.com/ssola/python-flask-microservice
flask microservice python skeleton
Last synced: about 2 months ago
JSON representation
Skeleton of a Microservice built with the Flask
- Host: GitHub
- URL: https://github.com/ssola/python-flask-microservice
- Owner: ssola
- License: apache-2.0
- Created: 2017-03-06T18:30:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-03-30T09:22:29.000Z (almost 3 years ago)
- Last Synced: 2024-08-04T09:05:57.607Z (5 months ago)
- Topics: flask, microservice, python, skeleton
- Language: Python
- Size: 22.5 KB
- Stars: 588
- Watchers: 43
- Forks: 185
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list-microservice - python-flask-microservice
- jimsghstars - ssola/python-flask-microservice - Skeleton of a Microservice built with the Flask (Python)
README
# python-flask-microservice
This is the code used in this series of articles:
- https://medium.com/p/building-microservices-with-python-part-i-5240a8dcc2fb
- https://medium.com/@ssola/building-microservices-with-python-part-2-9f951199094a#.z48wq941g
- https://medium.com/@ssola/building-microservices-with-python-part-3-a556a4c4bc00#.yn4p8rstpThis is a basic approach of building a Microservice on top of Flask, with some useful packages like:
- [Flask](http://flask.pocoo.org/)
- [Flask-Injector](https://pypi.python.org/pypi/Flask-Injector)
- [Connexion](https://github.com/zalando/connexion)# Requirements
We are going to build a microservice to index rooms information coming from another service (crawler). This service will be responsible for indexing the information into Elasticsearch.
The indexing will be a process of:
- Validate and sanitize the data
- Get some metadata from the room information like geolocalization
- Upload the given images URL to [Amazon S3](https://github.com/boto/boto)
- Send an event to [RabbitMQ](https://github.com/pika/pika) every time a new room has been indexed serializing the payload with Avro.**Endpoints**:
|Method|URI|Description| Status |
|------|---|-----------|--------|
| POST | /room | it will receive the room payload, and it will proceed to index it | **Development** |
| PATCH | /room/{id} | this PATCH method will allow us to make changes on the indexed item | Not started |
| DELETE | /room/{id} | this method will remove the room from the index | Not started |
| GET | /room/{id} | this method will return the room data for a given room id | Not started |
| GET | /health-check | This endpoint retuns the state of the service | Not started |# Running the environment
You need to have Docker installed in your machine, after that, just run this command `docker-compose build && docker-compose up -d`.