Best Practices for Structuring Complex HaxeUI Applications?

Hello there,

I am working on a fairly complex application using HaxeUI and would love your insights on best practices for structuring projects. As my app grows, I find managing layouts, components and interactions increasingly tricky. Here are a few specific questions ::-

Modularity: How do you organize reusable components in larger projects: ?? Is there a recommended folder structure for views, controllers and assets: ??
State Management: For apps with dynamic UI elements and user interactions, do you rely on event driven communication between components or is there a preferred state management library compatible with HaxeUI: ??
Styling: What is the most efficient way to manage and override styles in themes, especially when dealing with complex nested layouts: ??

I would appreciate any advice, patterns or resources the community can share. Also;, if there are examples of well structured open source HaxeUI projects, I would love to check them out.

I have also gone through this thread https://community.haxeui.org/t/how-to-create-a-more-complex-list-dropdown-from-code-azure-admin but still looking forward to hearing your thoughts !!

With Regards,
Derek Theler

Hi!

Sorry for not answering this! Its actually a really tough one to write on one go. Im actually currently working on a very big application that does have alot of the things you are talking about - Ive been thinking to write a “post mortem” of it (even though its still in progress), so maybe ill bump that

It may be “too big” for what you mean though, since it uses mix of alot of libs (some released, some not), namely:

  • observable
  • haxeui-mvc
  • haxeui-conditionals
  • modular
  • haxeui-modular
  • a ton more

to answer (very briefly) some of your questions directly:

Modularity: How do you organize reusable components in larger projects: ?? Is there a recommended folder structure for views, controllers and assets: ??

For the most part i tend to turn things into seperate libraries (even if they are just added via --classpath) with their own module.xmls… this tends to keep things somewhat separated. I also tend to use @:xml(...) on components rather than external xml resources… apart from having the xml in the same place as the component, i find that im alot less happy with large amounts of xml in my .hx files, so they tend to stay trim.

State Management: For apps with dynamic UI elements and user interactions, do you rely on event driven communication between components or is there a preferred state management library compatible with HaxeUI: ??

So in “vanilla” haxeui, there isnt anything like this (that i know of - well, haxeui-mvc but its not public yet and is still incubating in a production app). For the most part you’ll have to wire this up yourself (for now)

Styling: What is the most efficient way to manage and override styles in themes, especially when dealing with complex nested layouts: ??

for this i tend to just create new themes (which are just css files basically) - there arent a huge amount of other options imo (though ofc, im open to suggestions! :slight_smile: )

I know its not really that helpful, maybe my “1000 page post mortem” will help (but probably will just muddy the waters even more :smiley: )

Cheers,
Ian