Architecture for large projects
Unanswered
Spot-billed Duck posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Spot-billed DuckOP
Hello, excuse me for disturbing you,
I like to set up the best possible architecture for Next.js in order to combine backend and front-end for a rather big project.
I would like to have your opinions on this and resources to guide me in this operation.
I used nextjs before, but it became a bit messy...
I like to set up the best possible architecture for Next.js in order to combine backend and front-end for a rather big project.
I would like to have your opinions on this and resources to guide me in this operation.
I used nextjs before, but it became a bit messy...
8 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Spot-billed DuckOP
Up!
![Avatar](https://cdn.discordapp.com/avatars/678259999201427466/1936f7e8963ff0f800f5eb4b43bc833c.webp?size=256)
Clown
Firstly, you aren't disturbing anyone by posting here.
Secondly, Since nextjs is moving towards server components and actions, some mix and match between the frontend and backend is inevitable.
On the other hand i think a simple structure like this should suffice for most applications of varying sizes:
Secondly, Since nextjs is moving towards server components and actions, some mix and match between the frontend and backend is inevitable.
On the other hand i think a simple structure like this should suffice for most applications of varying sizes:
- components/
- actions/
- ... Rest of your app
You can move the first two folders anywhere if you need more separation and you can use
Route Groups
to your advantage as well.![Avatar](https://cdn.discordapp.com/avatars/769111741098622976/a00ea6fb13337fd9ef76154f8e3cb990.webp?size=256)
Eric Burel
Hi, not enough information to answer you, big can mean anything
Therefore the first step would be: clarify your requirements. Is you app big in number of users ? Pages ? Parameter combination for dynamic pages ? Team size ? Do you have a separate backend, multiple teams ? Many interactive components ? Complex data ? Lots of interactivity, and interactive data fetching ?
Therefore the first step would be: clarify your requirements. Is you app big in number of users ? Pages ? Parameter combination for dynamic pages ? Team size ? Do you have a separate backend, multiple teams ? Many interactive components ? Complex data ? Lots of interactivity, and interactive data fetching ?
You can take a look at the real life codebase of the State of JS survey: https://github.com/Devographics/Monorepo
you'd be interested in studying existing templates too and frameworks built on top of Next eg Blitz, Taxonomy...
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Spot-billed DuckOP
Hi, sorry for the late response, i'll check that 🙂
actions for server actions? or this is like the api folder?