PHX AI Document Starter
A Phoenix LiveView starter for document Q&A applications: upload PDFs and documents, organise them into folders, and chat with their content through a pluggable AI provider boundary — a deterministic fake provider for development and test, and OpenAI as the documented example adapter.
The consolidated successor of the AI File Template and PDFAi products.
Features
- Email/password authentication (phx.gen.auth), account settings
- Authenticated uploads with per-user local storage and size limits
- Per-document chat and folder (multi-document) chat, markdown rendering
-
In-browser PDF viewer (PDF.js Express — see
docs/viewer-licence.md) -
Typed AI provider boundary (
PhxAiDocument.AI) with contract tests - Complete deletion lifecycle: provider artifacts + stored file + chats
- Tenant isolation enforced in the contexts and covered by tests
- Stripe subscription/lifetime billing (optional, fully env-configured)
Quick start
mix setup
mix phx.server # http://localhost:4000 — no API keys needed (fake AI provider)
See docs/setup.md for providers, Stripe, email, and
production configuration, and docs/architecture.md
for how the pieces fit together.
Documentation
| Doc | Contents |
|---|---|
docs/setup.md |
Install, env vars, providers, tests |
docs/architecture.md |
Contexts, AI boundary, ingestion, storage, deletion |
docs/provenance-matrix.md |
What was ported from where, and what is deferred |
docs/viewer-licence.md |
PDF viewer licence status |
CHANGELOG.md |
Release history |
Support
Questions: phxtemplates@gmail.com — see SUPPORT.md and SECURITY.md.