Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0mars/monoskel
An opinionated python app inspired by DDD and clean architecture [monorepo, REST, dependency-injection, falcon, marshmallow, swagger, openapi]
https://github.com/0mars/monoskel
clean-architecture docker falcon kafka microservice monorepo python rest
Last synced: about 1 month ago
JSON representation
An opinionated python app inspired by DDD and clean architecture [monorepo, REST, dependency-injection, falcon, marshmallow, swagger, openapi]
- Host: GitHub
- URL: https://github.com/0mars/monoskel
- Owner: 0mars
- License: apache-2.0
- Created: 2019-08-16T14:18:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T07:45:54.000Z (almost 2 years ago)
- Last Synced: 2023-03-30T21:57:49.402Z (over 1 year ago)
- Topics: clean-architecture, docker, falcon, kafka, microservice, monorepo, python, rest
- Language: Python
- Homepage:
- Size: 287 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE-Apache-2.0
Awesome Lists containing this project
README
# Mono Python Repo [REST over Falcon] - WIP
### Setup
```bash
make start
```
### New REST resource
- object definition, validation, serialization/deserialization
see https://github.com/ihiji/falcon-marshmallow- add swagger resource
```python
# schema
class HealthSchema(Schema):
status: fields.Str = fields.Str(required=True)
message: fields.Str = fields.Str(required=True)
class HealthCheck:
# Handles GET requests
def on_get(self, req, resp):
"""Internal description not shown in swagger docs.
---
summary: Check application health
responses:
200:
description: status response
schema: HealthSchema
"""
resp.status = falcon.HTTP_200
resp.body = json.dumps({"status": resp.status, "message": "healthy"})
```
in swagger/__init__.py
```python
self.spec.components.schema('Health', schema=injector.get(HealthSchema))
self.spec.path(resource=injector.get(HealthCheck))
```
Example:
https://github.com/0mars/monoskel/pull/9/files
### Usage
Swagger UI:
http://localhost:8021/v1/docs### Creating a new service container [WIP]
must run the following to install dependencies before running the application,
should be part of the container entrypoint, see packages/meerkat/.docker/entrypoint.sh, and meerkat/Makefile
```bash
make bootstrap
```### helpful commands
-- restart meerkat container
```bash
make restart meerkat
```-- rebuild meerkat container
```bash
make clean-restart meerkat
```-- remove all containers
```bash
make clean
```*Note:* please read Makefile for more commands, also Makefile under meerkat/
#### Credits
PyMedPhys for monomanage, monorepository manager