Coder Social home page Coder Social logo

eskimi-realtime-bidding's Introduction

Background

Using the actor model (akka-http) this project implements a simple realtime bidding platform based on these requirements

Read about how rtb platforms work here - https://en.wikipedia.org/wiki/Real-time_bidding

In this project, the matching between campaigns and bids is done (in order) as follows:

  1. Country of the campaign and targeted site IDs match the bid's

  2. The price set for the campaign is greater than or equal to the bid's floor

  3. The banner(s) in the campaign have a valid width and height i.e. width and height between the bid's min and max allowances

Usage

This project uses Scala 2.13.4 and sbt 1.5.8

$ git clone https://github.com/kelvingakuo/eskimi-realtime-bidding

$ cd realtimebidding

Start server

sbt run

Starts a server on localhost:8080

Testing

HTTP

Modify the file realtimebidding/src/main/scala/Campaign.scala to have different campaign configurations.

Use cURL or any REST client to pass the bid request to the server. See the file test_rtb.http for a sample request

Scala file contents

In the directory realtimebidding/src/main/scala, the files are:

  1. Main.scala - Entry point of the server. Defines the routes, binds to the host etc.

  2. Protocol.scala - Class definitions for the different elements of rtb i.e. campaign, impression etc.

  3. Campaingn.scala - Sample campaigns in form of a Seq of Campaign objects

  4. BiddingActor.scala - Defines the bidding logic as an Actor.

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.