I am new to web development and to Next js. I want to know what is the best way to structure. Like we keep pages in /pages directory and /static, /components.
So where i can keep my code related to validation, some business logic etc
Diego Bernal
Front-End Engineer
Diego Bernal
Front-End Engineer
I like having a
utilsdirectory for utility functions/classes that I use in multiple places. Validation might or might not fall within this. If validation is specific to a component, I think would want it to exist in that component.I also like having a
apidirectory that has any code related to fetching data from an api.