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
Setup
Structure
| Path | Description |
|---|---|
| _build | I’m not sure why this is called build, but it contains fixtures and migrations |
| _build/fixture | Used for creating the database on Vagrant environments. We suggest you read api database for information on getting real data to work with. |
| _build/migration | Database migrations |
| bin | This is where the Kahlan executable gets installed to when composer install is run |
| config | Standard li3 configuration files. We tend to use environment variables for configuration. See ansible. |
| controllers | The C in MVC. See also the proxies, which plug into the controllers for decoration. |
| core | |
| extensions | Things that “extend” the Li3 framework |
| files | The input and output queues for slurpee go here |
| libraries | What git submodule init will have installed. |
| mails | Templates for emails. See maildev. |
| media | This is where slurpee lives. |
| models | The 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. |
| net | Stuff that talks to DotSub (which is a tool that does captioning) and CloudFront. |
| nginx | For legacy reasons, the configuration for the web server is stored in here. Ansible overwrites this file in deploying to some environments. |
| node_modules | installed by pnpm install - basically, it’s faye |
| notification | Code related to notifying users about what’s happened |
| proxies | Things that plug in to the controllers |
| resources | > TODO is this even used at all? |
| spec | Unit tests. See api testing |
| test | Slightly misleadingly named, this is the configuration for API static analysis. |
| tests | Legacy unit tests. See api testing |
| transactions | Any transactional code should go here. |
| util | Generic utility classes. |
| vendor | Installed by Composer. |
| views | Mostly the API talks in JSON but on the occasion that it does not, the templates are in here. |
| webroot | The front controller lives in here. This is where the web server serves from. |
| workers | Often installed by Ansible for scheduled tasks. |
More API docs
- Pixwel API - database - Getting real data into the API.
- Pixwel API - testing - Unit testing the Pixwel API
- Pixwel API - xdebug - Using XDebug with the API.
- Pixwel API - troubleshooting - API troubleshooting. Simply a dump of problems we’ve had and solutions/workarounds.
Back to docs index | Next page in recommended reading order >>