# Tayori v0.1.0 - API Reference

## Modules

- [Tayori.Announcements](Tayori.Announcements.md): An entry announced in the app, as a popup, a toast or a banner, until
its date (`Tayori.Entry`'s `:announce`): the `:announcements` feature.
- [Tayori.Categories](Tayori.Categories.md): The categories of the news (`Tayori.Category`), in their order. The
admin manages them; a script or a seed can too
- [Tayori.Category](Tayori.Category.md): A category of entries ("New", "Improved", "Fixed"): a key, its name in
each language, a colour and its place in the list. Entries keep the keys
of their categories.
- [Tayori.Change](Tayori.Change.md): A change in the inbox (`Tayori.Inbox`): one thing that shipped, as a
source brought it, before it becomes an entry or part of one.
- [Tayori.Digest](Tayori.Digest.md): An entry made of the inbox's changes (`Tayori.Inbox`): the changes
waiting, for the public, put in an entry for the people who use the app.
- [Tayori.GitHub](Tayori.GitHub.md): Changes from GitHub: a webhook of the repository, at
`POST /hooks/github` of the JSON API (`Tayori.API`). The
[Automation](automation.md) guide adds it in GitHub.
- [Tayori.Inbox](Tayori.Inbox.md): The changes that shipped, before they become entries: what the app's
sources bring (`Tayori.Source`), what its CI, GitHub and its own code
add, what an agent adds over MCP. The admin reads them in the inbox,
puts aside what readers need not know, and a digest makes an entry of
the rest (`Tayori.Digest`).
- [Tayori.Ingest](Tayori.Ingest.md): Changes sent to the inbox over HTTP, by CI or another service:
`POST /changes` of the JSON API (`Tayori.API`), with the ingest token.
- [Tayori.Reactions](Tayori.Reactions.md): Readers react to an entry with an emoji, one of the app's (`:reactions`
of `Tayori.Config`), and each reaction counts once per reader. The
`:reactions` feature.
- [Tayori.Router.API](Tayori.Router.API.md): The news as JSON, mounted with `tayori_api/2` (imported with
`Tayori.Router`). See `Tayori.API` for the routes, and the
[Any frontend](any_frontend.md) guide.
- [Tayori.Router.Page](Tayori.Router.Page.md): The public page of the news, each entry's page, and the feeds, mounted
with `tayori_page/2` (imported with `Tayori.Router`). See `Tayori.Page`
for the routes, and [The public page](public_page.md) guide.

- [Tayori.Source](Tayori.Source.md): Where the changes of the inbox come from: a file of the app, a folder of
files, a service. A source is a module with `c:changes/1`, named in the
`:sources` of the `:inbox` config with its options
- [Tayori.Sources.Changelog](Tayori.Sources.Changelog.md): The changes of a `CHANGELOG.md` in the [Keep a
Changelog](https://keepachangelog.com) format: each item of each
release is a change.
- [Tayori.Sources.Fragments](Tayori.Sources.Fragments.md): The changes of a folder of Markdown files, one change in each: written
in the pull request that makes the change, read when it ships. The
pattern of [Changesets](https://github.com/changesets/changesets) and
[towncrier](https://towncrier.readthedocs.io), whose files it reads.
- [Tayori.Subscribers](Tayori.Subscribers.md): Readers who get the news by email, from the public page: the
`:subscriptions` feature.
- [Tayori.Views](Tayori.Views.md): The views of the entries, by day and by where they were read: the
`:analytics` feature.
- [Tayori.Webhooks](Tayori.Webhooks.md): Tells other places of each entry when it is published: the `:webhooks`
feature. The admin adds them in Settings

- News
  - [Tayori](Tayori.md): Tayori (便り) is product news for Phoenix: what the app has to say to
its people, written in an admin the app mounts, and read in the app, on
a public page, in feeds and in emails.
  - [Tayori.Config](Tayori.Config.md): The options of Tayori, given to its child in the app's supervision tree
  - [Tayori.Entries](Tayori.Entries.md): Writes the news: what the admin does, for a script or a seed too.
  - [Tayori.Entry](Tayori.Entry.md): An entry of the news: one thing the app has to say, in one or more
languages (`Tayori.Translation`).
  - [Tayori.Reader](Tayori.Reader.md): Who reads the news, as the app knows them. The app's resolver builds it
from the app's own user (`c:Tayori.Resolver.resolve_reader/1`)
  - [Tayori.Resolver](Tayori.Resolver.md): How Tayori knows the people of the app: who may write the news in the
admin, and who reads it. The app writes one module, from what it
already has (its users, their plans and roles, its admin session), and
gives it to the router macros (`Tayori.Router`) and to `Tayori.Live`
  - [Tayori.Translation](Tayori.Translation.md): An entry in one language: its title, an optional summary (what the
panel and the emails show), and its body, a `Kotoba.Content`.

- In the app
  - [Tayori.Components](Tayori.Components.md): The news in a LiveView: a button with the count of unread entries, the
panel it opens, and the announcement of the moment. They read `@tayori`,
from `Tayori.Live`.
  - [Tayori.Live](Tayori.Live.md): The news in the app's LiveViews: an `on_mount` hook that gives each
LiveView of a `live_session` the `@tayori` assign, for the components of
`Tayori.Components`.
  - [Tayori.Live.State](Tayori.Live.State.md): The `@tayori` assign
  - [Tayori.Locales](Tayori.Locales.md): The names of the languages of the entries, in their own language, for
the admin's tabs and the readers' language links.
  - [Tayori.Messages](Tayori.Messages.md): The words around the news: the button, the panel, the public page and
the feeds ("What's new", "Show more"). The entries are the app's own,
written in the admin in each language.

- Mounting
  - [Tayori.API](Tayori.API.md): The news as JSON, for a frontend that Phoenix does not render (React,
Vue, Svelte, a mobile app), and as HTML for `<tayori-news>`, the
element of Tayori's script. Mounted with `Tayori.Router.tayori_api/2`
  - [Tayori.Embed](Tayori.Embed.md): The news on another origin than the app's: a marketing site, a help
centre, a page the app does not serve. The `:embed` feature.
  - [Tayori.Page](Tayori.Page.md): The public page of the news, its entries one by one, and its feeds
(Atom and JSON Feed), mounted with `Tayori.Router.tayori_page/2`
  - [Tayori.Router](Tayori.Router.md): Mounts Tayori in the app's router.

- Publishing
  - [Tayori.Jobs](Tayori.Jobs.md): What a publication sends, and how: the emails to the subscribers (the
`:subscriptions` feature), the webhooks (the `:webhooks` feature) and
the call to the app's `:notifier`.
  - [Tayori.Notifier](Tayori.Notifier.md): What the app does when an entry is published, beyond what Tayori sends
itself (the emails of the `:subscriptions` feature, the webhooks of the
`:webhooks` feature): a push, an email to the app's own users, a post
elsewhere. The app knows its readers, its mailer and its voice.
  - [Tayori.Worker](Tayori.Worker.md): The Oban worker of Tayori: an email to a subscriber, a webhook, or the
call to the app's notifier, when an entry is published; a digest of the
inbox, or the email of a period's entries, on schedule. Tayori enqueues
its jobs itself, with the `:oban` option of `Tayori.Config`; see
`Tayori.Jobs`.

- Database
  - [Tayori.Migrations](Tayori.Migrations.md): The tables of Tayori, in a migration of the app.

- AI
  - [Tayori.AI](Tayori.AI.md): Writing the news with AI, with the key of the app: a draft from what
shipped, a translation into another language, and changes to a
passage (rewrite, shorter, warmer, fix the spelling).

- MCP
  - [Tayori.MCP](Tayori.MCP.md): An MCP server for the news, built on [Sake](https://hexdocs.pm/sake):
an MCP client (Claude Code, Claude Desktop, an agent) reads the news
and the inbox, adds what shipped, drafts entries, writes them in each
language with their screenshots, and publishes them when it is asked
to, as the admin of the app it acts for.

- Testing
  - [Tayori.Test](Tayori.Test.md): Helpers for `Phoenix.LiveViewTest`, to test the news in an app's
LiveViews with no browser: write entries, read the count of unread
entries, open the panel and read it.

## Mix Tasks

- [mix tayori.build](Mix.Tasks.Tayori.Build.md): Builds the bundles and style sheets of Tayori into `priv/static`.
- [mix tayori.gen.migration](Mix.Tasks.Tayori.Gen.Migration.md): Generates the migration of Tayori's tables in the app's repo: the one
that installs them, or, after an upgrade of Tayori, the one that brings
them to its latest version.
- [mix tayori.ingest](Mix.Tasks.Tayori.Ingest.md): Adds changes to Tayori's inbox (`Tayori.Inbox`), in two ways.
- [mix tayori.install](Mix.Tasks.Tayori.Install.md): Installs Tayori in a Phoenix application.
- [mix tayori.release_check](Mix.Tasks.Tayori.ReleaseCheck.md): Checks the built files before a release of Tayori.

