Skip to content
/ monoskel Public

An opinionated python app inspired by DDD and clean architecture [monorepo, REST, dependency-injection, falcon, marshmallow, swagger, openapi]

License

Notifications You must be signed in to change notification settings

0mars/monoskel

Repository files navigation

Mono Python Repo [REST over Falcon] - WIP

Setup

make start  

New REST resource

# 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

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

make bootstrap

helpful commands

-- restart meerkat container

make restart meerkat

-- rebuild meerkat container

make clean-restart meerkat

-- remove all containers

make clean

Note: please read Makefile for more commands, also Makefile under meerkat/

Credits

PyMedPhys for monomanage, monorepository manager

About

An opinionated python app inspired by DDD and clean architecture [monorepo, REST, dependency-injection, falcon, marshmallow, swagger, openapi]

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published