Skip to content

Commit adfab4d

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents bc7c958 + 2024c75 commit adfab4d

21 files changed

+149
-91
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# microservices-scaffold
2-
Barebones Python Microservices
2+
Python Microservice Scaffold is an example of how to structure a Flask Microservice Project.
3+
This Scaffold is build over [PyMS](https://github.com/python-microservices/pyms) package. PyMS is a [Microservice chassis pattern](https://microservices.io/patterns/microservice-chassis.html)
4+
like Spring Boot (Java) or Gizmo (Golang). PyMS is a collection of libraries, best practices and recommended ways to build
5+
microservices with Python which handles cross-cutting concerns:
6+
- Externalized configuration
7+
- Logging
8+
- Health checks
9+
- Metrics (TODO)
10+
- Distributed tracing
311

412
[![Build Status](https://travis-ci.org/python-microservices/microservices-scaffold.svg?branch=master)](https://travis-ci.org/python-microservices/microservices-scaffold)
513
[![Coverage Status](https://coveralls.io/repos/github/python-microservices/microservices-scaffold/badge.svg?branch=master)](https://coveralls.io/github/python-microservices/microservices-scaffold?branch=master)
@@ -8,6 +16,19 @@ Barebones Python Microservices
816
[![Python 3](https://pyup.io/repos/github/python-microservices/microservices-scaffold/python-3-shield.svg)](https://pyup.io/repos/github/python-microservices/microservices-scaffold/)
917

1018

19+
# How to run the scaffold
20+
21+
```bash
22+
virtualenv --python=python[3.6|3.7|3.8] venv
23+
source venv/bin/activate
24+
pip install -r requirements.txt
25+
python manage.py runserver
26+
```
27+
28+
Open in your browser http://localhost:5000/template/ui/
29+
30+
Read more info in the documentation page:
31+
https://microservices-scaffold.readthedocs.io/en/latest/
1132

1233
# Docker
1334

@@ -27,7 +48,7 @@ Push to Kubernetes:
2748

2849
## How to contrib
2950

30-
TODO
51+
See https://github.com/python-microservices/pyms/blob/master/CONTRIBUTING.md
3152

3253
### Update docs
3354

config-docker.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
pyms:
2+
requests:
3+
data: ""
4+
swagger:
5+
path: "swagger"
6+
file: "swagger.yaml"
17
ms:
28
DEBUG: false
39
TESTING: false
@@ -6,4 +12,4 @@ ms:
612
SQLALCHEMY_TRACK_MODIFICATIONS: true
713
SECRET_KEY: "gjr39dkjn344_!67#"
814
DATABASE: db.sqlite3
9-
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/database/db.sqlite3
15+
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/database/db.sqlite3

config.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
pyms:
2+
requests:
3+
data: ""
4+
swagger:
5+
path: "swagger"
6+
file: "swagger.yaml"
17
ms:
28
DEBUG: false
39
TESTING: false
@@ -6,4 +12,4 @@ ms:
612
SQLALCHEMY_TRACK_MODIFICATIONS: true
713
SECRET_KEY: "gjr39dkjn344_!67#"
814
DATABASE: db.sqlite3
9-
SQLALCHEMY_DATABASE_URI: sqlite:////microservice/database/db.sqlite3
15+
SQLALCHEMY_DATABASE_URI: sqlite:////tmp/db.sqlite3

docs/_static/aws_alias0.png

-23 KB
Binary file not shown.

docs/_static/aws_alias1.png

-35.9 KB
Binary file not shown.

docs/_static/aws_alias2.png

-27.6 KB
Binary file not shown.

docs/_static/aws_environments.png

-42.3 KB
Binary file not shown.

docs/codeexample.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Code Examples
22
=============
33

4+
See simple examples in https://github.com/python-microservices/pyms/tree/master/examples

docs/configuration.rst

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
Configuration
22
=============
33

4-
The project is configured in `project/config.py`. You must set the project name `APP_NAME` and the path prefix
5-
of the project `APPLICATION_ROOT`. This constants is defined in the class Config:
6-
7-
.. code-block:: python
8-
9-
class Config:
10-
DEBUG = False
11-
TESTING = False
12-
APP_NAME = "Template"
13-
APPLICATION_ROOT = "/template"
4+
Project configuration is loaded using py-ms package based on yml or json file.
5+
Some example files are config.yml, config-docker.yml and tests/config-tests.yml or see `PyMS configuration <https://py-ms.readthedocs.io/en/latest/configuration/>`_
146

157
Documentation
168
-------------
179
The Microservice create a URL to inspect the Swagger documentation of the api in:
1810

1911
.. code-block:: bash
12+
2013
localhost:5000/[APPLICATION_ROOT]/ui/
2114
2215
Our API Rest work with `connexion <http://connexion.readthedocs.io>`_. You can see connexion docs or the official

docs/index.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,28 @@
44
55
Python Microservices
66
====================
7+
Python Microservice Scaffold is an example of how to structure a Flask Microservice Project.
8+
This Scaffold is build over `PyMS <https://github.com/python-microservices/pyms>`_ package. PyMS is a `Microservice chassis pattern <https://microservices.io/patterns/microservice-chassis.html>`_
9+
like Spring Boot (Java) or Gizmo (Golang). PyMS is a collection of libraries, best practices and recommended ways to build
10+
microservices with Python which handles cross-cutting concerns:
11+
12+
* Externalized configuration
13+
* Logging
14+
* Health checks
15+
* Metrics (TODO)
16+
* Distributed tracing
17+
718

819
Stack
920
-----
10-
* `connexion <http://connexion.readthedocs.io>`_
11-
* `Flask <https://github.com/pallets/flask>`_
21+
* `PyMS <https://github.com/python-microservices/pyms>`_
22+
* `Flask <https://github.com/pallets/flask>`_
23+
* `connexion <http://connexion.readthedocs.io>`_
24+
* `Opentracing <https://github.com/opentracing-contrib/python-flask>`_
1225
* `SQLAlchemy <https://www.sqlalchemy.org/>`_
1326
* `Flask-SQLAlchemy <http://flask-sqlalchemy.pocoo.org/2.3/>`_
14-
* `Flask-Injector <https://github.com/alecthomas/flask_injector>`_
1527
* `Flask-Script <https://flask-script.readthedocs.io/en/latest/>`_
16-
* `Opentracing <https://github.com/opentracing-contrib/python-flask>`_
28+
1729

1830

1931
Content

0 commit comments

Comments
 (0)