{"id":13601129,"url":"https://github.com/vanilla-rtb/extensions","last_synced_at":"2025-04-11T01:30:57.683Z","repository":{"id":29798346,"uuid":"121474915","full_name":"vanilla-rtb/extensions","owner":"vanilla-rtb","description":"Code Generators and Extensions for vanilla-rtb stack ","archived":false,"fork":false,"pushed_at":"2024-03-03T19:03:36.000Z","size":247,"stargazers_count":19,"open_issues_count":14,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T16:54:37.386Z","etag":null,"topics":["ad-tech","ads","adserver","adtech","beeswax","bidder","binding-generator","campaign","digital-media","extensions","handlebars","handlebars-template","integration","iponweb","mustache-templating","openrtb","programatic","rtb","stub","vanilla-rtb"],"latest_commit_sha":null,"homepage":"https://github.com/venediktov/vanilla-rtb","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanilla-rtb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-02-14T05:34:01.000Z","updated_at":"2024-02-27T14:02:41.000Z","dependencies_parsed_at":"2024-03-10T15:05:09.513Z","dependency_job_id":null,"html_url":"https://github.com/vanilla-rtb/extensions","commit_stats":{"total_commits":80,"total_committers":6,"mean_commits":"13.333333333333334","dds":0.55,"last_synced_commit":"7efc14b4cdf9673eaacc5669a52ec4bd5b531597"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanilla-rtb%2Fextensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanilla-rtb%2Fextensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanilla-rtb%2Fextensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanilla-rtb%2Fextensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanilla-rtb","download_url":"https://codeload.github.com/vanilla-rtb/extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248325048,"owners_count":21084860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ad-tech","ads","adserver","adtech","beeswax","bidder","binding-generator","campaign","digital-media","extensions","handlebars","handlebars-template","integration","iponweb","mustache-templating","openrtb","programatic","rtb","stub","vanilla-rtb"],"created_at":"2024-08-01T18:00:56.190Z","updated_at":"2025-04-11T01:30:53.193Z","avatar_url":"https://github.com/vanilla-rtb.png","language":"Go","readme":"[![alt text][1.1]][1]\n[![alt text][2.1]][2]\n[![alt text][3.1]][3]\n[![alt text][4.1]][4]\n[![alt text][5.1]][5]\n\n[1.1]: http://i.imgur.com/tXSoThF.png (twitter icon with padding)\n[2.1]: http://i.imgur.com/P3YfQoD.png (facebook icon with padding)\n[3.1]: http://i.imgur.com/yCsTjba.png (google plus icon with padding)\n[4.1]: http://i.imgur.com/YckIOms.png (tumblr icon with padding)\n[5.1]: http://i.imgur.com/0o48UoR.png (github icon with padding)\n\n[1]: http://www.twitter.com/vanilla_rtb\n[2]: http://www.linkedin.com/company/vanillartb\n[3]: https://plus.google.com/+VladimirVenediktov\n[4]: http://forkbid.com\n[5]: http://www.github.com/vanilla-rtb\n\n# VanillaRTB extensions\nCode Generators and Extensions for VanillaRTB framework in Node.js, Go, Java , PHP, Python.\n\n[![Join the chat at https://gitter.im/vanilla-rtb/Lobby](https://badges.gitter.im/vanilla-rtb/Lobby.svg)](https://gitter.im/vanilla-rtb/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) \n[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](http://perso.crans.org/besson/LICENSE.html)\n\n### Contributing [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/vanilla-rtb/extensions/issues)\n\n\nRecommended build environment and dependencies: [![Installing Dependencies](https://img.shields.io/badge/Dependencies-wiki-green.svg)](https://github.com/vanilla-rtb/extensions/wiki/Installing-Dependencies)\n\n**Linux or MacOS, Go \u003e= 1.9 , CMake \u003e= 3.8, GCC \u003e= 7.0 or Clang \u003e= 4.0, npm \u003e= 5.7.1** \n\n```npm --version```\n\nOutput:```5.7.1```\n\n**npm installation(Linux):**\n\n```\nsudo apt-get remove nodejs ^node-* nodejs-*\nsudo apt-get autoremove\nsudo apt-get clean\ncurl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -\nsudo apt-get install nodejs\n```\n\nThen :\n```\ncurl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | sh\n```\nAfter this, open a new terminal and check the npm version:\n\n```\nnpm --version\n```\n\n**npm installation(MacOS HomeBrew):**\n```\nbrew update\nbrew install node\n```\n\nGo 1.9 ( Linux )\n\n```\n$ sudo add-apt-repository ppa:gophers/archive\n$ sudo apt-get update\n$ sudo apt-get install golang-1.9-go\n$ sudo ln -s -f /usr/lib/go-1.9/bin/go /usr/bin/go\n$ sudo ln -s -f /usr/lib/go-1.9/bin/gofmt /usr/bin/gofmt\n```\n\nGo 1.9 ( MacOS )\n\n```\nbrew update\nbrew install go\n```\n### 1. To install vanilla-rtb-extensions golang libraries run  ```install.sh``` or execute below commands\n\n```bash\nrm -rf $GOPATH/src/github.com/vanilla-rtb/\nrm -rf $GOPATH/src/stubs\ngo get github.com/jessevdk/go-flags\ngo get -d github.com/vanilla-rtb/extensions\nmv $GOPATH/src/github.com/vanilla-rtb/extensions/stubs $GOPATH/src/stubs\ngo install github.com/vanilla-rtb/extensions\ngo install stubs\n```\n\nMake sure you pass ```-d``` flag to  ```go get``` command when installing vanilla-rtb/extensions it will clone our project\nwithout actually installing in the ```$GOPATH\\pkg``` folder .\n\nThe main reason behind such installation is  ```import \"stubs\"``` directive in our bidder_generator.go uses relative path allowing you to import your own stubs and  generate your own targeting cache not just what we provide with our examples\n\n### 2. Download vanilla-rtb extensions to working folder \n```\ngit clone --recursive  https://github.com/vanilla-rtb/extensions \n```\n\n### 3. To generate targeting code and application utilizing it execute following command\ns \n```\ncd extensions\ngo run  bidder_generator.go --output-dir . --input-template templates/matcher.tmpl -g matchers\ngo run  bidder_generator.go --output-dir . --input-template templates/biddergo.tmpl -g app -T ico -B APP\n```\n### 4. To generate bidder library for later binding to other languages like NodeJS/Go/etc run following command sequence  \n```\ngo run  bidder_generator.go --output-dir . --input-template templates/matcher.tmpl -g matchers\ngo run  ../bidder_generator.go --output-dir . --input-template ../templates/biddergo.tmpl -g app -T ico -B LIB\n```\n**For more information HELP in generator itself**\n```\ngo run bidder_generator.go --help\n```\n\n**Our generator is referencing** ``` import \"stubs\" ``` **without full path to github repo , it's treated as your local package\nwhere you will store all of your future stubs.**\n\nThe code you place in the stubs package needs to register your stub classes it's done with\n```TypeRegistry``` exported package variable.\nJust add more  Objects to the registry  and ```codegen``` will automatically regenerate all your stubs.  \n\n```\nvar TypeRegistry = []reflect.Type{\n    reflect.ValueOf(Domain{}).Type(),\n    reflect.ValueOf(ICOCampaign{}).Type(),\n    reflect.ValueOf(Geo{}).Type(),\n    reflect.ValueOf(GeoCampaign{}).Type(),\n}\n```\n\nIt also needs to group stubs types by targeting model as shown below , the order in array coresponds to order executed by bidder in real time \n\n```\n//agregate  targetings based on the bidder model the execution in the bidder will preserve as order of declaration\nvar Targetings = map[string][]reflect.Type{\n    \"ico\": []reflect.Type{\n        reflect.ValueOf(Domain{}).Type(),\n        reflect.ValueOf(ICOCampaign{}).Type(),\n    },\n    \"geo\": []reflect.Type{\n        reflect.ValueOf(Geo{}).Type(),\n        reflect.ValueOf(GeoCampaign{}).Type(),\n    },\n}\n```\n\nThe type passed to registry must be annotated with golang tags for ability to wire in-proc and shared memory correctly \nFor types that allocate on the heap there needs to be a conversion ```cpp:\"std::string\" ipc:\"shared_string\"```\n\nThe Domain struct tags implicetely tells generator that the lookup is done by single key ```domain name``` , the sorage structure generated for shared memory acess can be expressed as Map\u003cstring, Domain\u003e where string type is a key and Domain type is a value. VanillaRTB relies on those structures when matching campaigns and it uses these set of ```implicitly chained structures``` where output from first becomes input for the next step in matching rule, if any matcher in the chain fails before it reaches the last matcher aka campaign-collector no bid is returned by vanilla-rtb stack.\nThe terminal function selectingthe Ads is not included in the stubs it's implicit it comes as library by default accepting collection of Campaigns.\nWhen looking at \"ico\" or \"geo\" examples in both cases collection of ICOCampaign or GeoCampaign is automatically fed into terminal AdSelector which matches based on the campaign ids and size of ad. \n\n```\ntype Domain struct {\n    name      string `cpp:\"std::string\"  ipc:\"shared_string\" is_key:\"yes\"`\n    domain_id uint32 `cpp:\"uint32_t\" ipc:\"uint32_t\"`\n}\n\ntype ICOCampaign struct {\n    domain_id   uint32 `cpp:\"uint32_t\" ipc:\"uint32_t\" is_key:\"yes\"`\n    campaign_id uint32 `cpp:\"uint32_t\" ipc:\"uint32_t\"`\n}\n\ntype Geo struct {\n city string `cpp:\"std::string\"  ipc:\"shared_string\" is_key:\"yes\"`\n country string `cpp:\"std::string\"  ipc:\"shared_string\" is_key:\"yes\"`\n geo_id uint32 `cpp:\"uint32_t\" ipc:\"uint32_t\" is_value:\"yes\"`\n}\n\ntype GeoCampaign struct {\n    geo_id      uint32 `cpp:\"uint32_t\" ipc:\"uint32_t\" is_key:\"yes\"`\n    campaign_id uint32 `cpp:\"uint32_t\" ipc:\"uint32_t\" is_value:\"yes\"`\n}\n```\n\nCurrently we generate C++ bidder code based on vanilla-rtb library API and manually code other languages bindings.\nIdeally we should generate both the C++ layer and the bindings.\n \n5. Experimental generator for vanilla-rtb stand alone C++ project \n```bash\ngo run  bidder_generator.go --output-dir . --input-template templates/cmake.tmpl -g cmake\n```\n\n[![Join the chat at https://gitter.im/vanilla-rtb/Lobby](https://badges.gitter.im/vanilla-rtb/Lobby.svg)](https://gitter.im/vanilla-rtb/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/vanilla-rtb/extensions/issues)\n[![Installing Dependencies](https://img.shields.io/badge/Dependencies-wiki-green.svg)](https://github.com/vanilla-rtb/extensions/wiki/Installing-Dependencies)\n\n**VIDEO:**\n\n[![Alt text for your video](https://img.youtube.com/vi/saJQ-Y_VkCA/0.jpg)](http://www.youtube.com/watch?v=saJQ-Y_VkCA)\n","funding_links":[],"categories":["Table of Contents"],"sub_categories":["Applications Engines and Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanilla-rtb%2Fextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanilla-rtb%2Fextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanilla-rtb%2Fextensions/lists"}