DEV Community

Discussion on: A 2021 guide about structuring your Next.js project in a flexible and efficient way

Collapse
 
alexman profile image
Alexander Hofstede

Thanks for taking the time to do a write up, we're all looking for good places to "put our stuff"!

From your folder structure however, I cannot deduce whether /modules/auth/api/AuthAPI.js would be something imported in /modules/auth/components/AuthForm.tsx (as a helper that exposes the API to the front-end components) or /pages/api/authAPI/authAPI.js (as a utility file that the page Javascript module defers to for actual authing) or somewhere else. In other words, is it front- or backend code?

The use of the term "module" is also tricky territory in a Javascript context, since it is often referred to when talking about a single file. (I had to call it "Javascript module" above for example! :)