Code Monkey home page Code Monkey logo

danielchristopher513 / calculator_microservices Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 86 KB

This is a microservices-based calculator application that allows users to perform various arithmetic operations. The application is built using Flask and Flask-RESTful and consists of multiple services that are orchestrated using Docker Compose. The frontend of the application is built using HTML and JavaScript.

Dockerfile 28.77% Python 60.36% HTML 10.88%
docker docker-compose flask python

calculator_microservices's Introduction

Breaking down monoliths ๐Ÿชจโ›๏ธ

Microservices-based Calculator Application

This is a microservices-based calculator application that allows users to perform various arithmetic operations. The application is built using Flask and Flask-RESTful and consists of multiple services that are orchestrated using Docker Compose. The frontend of the application is built using HTML and JavaScript.

Services

The application consists of the following services:

  • Addition Service: This service provides the functionality to add two numbers.
  • Subtraction Service: This service provides the functionality to subtract two numbers.
  • Multiplication Service: This service provides the functionality to multiply two numbers.
  • Division Service: This service provides the functionality to divide two numbers.
  • GCD Service: This service provides the functionality to calculate the Greatest Common Divisor of two numbers.
  • LCM Service: This service provides the functionality to calculate the Least Common Multiple of two numbers.
  • Modulus Service: This service provides the functionality to calculate the remainder of two numbers after division.
  • Exponent Service: This service provides the functionality to calculate the result of a power operation.
  • Greater Than Service: This service provides the functionality to check if the first value is greater than the second value.
  • Less Than Service: This service provides the functionality to check if the first value is less than the second value.
  • Equal Service: This service provides the functionality to check if the first value is equal to the second value.

Requirements:

  • docker and docker-compose. Follow the guides based on your operating system.
  • Internet. Pull docker image python:3.8-alpine beforehand to avoid connectivity issues.

Initial directory structure

โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ docs
โ”‚   โ””โ”€โ”€ <documentation related images/files>
โ”œโ”€โ”€ microservices
โ”‚   โ”œโ”€โ”€ Docker-compose.yaml
โ”‚   โ”œโ”€โ”€ landing
โ”‚   โ”‚   โ”œโ”€โ”€ app
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app.py
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ requirements.txt
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ templates
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ index.html
โ”‚   โ”‚   โ””โ”€โ”€ Dockerfile
โ”‚   โ”‚

Initial Monolith architecture diagram

Converted to Microservices-based architecture diagram


Build & Run

# under the microservices directory
# NOTE: For any code changes to be reflected, the build command must be rerun, and then up
docker-compose build
# run without the -d flag incase you want to observe the logs
docker-compose u

To stop the services in detached mode

docker-compose down

calculator_microservices's People

Contributors

danielchristopher513 avatar

Watchers

 avatar

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.