Giter Club home page Giter Club logo

delivery_fee_calculator's Introduction

Backend DemoCancel changes

for wolt 2023 summer intership pre-assignment

Set up

There are two ways to run this project:

Local environment

cd app
pip3 install -r requirements.txt
python3 main.py

# unit test
python3 -m pytest tests

# curl test
curl --location --request POST 'http://127.0.0.1:8080' \
--header 'Content-Type: application/json' \
--data-raw '{"cart_value": 790, "delivery_distance": 2235, "number_of_items": 4, "time": "2021-10-12T13:00:00Z"}
'

Docker

# on Compose V2, the new docker compose command was introduced; if you are using an older version, use docker-compose instead
docker compose up -d

# enter the container
docker exec -it delivery_fee_calculator-app-1 bash

# destroy
docker compose down

Reflections

If the delivery fee calculator is a part of a larger system as a miroservice, I would consider the following:

  1. Use a message queue to decouple the delivery fee calculator from the rest of the system. Because this service maybe down for a while of be called by a large number of users simultaneously. If we use message queue, the delivery fee calculator can be scaled independently from the rest of the system.

  2. Deploy a load balancer to distribute the load to multiple instances of the delivery fee calculator if there are numerous calls to the service.

  3. Implement observability to monitor the health of the service and the performance of the service.

  4. Log the requests and responses to the service into files to help with debugging.

  5. Set up CI/CD to automate the deployment of the service.

delivery_fee_calculator's People

Contributors

jinjiakarl avatar

Stargazers

 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.