Search code examples
reactjsintellij-ideajvm

Frontend and backend projects in IntelliJ: One or two projects?


My project consists of two parts:

  • JVM/kotlin backend (built using gradle)
  • React/typescript frontend (built using vite).

Directory structure:

my-project/
  frontend/
     package.json
     src/
     node_modules/
  backend/
    build.gradle.kts
    src/
       main/
       test/

I want to use IntelliJ IDEA (ultimate) for developing both backend and frontend.

Questions:

  • What is the best practice in this case?
    • Is it best open two separate IntelliJ projects (using directories frontend and backend)?
    • Or is it best to open a single IntelliJ project (using the my-project directory)
  • From experience I know that both cases work. But I would a recommendation as to what is the "best" way to do this (resource-wise, workflow-wise etc.)

Solution

  • I’d recommend you use one IDE window and add backend/frontend projects as modules https://www.jetbrains.com/help/idea/creating-and-managing-modules.html

    This way you could use one IDE window for navigating between files in both projects which is more convenient rather that using two different IDE windows.

    Also, you can unload some modules if you don’t need them to make the IDE work faster. See https://www.jetbrains.com/help/idea/unloading-modules.html