How to install frontend using managment canister?

I need to do this via management canister install_code function.
I am able to upload a backend wasm on a canister by calling management canister.

I am not sure how the frontend can be installed ?
I see frontend creates two wasm files one with name storage.wasm and the other is .wasm
Also there exists asset forlder.

What dfx does when installing frontend code to canister, how this can be achieved via management canister interface ?

1 Like

I recommend you look at the file setup created by dfx new. It should answer quite a few questions already.

Dfx uses the asset canister to provide the frontend. It first uploads the generic asset canister using the management function install_code, which has been pre-compiled. Then, it uploads the frontend assets to the asset canister. This step happens through normal update calls and cannot happen via management canister calls. Otherwise the assets would have to be hard-coded and compiled into the asset canister.