Next.js Discord

Discord Forum

NextJS naming convention

Answered
Amorph posted this in #help-forum
Open in Discord
when there are various DB queries that will be used many times across the database, in order to make them reusable, you will create separate files for each of them, and all those files will be inside a folder, but i can't think of a good suggestive name.

i thought of data or hooks folder name but i feel like it's not that suggestive or even correct, does the next.js team come with naming conventions related to this or does anyone else have better naming ideas?
Answered by joulev
no there are no naming conventions that are officially recommended/endorsed. i just make lib/db/queries.ts or something similar, if you have many of them then lib/db/user.ts, lib/db/products.ts, etc. no need to stress yourself too much about something as simple and easy-to-change as file names
View full answer

2 Replies