Current section

Files

Jump to
aurora_uix README.md
Raw

README.md

<p align="center">
  <img src="./guides/images/aurora_uix-logo.svg" height="200" />
</p>

[![CI](https://github.com/wadvanced/aurora_uix/actions/workflows/ci.yml/badge.svg)](https://github.com/wadvanced/aurora_uix/actions/workflows/ci.yml)
[![Hex.pm](https://img.shields.io/hexpm/v/aurora_uix.svg)](https://hex.pm/packages/aurora_uix)
[![Downloads](https://img.shields.io/hexpm/dt/aurora_uix.svg)](https://hex.pm/packages/aurora_uix)
[![Documentation](https://img.shields.io/badge/documentation-gray)](https://hexdocs.pm/aurora_uix)
[![Last Commit](https://img.shields.io/github/last-commit/wadvanced/aurora_uix.svg)](https://github.com/wadvanced/aurora_uix/commits/main)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

# Aurora UIX

**Declarative, compile-time CRUD UI generation for Elixir's Phoenix LiveView.** Build feature-rich, responsive interfaces with minimal code using metadata-driven configuration and a powerful layout DSL.

> πŸš€ **New to Elixir or Phoenix?** Follow the **[Build Your First App tutorial](./guides/tutorial/build_your_first_app.md)** β€” a copy-paste walkthrough from nothing installed to a running CRUD app.

---
## πŸ“– Overview

Aurora UIX is a metadata-driven UI framework for Elixir's Phoenix LiveView that lets you rapidly generate complete CRUD interfaces from your Ecto schemas or Ash resources. Instead of writing repetitive form and list code, define your resource once and get a fully functional, responsive UI with built-in validation, association handling, and real-time updates.

**Why Aurora UIX?**
- **Rapid Development** β€” Build CRUD interfaces in minutes, not days. Define resource metadata once, get complete index, show, and edit views.
- **Compile-Time Generation** β€” The UI modules are generated when your application compiles, and mistakes in a declaration fail the build.
- **Extensible by Design** β€” Customize every layer: field renderers, layouts, components, themes, and LiveView event handlers.
- **Production-Ready Features** β€” Built-in pagination, validation, error handling, i18n, responsive design, and real-time updates via LiveView.

**Key Features:**

### Generate

- **Complete CRUD views** - Index, show and form views from your resource metadata and layouts
- **Two backends** - Ecto schemas with [`aurora_ctx`](https://hexdocs.pm/aurora_ctx) contexts, or Ash resources, detected automatically
- **Associations and embeds** - `belongs_to`, `has_many`, `has_one`, `many_to_many`, `embeds_one` and `embeds_many`
- **File uploads** - An [`upload` block](./guides/core/resource_metadata.md#file-uploads) turns a field into a LiveView upload
- **Compile-time checks** - An unknown or mistyped DSL option fails compilation at the line that declares it

### Work with data

- **Filtering and sorting** - Filters on the index fields (turn one off with `filterable?: false`), sortable column headers, and `where` and `order_by` to scope a list
- **Pagination** - Pages in the table, infinite scroll in the card view
- **Live updates** - With a PubSub server configured, [open lists re-read their page](./guides/core/live_updates.md) when another session saves or deletes a record
- **Ash authorization** - The current actor is [passed to every generated call](./guides/core/ash_authorization.md#authorization-and-policies), so your policies apply
- **Ash calculations and aggregates** - [Discovered and loaded](./guides/core/ash_integration.md#calculations-and-aggregates) like any other field

### Embed

- **[Reusable components](./guides/core/components.md)** - Place the generated index, form and show views inside LiveViews you write

### Adapt

- **Layouts** - Compose `inline`, `stacked`, `group` and `sections`, and [reuse layouts](./guides/core/organizing_modules.md#reusable-layouts) across modules with `include:`
- **Responsive cards** - Small screens show [one card per record](./guides/core/layouts.md#index-cards); a layout can design the card and show it at every width
- **Themes** - White Charcoal, Vitreous Marble and Blue Graphite, in light and dark, or [your own](./guides/customization/theming.md); see the [theme gallery](./guides/overview/theme_gallery.md)
- **Actions** - [Add, replace or remove buttons](./guides/customization/custom_actions.md), change their icons, and run [bulk actions](./guides/customization/custom_actions.md#bulk-actions-on-selected-rows) on selected rows
- **Renderers and components** - Built-in field renderers such as toggle switch, badge, progress bar and rating, your own renderers and [component overrides](./guides/customization/customization.md)
- **Behavior** - [Handler hooks](./guides/core/handlers.md#handler-hooks) for your business logic
- **Internationalization** - A [configurable Gettext backend](./guides/core/internationalization.md)

### Technology Stack
- Elixir `1.17+`
- Phoenix `1.8+`
- Phoenix LiveView `1.2+`
- Ecto `3.14+`

---
## ⚑ Quick Example

Describe a resource, then lay out its views:

```elixir
defmodule MyAppWeb.Products do
  use Aurora.Uix

  alias MyApp.Inventory
  alias MyApp.Inventory.Product

  auix_resource_metadata :product do
    context Inventory
    schema Product
    field :name, placeholder: "Product name", required: true
    field :price, precision: 12, scale: 2
  end

  auix_create_ui do
    index_columns :product, [:name, :price]

    edit_layout :product do
      inline [:name, :price]
    end
  end
end
```

Once [routed](./guides/introduction/getting_started.md#add-routes-to-the-router), it gives you a
product list, a show view and the forms to create and edit. The Overview has a
[fuller example](./guides/overview/overview.md#complete-example) with sections and associations.

---
## πŸš€ Getting Started

You need [Elixir](https://elixir-lang.org/install.html) 1.17+ and a
[Phoenix](https://hexdocs.pm/phoenix/installation.html) 1.8+ application with Phoenix LiveView
1.2+. Add Aurora UIX to its `mix.exs`:

```elixir
def deps do
  [
    {:aurora_uix, "~> 0.2.1"}
  ]
end
```

Then follow the **[Getting Started guide](./guides/introduction/getting_started.md)**: the
stylesheet, the icons, the JavaScript hooks, your first views and their routes.

Starting from nothing installed? Follow
**[Build Your First App](./guides/tutorial/build_your_first_app.md)** instead.

---
## πŸ“– Documentation & Guides

Complete documentation is available in the [guides](./guides/overview/overview.md) and on [HexDocs](https://hexdocs.pm/aurora_uix):

- **[Build Your First App](./guides/tutorial/build_your_first_app.md)** β€” Zero-background tutorial: from nothing installed to a running CRUD app
- **[Overview](./guides/overview/overview.md)** β€” Architecture and core concepts
- **[Getting Started](./guides/introduction/getting_started.md)** β€” Installation and first CRUD UI
- **[What's New](./guides/whats_new/0.2.1.md)** β€” Headline changes of 0.2.1 with upgrade notes and examples; one page is kept per release in `guides/whats_new/`
- **[Resource Metadata](./guides/core/resource_metadata.md)** β€” Field configuration and validation
- **[Layout System](./guides/core/layouts.md)** β€” Layout DSL and composition
- **[Reusable Components](./guides/core/components.md)** β€” Embed the index, form and show components in your own LiveViews
- **[Reusing Resource Metadata and Layouts](./guides/core/organizing_modules.md)** β€” Declare resources once, share layouts and reuse generated modules
- **[LiveView Integration](./guides/core/liveview.md)** β€” Generated modules, streams and navigation
- **[Handlers and Events](./guides/core/handlers.md)** β€” Event handling and business logic
- **[Live Updates](./guides/core/live_updates.md)** β€” Lists that refresh when data changes
- **[Ash Integration](./guides/core/ash_integration.md)** β€” Ash resources, actions and relationships
- **[Ash Authorization](./guides/core/ash_authorization.md)** β€” Actors and policies
- **[Customizing & Extending](./guides/customization/customization.md)** β€” Central hub for styling, theming, component overrides, and custom actions
- **[Styling](./guides/customization/styling.md)** β€” Host styling with `--auix-*` variable overrides and the cascade-layer model
- **[Internationalization](./guides/core/internationalization.md)** β€” Configuring the Gettext backend, automatic POT generation, and translation workflow
- **[CSS Bridges](./guides/customization/writing_a_style_bridge.md)** β€” Mapping host design-system tokens onto `--auix-*` variables
- **[Advanced Usage](./guides/advanced/advanced_usage.md)** β€” Templates and macro conversions
- **[Custom Backends](./guides/advanced/custom_backends.md)** β€” Connect another data source
- **[Troubleshooting](./guides/advanced/troubleshooting.md)** β€” Common issues and solutions

---
## 🀝 Contributing

We welcome contributions! Aurora UIX is maintained by WAdvanced and community members.

**Before contributing**, read the [Contributing Guidelines](CONTRIBUTING.md) which includes:
- How to report bugs and suggest features
- Development setup and testing procedures
- Code style and commit message conventions
- Pull request process

**Quick links:**
- [GitHub Issues](https://github.com/wadvanced/aurora_uix/issues) β€” Report bugs or suggest features
- [GitHub Discussions](https://github.com/wadvanced/aurora_uix/discussions) β€” Ask questions
- [Contributing Guidelines](CONTRIBUTING.md) β€” Full contribution details

---
## πŸ“œ License

Licensed under the [MIT License](LICENSE.md).

---
## πŸ“§ Contact

- **Email:** [contact@wadvanced.com](mailto:contact@wadvanced.com)
- **Repository:** [https://github.com/wadvanced/aurora_uix](https://github.com/wadvanced/aurora_uix)