- Modules architecture should be upwards from `effectors` (WASI modules) that will work with local binaries, local storage and syscalls to `pure modules` that perform business logic.
- Splitting app to small FCE modules are easier to support, reuse and distribute
- Each module for its own task (npm like)
## Module project structure
- Init simple rust project `cargo init --bin`
-`Config.toml`:
```
[lib]
name = "wasm_application"
path = "src/lib.rs"
crate-type = ["cdylib"]
[dependencies]
// logger - if you'll use logging
fluence = { git = "https://github.com/fluencelabs/rust-sdk", features = ["logger"] }
```
- Methods that will be used outside this module marked with `#[fce]`
```
use fluence::fce;
#[fce]
pub fn get(url: String) -> String {
...
}
```
- Multiple arguments with primitive Rust types and only one return argument could be used
- Build project with `fce build`
- Copy wasm file from `target/wasm32-wasi/debug` to directory with other modules
- To import other wasm modules to your project use similar code: