main.rs is the Rust entry point, where we have to modules and so on. I'm for a module logic with light files like in Javascript but it does not seem to be the case in Rust.
Rust 2015 syntax uses mod.rs to register modules in the crate, Rust 2018 allows to create a directory_name.rs in the root directory to register. I prefer to stick to the old way with everything related to the module in the folder, what do you think about it ?
To be more specific on described folders :
controllers : obvious
models : obvious
router : obvious
middlewares : obvious
helpers : could be tools, utils. All self made utility code.
services : All modules related to third party crates (database, logger, seriazile, etc.)
I have no idea how AP could lead to a mutation in architecture but I think it's important to take it into account from the beginning.
Hi, it would be nice to think of a design pattern for the API. As far as Actix-web does not provide a specific pattern, we are pretty free !
I suggest something classic based on an MVC Model :
Some thoughts :
main.rs
is the Rust entry point, where we have to modules and so on. I'm for a module logic with light files like in Javascript but it does not seem to be the case in Rust.directory_name.rs
in the root directory to register. I prefer to stick to the old way with everything related to the module in the folder, what do you think about it ?To be more specific on described folders :
controllers
: obviousmodels
: obviousrouter
: obviousmiddlewares
: obvioushelpers
: could be tools, utils. All self made utility code.services
: All modules related to third party crates (database, logger, seriazile, etc.)I have no idea how AP could lead to a mutation in architecture but I think it's important to take it into account from the beginning.
What do you think about all this ?