How do I project structure? NextJS docs not helping...
Answered
West African Lion posted this in #help-forum
West African LionOP
How do I structure my project and place my aws ses files?
- does the api folder go in src, app, or page?
- what are the lib and services folder for?
Just need a bit of clarification to make sense of what is what and where it goes as I'm new to coding and nextjs.
NextJS doc: https://nextjs.org/docs/getting-started/project-structure
- does the api folder go in src, app, or page?
- what are the lib and services folder for?
Just need a bit of clarification to make sense of what is what and where it goes as I'm new to coding and nextjs.
NextJS doc: https://nextjs.org/docs/getting-started/project-structure
Answered by Northeast Congo Lion
src (folder)
app (folder)
api (folder)
...api routes go inside here (/api)
...pages go in here
components (folder)
...components go in here7 Replies
@West African Lion How do I structure my project and place my aws ses files?
- does the api folder go in src, app, or page?
- what are the lib and services folder for?
Just need a bit of clarification to make sense of what is what and where it goes as I'm new to coding and nextjs.
NextJS doc: https://nextjs.org/docs/getting-started/project-structure
Northeast Congo Lion
you can use app or pages router
/src/app = app router
/src/pages = pages router
/src/app = app router
/src/pages = pages router
app router is new approach for nextjs and i recommend using it, u can actually use both pages & app together I think, but cleaner to only have one
lib and services just house special functions and such that ur application will useapi goes inside /app/api/... if using app routerWest African LionOP
1. I read some articles and answers on stackoverflow where some advice says to keep components inside app while others suggested leaving it outside, in src?
2. does the following make sense?
2. does the following make sense?
Northeast Congo Lion
makes perfect sense
Northeast Congo Lion
src (folder)
app (folder)
api (folder)
...api routes go inside here (/api)
...pages go in here
components (folder)
...components go in hereAnswer