RED Interactive Agency - FF0000 Ad Tech
tmpl-build-sources
Overview
This project generates FF0000 Ad Tech Ad Templates, per requested:
- Platform (DCM, DC Studio, Velvet, Flashtalking, Sizmek, Atlas, Monet, etc)
- Type (Standard Polite, Intro/Endframe, Expandable, etc)
- Options (Date Management, Video Players, Tracking Pixels, etc)
Build Sources are the code-snippets that are assembled together to create the requested Ad Templates. The relationships are modeled using json
-based files, called stub.json
. The insertions are denoted by a "template hook" system. For more information about about how Build Sources work, see Build Source Management.
Getting Started
- NPM Install this project
- Run Build Source Server
- Preview: Platforms, Types, and Options
- Download: Sizes for Development
System Dependencies
Make sure your machine has at least these versions installed:
- Node
^9.0.0
- NPM
^6.0.0
- Python
^2.7.0
You can check your versions in Terminal (or shell of preference): Execute commands node -v
, npm -v
, and python
to see which versions you're running. If you need to update or install, check online for instructions for your operating system.
Install Project
Clone or Download this repo and unzip it. In Terminal, cd
into the result directory, then:
npm install
Build Source Server
Build Source Server will give you an interface to generate browser-runnable ads from the Build Source stubs.
Run it with this command:
npm start
Preview
Preview provides a way to quickly verify edits to Build Source stubs. They are organized accordian-style by
- Platform
- Type
- Options
Select what you wish to preview, and click .
The following processes will happen:
- Render Build Source
- NPM Install top / build packages
- Launch Creative Server
- Run Traffic-compile
Once complete, the will become clickable. That means a Creative Server is running and has a 3-traffic/
folder to serve as a preview.
Download
Download generates clean, uninstalled templates. Use these for ad development!
Select what you wish to download, and click the "Download" button. You will be prompted for a size.
REST API + Postman
Build Source Server exposes a REST API for executing functionality. Postman is a tool that lets you craft & save HTTP requests. Once the server is running, you can use the API + Postman together to save & execute commands.
Making requests in this manner is useful for:
- modifying & testing the actual Build Source layer
- keeping ecosystem templates up-to-date by mapping renders to any location in your ecosystem
For all routes, refer to ./routes/api.js.
Build Source Requests
Requests to Assemble (http://localhost:4200/api/assemble) or Preview (http://localhost:4200/api/preview) require a POST body of valid JSON. Consider the following format:
{
"units": [
{
"name": "standard-base",
"build_size": "300x250",
"build_source": {
"build_source_path": "./standard-base/"
},
"build_source_options": {
"stub_paths": [
"./AD-BASE/options/sample-uicomponents/stub.json"
]
}
}
]
}
Additional URL parameters are:
- &reinstall Optional, @string: "top", "build" - forces the reinstall of requested package.json
- &hooks Optional, @boolean: if truthy, hooks will not be removed from the build-source. Helpful for debugging
- &verbose Optional, @boolean: if truthy, processes log more output to stdout
Build Source Management
Build Sources are a hierarchy of code snippets & assets that are mapped with a collection of stub.json
and are rendered with an internal python engine. These sources can be found in the ./build_sources
folder.
If you want to make edits to the Build Sources, you must learn the "Stub Map" system. These docs are currently internal only: https://confluence.ff0000.com/display/AT/Technical+Overview
Build Source Map
In order to keep the UI snappy, available build sources (http://localhost:4200/api/list) are pre-mapped to ./build_sources/_build_source_maps.json
.
This map needs to be updated when you change the top level folder-naming or -structure in ./build_sources
.
The following route updates the map: