# Cardbox v0.1.0 - API Reference

## Modules

- Your module
  - [Cardbox](Cardbox.md): Collections for Phoenix: records of one kind, with fields your users
define, seen as a table, a board, a calendar, a chart or a canvas.

- Collections
  - [Cardbox.Collection](Cardbox.Collection.md): A collection: records of one kind, with the same fields.
  - [Cardbox.Field](Cardbox.Field.md): A field of a collection: its `name`, its `type` (`Cardbox.Type`) and
that type's `options`.
  - [Cardbox.Record](Cardbox.Record.md): A record of a collection: its values, by field key, in `data`.
  - [Cardbox.View](Cardbox.View.md): A saved view of a collection: how it shows (`type`), which records, in
which order (`query`, `Cardbox.Query`'s wire format), and the options of
its type.

- Types
  - [Cardbox.Choice](Cardbox.Choice.md): The choices of a select, a multi-select or a status field: each an `id`,
a `name` and a `color`, and for a status a `group`.
  - [Cardbox.Type](Cardbox.Type.md): The types of fields: what each takes, how it keeps a value, and how it
filters.

- Queries
  - [Cardbox.Filter](Cardbox.Filter.md): A condition on a field that a record meets or not.
  - [Cardbox.Query](Cardbox.Query.md): Which records of a collection, in which order: a filter (conditions, in
groups of `and` and `or`), sorts, and a search.
  - [Cardbox.Sort](Cardbox.Sort.md): An order of records by a field: `%{"field" => "due", "dir" => "asc"}`.

- Changes
  - [Cardbox.Error](Cardbox.Error.md): Why a write or a query did not happen.
  - [Cardbox.Event](Cardbox.Event.md): A change to a collection, broadcast to everyone who has it open.

- Drawn by
  - [Cardbox.Fude](Cardbox.Fude.md): A collection as a Fude chart: a view's records grouped and counted, or
summed, in the database, and drawn by Fude.
  - [Cardbox.Hakushi](Cardbox.Hakushi.md): A collection as a Hakushi canvas: each record a node, where people put
it, and the links of a relation of the collection to itself as edges.
A person who draws an edge links two records; who deletes one unlinks
them; who moves a node moves it in the view, for everyone who opens it.
  - [Cardbox.Koyomi](Cardbox.Koyomi.md): A collection as a Koyomi calendar: each record on the day of the view's
date field, a mark for each, and the records of the day a person picks.
  - [Cardbox.Masu](Cardbox.Masu.md): A collection as a Masu grid: its fields as columns, its records as rows
that the database sorts, filters and searches as the person asks, and
each edit, new row and deletion written through your Cardbox module (its
checks, its `c:Cardbox.allow?/3`, its events).
  - [Cardbox.Narabe](Cardbox.Narabe.md): A collection as a Narabe board: a column for each group of the view's
field, its records as cards, which people move within a column and
across them.

- Databases
  - [Cardbox.Migrations](Cardbox.Migrations.md): Cardbox's tables, in versions, for the migrations of your app.
  - [Cardbox.SQL](Cardbox.SQL.md): A query's filter, search and sorts, in the SQL of the app's database: an
`Ecto.Query` of `Cardbox.Record` that the database filters, sorts and
counts, reading only the records it returns.

## Mix Tasks

- [mix cardbox.gen.migration](Mix.Tasks.Cardbox.Gen.Migration.md): Writes the migration that takes Cardbox's tables to their latest
version (`Cardbox.Migrations`).
- [mix cardbox.install](Mix.Tasks.Cardbox.Install.md): Sets up Cardbox in a Phoenix application.

