Giter Site home page Giter Site logo

im's Introduction

A server that exposes an HTTP-based API that is designed to receive a string of URL-encoded characters that can be used by the caller to determine whether the string is a duplicate, i.e. has already been seen by the server.

The HTTP server implements the following 2 API functions:

Submit a string for deduplication
Request:
POST /sequence/{sequence}
Response codes:
200 Description: Message received
Response body: {“duplicate”: [true|false]}

Clear deduplication history
Request:
PUT /clear
Response codes:
200 Description: Deduplication history cleared

Installation

Wants a modern Python (tested on 3.9)
Clone this repo:
git clone https://github.com/flavour/im
Setup a venv:
python -m venv venv_im
source venv_im/bin/activate
pip install -r requirements.txt

Run

uvicorn main:app

You can view/test the API via:
http://127.0.0.1:8000/docs

Productionise

  • Add Authentication
  • Switch to a DB like Postgres, or maybe Redis for such a simple data model
  • Front uvicorn with nginx (inc SSL via LetsEncrypt) and gunicorn -w 4 -k uvicorn.workers.UvicornWorker
  • Try to get modified version of framework components integrated upstream
  • Add Test suite
  • Convert into a Package, so we can just install this with pip
  • Dockerfile

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.