Code Monkey home page Code Monkey logo

flask-microservice-architecture-template's Introduction

Flask-Microservice-Template

Usage

To use this application, you will need to have Docker and Docker Compose installed on your system. Once you have those installed, navigate to the Application directory and run the run.sh script. This will start all the services defined in the docker-compose.yml file.

Here are the step-by-step instructions for using this microservice architecture:

  1. Make sure you have Docker and Docker Compose installed on your system. If you don't have them installed, you can download them from their website.

  2. Open a terminal or command prompt and navigate to the flask-microservice-template directory.

  3. Run the run.sh script by typing sh run.sh and pressing enter. This will start all the services defined in the docker-compose.yml file.

  4. Open a web browser and navigate to http://localhost:8000. This will take you to the main page of the application.

Architecture

This architecture consists of several microservices: service_1, service_2, and main_service. Each of these microservices has its own Dockerfile, which is used to build a Docker image for that service. The services also have their own directories named app that contain the Python files __init__.py, views.py and models.py. Additionally, each service has a requirements.txt file that specifies its dependencies and a run.py file that starts the service.

The different services are orchestrated together using a docker-compose.yml file in the Application directory.

Testing

You can test each service by entering pytest in their each enviroment. To test the main application you need to run test.sh script in the root directory.

Accessing External API Calls

You can access each API by specifying docker container name, port number and endpoint. For example:

Persistant Folder

Each service has a persistent folder where data is stored and remains even when Docker is restarted. This means that any changes made within Docker are also reflected on the local machine.

flask-microservice-architecture-template's People

Contributors

biebras avatar yuelinxin avatar

Stargazers

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

Watchers

 avatar

flask-microservice-architecture-template's Issues

Unit testing

When executing the test.sh script, all pytests should be run inside a Docker container. Once the tests have completed, the container should be automatically closed.

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.