> ## Documentation Index
> Fetch the complete documentation index at: https://help.pixwel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

# Pixwel API

API manages files and metadata for the Pixwel Platform. Communicates to MongoDB, S3 and so forth. Consumed by the [pixwel ui](/ui/overview).

MVC, based around using [li3\_resources](https://github.com/nateabele/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

```bash theme={null}
composer install
```

## Structure

| Path              | Description                                                                                                                                                                          |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| \_build           | I'm not sure why this is called build, but it contains fixtures and migrations                                                                                                       |
| \_build/fixture   | Seed data for the local database. We suggest you read [api database](/api/database) for getting real data to work with.                                                              |
| \_build/migration | [Database](/api/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.                                                                                            |
| 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](/slurpee) go here                                                                                                                          |
| libraries         | What `git submodule init` will have installed.                                                                                                                                       |
| mails             | Templates for emails. See [maildev](/maildev).                                                                                                                                       |
| media             | This is where [slurpee](/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 web server configuration is stored in here.                                                                                                                  |
| node\_modules     | installed by `pnpm install` - basically, it's [faye](/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](/api/testing)                                                                                                                                          |
| test              | Slightly misleadingly named, this is the configuration for API static analysis.                                                                                                      |
| tests             | Legacy unit tests. See [api testing](/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           | Background worker commands, run as ECS services — see [services](/services).                                                                                                         |

## More API docs

* [Pixwel API - database](/api/database) - Getting real data into the API.
* [Pixwel API - testing](/api/testing) - Unit testing the Pixwel API
* [Pixwel API - xdebug](/api/xdebug) - Using XDebug with the API.
* [Pixwel API - troubleshooting](/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 >>](/api/database)
