Csaba Ivancza

Setting up monorepos for AI: submodules versus subtrees

by

I've been building my app for 8 months now, and i ended up having 5 repositories

  • nextjs app

  • databases

  • customer facing API

  • node-sdk that wraps the api

  • react-sdk, for both reusing shared component and customer facing components

So i thought, it's gonna be great if i create a mono repo with submodules. But it was terrible. I realized that turborepo does not like external packages, and as i tried to reuse my own customer facing libs, the DX became terrible. It was very time consuming to ship a feature. Even when i wanted to use Codex or Cursor 3, it was not able to show git diff properly, also i was not able to use Cursor's cloud agents properly to ship complex features.

So after a while i felt that i need to change my setup and i read about git subtrees, it was such a game changer! now i have 3 repos only, one mono repo and two customer facing sdk-s, but i work on the monorepo only, i commit, and then i sync the changes to the sdks with one command.

I use vercel as a backend, and that supports monorepos. Cursor works like a charm, my DX is a dream, i ship features like there's no tomorrow. I love this setup.

I am curious what's ur setup that provides a great DX and also makes ur AI env more productive?

83 views

Add a comment

Replies

Be the first to comment