This example demonstrates typed Phoenix app code in Haxe for a small CRUD-style user flow.
@:schema/@:fieldfor Ecto schema generation@:changesetfor changeset pipeline shaping@:liveviewcallbacks with typed assigns- Strict TSX HXX authoring (
@:hxx_mode("tsx")) in LiveView render paths
examples/06-user-management/src_haxe/contexts/Users.hxexamples/06-user-management/src_haxe/live/UserLive.hxexamples/06-user-management/src_haxe/services/UserGenServer.hx
cd examples/06-user-management
mix deps.get
mix compile
mix phx.serverOpen http://localhost:4000.
Haxe schema excerpt:
@:schema("users")
class User {
@:primary_key public var id: Int;
@:field({type: "string", nullable: false}) public var name: String;
@:field({type: "string", nullable: false}) public var email: String;
}Generated Elixir shape:
schema "users" do
field :name, :string
field :email, :string
timestamps()
endHaxe LiveView render path excerpt (strict TSX):
@:hxx_mode("tsx")
public static function render(assigns: UserLiveAssigns): String {
return <div class="user-management">
${renderUserList(assigns)}
${renderUserForm(assigns)}
</div>;
}Generated Elixir shape:
def render(assigns) do
~H"""
<div class="user-management">
...
</div>
"""
end- This example is intentionally compact and focuses on compiler surfaces, not full production UX.
- The default build path is strict TSX (
build.hxmlincludes-D hxx_mode=tsx). - For the intentional legacy/balanced migration demo, see
examples/05-heex-templates/README.md. - For end-to-end Presence, PubSub, richer tests, and E2E smoke, see
examples/todo-app/README.md.