Skip to main content

Pixwel API

API manages files and metadata for the Pixwel Platform. Communicates to MongoDB, S3 and so forth. Consumed by the pixwel ui. MVC, based around using li3_resources, with a philosophy:
  • Provide a consistent, conventional way across the application to query objects, and a standard interface to manipulate queries
  • Abstract away the differences between browsers and API clients, allowing controller code to focus on business logic
  • Conform to the principles of REST and hypermedia
This means the controllers may seem a little “magic” at first, but you will get used to it.

Setup

composer install

Structure

PathDescription
_buildI’m not sure why this is called build, but it contains fixtures and migrations
_build/fixtureUsed for creating the database on Vagrant environments. We suggest you read api database for information on getting real data to work with.
_build/migrationDatabase migrations
binThis is where the Kahlan executable gets installed to when composer install is run
configStandard li3 configuration files. We tend to use environment variables for configuration. See ansible.
controllersThe C in MVC. See also the proxies, which plug into the controllers for decoration.
core
extensionsThings that “extend” the Li3 framework
filesThe input and output queues for slurpee go here
librariesWhat git submodule init will have installed.
mailsTemplates for emails. See maildev.
mediaThis is where slurpee lives.
modelsThe M in MVC. Models have quite a clever plugin system whereby you can have handlers on their CRUD. These plugins are stored in subdirectories named for the models they plug in to.
netStuff that talks to DotSub (which is a tool that does captioning) and CloudFront.
nginxFor legacy reasons, the configuration for the web server is stored in here. Ansible overwrites this file in deploying to some environments.
node_modulesinstalled by pnpm install - basically, it’s faye
notificationCode related to notifying users about what’s happened
proxiesThings that plug in to the controllers
resources> TODO is this even used at all?
specUnit tests. See api testing
testSlightly misleadingly named, this is the configuration for API static analysis.
testsLegacy unit tests. See api testing
transactionsAny transactional code should go here.
utilGeneric utility classes.
vendorInstalled by Composer.
viewsMostly the API talks in JSON but on the occasion that it does not, the templates are in here.
webrootThe front controller lives in here. This is where the web server serves from.
workersOften installed by Ansible for scheduled tasks.

More API docs


Back to docs index | Next page in recommended reading order >>