dioxus-template icon indicating copy to clipboard operation
dioxus-template copied to clipboard

Server feature for server crate

Open yawn opened this issue 1 year ago • 2 comments

As discussed in Discord @ealmloff.

This shows how to include server-side specific functionality when using fullstack.

I believe it might be useful to change the name of the crate from server to something else though. It's getting even more confusing when also adding a feature with the same name.

yawn avatar Feb 05 '25 08:02 yawn

Feel free to drop or squash the linebreaks commit. I found (the lack of) them confusing.

yawn avatar Feb 05 '25 08:02 yawn

(deleted my previous comment)

My current thinking about a naming convention for mobile + web and fullstack that feels a bit more intuitive for me is the following:

  • api crate: just the server_fn functions
  • frontend crate
    • main entrypoint for web / mobile (e.g. for calling dioxus::fullstack::prelude::server_fn::client::set_server_url)
    • shared UI
  • backend crate
    • main entrypoint and configuration for the fullstack server-side
    • axum customizations
  • web / mobile crate
    • calls frontend or backend main, server-feature gated
    • builds the actual app out of frontend elements and customisations

All work in progress. WDYT?

yawn avatar Feb 05 '25 08:02 yawn