Code Monkey home page Code Monkey logo

django-microservices's Introduction

UNMAINTAINED

Microservices architecture based web application

This is example web application based on microservices architecture. It has 3 decoupled and scalable services:

  1. Products Management
  2. Order Management
  3. Email Sending

Technology Stack:

  1. Python

  2. Django/Django REST Framework

  3. Mongodb

  4. Nginx

  5. Docker

  6. Swagger UI

Python used as the backend development language. Django used as the backend framework. Django REST Framework or DRF used as the REST API development framework, Mongodb used as the database backend, Nginx used as the API gateway and finally docker used as the deployment method. Swagger used for documenting API

Each services have their seperate database completely decoupled. Nginx sits in front of each of the services to abstract all the microservices API endpoints into single one.

For testing:

  1. Clone the repo
  2. Run "docker-compose build" while inside the services folder
  3. After docker completes all the building staffs, run "docker-compose up -d" to run each microservices.
  4. Now go to your localhost, docker machine ip or server ip to access the API endpoints.

API endpoints: please see /api/v1/{services}/docs/

Deployed and tested in a real production server.

django-microservices's People

Contributors

cyantarek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-microservices's Issues

LICENSE file?

May I ask that a LICENSE file is added? I'd like to use this project as a potential base for a certain project and would know if it's possible depending on the license you choose.

Thanks!

Products, emails, orders didn`t started!

Images services_products_web, services_email_web, services_orders_web didn`t work properly.

LOG for services_products_web:
No module named 'rest_framework_swagger'

LOG for services_email_web:
Apply all migrations: api
Running migrations:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/djongo/sql2mongo/query.py", line 806, in parse
return handler(self, statement)
File "/usr/local/lib/python3.6/site-packages/djongo/sql2mongo/query.py", line 848, in _create
self.db.create_collection(table)
File "/usr/local/lib/python3.6/site-packages/pymongo/database.py", line 365, in create_collection
raise CollectionInvalid("collection %s already exists" % name)
pymongo.errors.CollectionInvalid: collection api_email already exists

LOG for services_orders_web:
Apply all migrations: api
Running migrations:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/djongo/sql2mongo/query.py", line 806, in parse
return handler(self, statement)
File "/usr/local/lib/python3.6/site-packages/djongo/sql2mongo/query.py", line 848, in _create
self.db.create_collection(table)
File "/usr/local/lib/python3.6/site-packages/pymongo/database.py", line 365, in create_collection
raise CollectionInvalid("collection %s already exists" % name)
pymongo.errors.CollectionInvalid: collection api_order already exists

OS: Tested in Windows 10 and Ubuntu 16

pg_config executable not found.

When I run docker-decompose build I am getting this error

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).

Stopping services_mongod_1 ... etc

$ docker-compose up -d"

Expected result:

running services

Actual result

error:
Stopping services_mongod_1 ... done Removing services_mongod_1 ... done Removing network services_default Creating network "services_default" with the default driver Creating services_mongod_1 ... done Creating services_orders_web_1 ... error Creating services_emails_web_1 ... Creating services_products_web_1 ... Creating services_emails_web_1 ... error ERROR: for services_orders_web_1 Cannot create container for service orders_web: b'invalid mode: /code' Creating services_products_web_1 ... error ERROR: for services_products_web_1 Cannot create container for service products_web: b'invalid mode: /code' ERROR: for orders_web Cannot create container for service orders_web: b'invalid mode: /code' ERROR: for emails_web Cannot create container for service emails_web: b'invalid mode: /code' ERROR: for products_web Cannot create container for service products_web: b'invalid mode: /code' ERROR: Encountered errors while bringing up the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.