BUCKYVERSE

This document outlines development conventions for the Codexis ebook conversion system, following decisions documented in Architecture Decision Records (ADRs).

Table of Contents

Architecture Decisions

Code Organization

project/
├── lib/                 # Core application code
│   ├── codexis/         # Main application modules (Contexts, Schemas, Services)
│   └── codexis_web/     # Phoenix web interface code (Controllers, Views, LiveViews, Templates)
├── config/              # Configuration files (config.exs, dev.exs, etc.)
├── test/                # ExUnit tests
│   ├── support/         # Test helpers and shared setup
│   └── fixtures/        # Test data fixtures (e.g., using ExMachina)
├── priv/                # Private assets (e.g., static files, templates, Repo migrations)
├── assets/              # Frontend assets (JS, CSS)
└── docs-site/docs/      # Documentation

Elixir Conventions

General Style

Naming Conventions

Syntax and Formatting

Modules and Functions

OTP Practices

Phoenix Conventions

Error Handling

Elixir/OTP Philosophy

defmodule Codexis.ConversionError do
  defexception [:message, :source_file]

  @impl true
  def exception(opts) do
    message = Keyword.get(opts, :message, "Conversion failed")
    source_file = Keyword.get(opts, :source_file)
    %__MODULE__{message: message, source_file: source_file}
  end
end

Logging and Validation

Logger.error("Conversion failed",
  source: file_path,
  error_code: :invalid_format,
  suggestion: "Check LaTeX syntax"
)

General Recovery

UI and Styling

The selection of primary UI technologies and styling frameworks (e.g., Phoenix LiveView, Tailwind CSS) is documented in relevant ADRs. Key conventions include:

Performance

Security

Testing

Documentation

Version Control

Commit Messages

Example:

feat: Add EPUB validation step

- Implement EPUBCheck integration via Command Framework.
- Add error recovery for validation failures using Retry strategy.
- Update documentation with EPUBCheck requirements.

Refs: PROJ-123, task-7

Git Town Workflow

Branching

Workflow Practices

References