Wulf / create-rust-app

Set up a modern rust+react web app by running one command.
https://create-rust-app.dev
Apache License 2.0
1.54k stars 63 forks source link

Adding Axum #23

Open Wulf opened 2 years ago

Wulf commented 2 years ago

Adding a backend framework

Base requirements for each framework:

Optional requirements:

(we can get to these later)

Wulf commented 2 years ago

Outline for #11

vishalsodani commented 2 years ago

@Wulf I would like to work on this task.

I have started by adding Axum to the enum BackendFramework and a main.rs+axum file. But, how do I go about testing just the server backend? Also, how is main.rs generated?

I would like to add features for the new backend step by step as I learn more about the axum framework and its workings.

Wulf commented 2 years ago

hey @vishalsodani, hope things are well. Sorry for being super late with my reply.

It would be awesome if you added Axum! Step by step is exactly how I integrated poem-web -- my focus was on getting the "Todo" example working.

Some things you should know in general:

Apart from that, I went over the codebase once again and found places where you may want to add in Axum-related implementation / CLI options / etc. I've split the notes based on the project it pertains to:

create-rust-app_cli

create-rust-app

I tried to over-explain everything to make it clear so sorry if it was too wordy.

After all this you'll hopefully have a working axum project which you can tweak further.

cd repo/create-rust-app_cli
cargo run -- test-project
# don't select any plugins~

Just a note, don't generate a project named 'test' -- it's not a legal cargo project name apparently -- I've run into this so many times now haha. If you choose to use another name for your generated test project (that isn't "test-project"), you should add it to the exclude array in repo/Cargo.toml (otherwise cargo will complain and say it's part of a workspace or something like that). If all of this fails, just install the project:

cargo install --path repo/create-rust-app_cli
cd /somewhere/else
create-rust-app my-project
# don't select any plugins~

Let me know if I can help in any other way!

vishalsodani commented 2 years ago

@wulf Thanks for sharing so many pointers :) This remove_non_framework_files helped me immediately.

langdon0003 commented 1 year ago

Hi @vishalsodani. Could I ask we done intergrated Axum?

vishalsodani commented 1 year ago

Hi @vishalsodani. Could I ask we done intergrated Axum?

Sorry, no.