Like what we’re doing? Star us on GitHub!

Directory structure for Next.js app and PayloadCMS?

Arskeliss
last month
4

Hello team,


My question is that is it a working way to install Next.js as the frontend and Payload as backend in the same idrectory, along-side one another? Or should I just keep them in separate folders, but inside one, main folder?



How do you guys do it normally, the way it works nice and dandy?

  • nicht hzK
    last month

    Check their github, they have a nextjs project combined with payload template there 🙂

  • denolfe
    Payload Team
    last month

    This matters on the project really. We prefer to keep the frontend and backend in separate repos, adn therefore allows easier separate deployments. However, as mentioned above, we do have an example with them combined here:

    https://github.com/payloadcms/nextjs-custom-server
  • Zeeshan
    4 weeks ago

    Hi @denolfe , I have a payload cms project. How can i add NextJS configuration by myself in that existing payload project?


    Kindly guide me.

  • denolfe
    Payload Team
    4 weeks ago

    Trying to model your project after the above repo is your best bet.

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More