How to use feature-based folders structure instead type-based?

From my experience type-based folders structure becomes a mess for a relatively medium or big project.

I prefer to group code by “features” or domains.
So every “feature” has it’s own folder and inside the folder there are pages, components, libs etc.

How can I achieve it with redwood?

3 Likes

Hey @syabro please check out this open issue and leave a comment I think that is what you are looking for. This way we can make this a priority. I think it has been in the backlog for quite a while. Currently, I don’t think it is possible to generate components into whatever path you. Although you could generate them and move them into whatever feature folder you want. I believe you can specify a path with the scaffolds though.

1 Like

Thanks, looks like :slight_smile:

Uh, oh, @dom Looks like we might have to dust off that PR…

:joy:

2 Likes

I don’t feel like there’s really any limitation to this in Redwood… but to think of it, your router might end up being quite the stuff :-\.

At SportOffice we’ve transitioned from an exclusive service based API to a src/lib/domain/model/verb+subject structure, which promotes pure function style a lot and scales very well. We didn’t do this early on but it proves easier to migrate there than it might look. But that’s for API side, web side, which sounds like your interest here, is another story, a topic that’s also discussed within the Contributors group.

Anyway, great point @syabro and welcome to our community \o/

1 Like

Yeah there is no limitation on doing this only thin is that generators don’t let you specify a path so you end up having to move the files manually after you create them just tedius