Oppskrift / oppskrift_api

0 stars 0 forks source link

Architecture #6

Closed Scttpr closed 4 years ago

Scttpr commented 4 years ago

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 :

.
├── controllers
│   ├── mod.rs
│   └── recipes.rs
├── helpers
│   ├── dummy_helper.rs
│   └── mod.rs
├── main.rs
├── middlewares
│   ├── dummy_validator.rs
│   └── mod.rs
├── models
│   └── recipe.rs
├── router
│   ├── mod.rs
│   └── recipes.rs
└── services
    ├── database.rs
    └── mod.rs

Some thoughts :

To be more specific on described folders :

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 ?

Scttpr commented 4 years ago

I created a PR to discuss about it there #7