Using drizzle in monorepo

I am building a project where I have 2 next.js applications. Let's call them admin and web. The admin is responsible for CRUD operations to database and allows the admin user to manage content on their website, while web interacts with the database in a read-only way, displaying the content for the user.

I want to share a single drizzle db client between both projects because this keeps types for both projects synced and I don't have to write changes in 2 places whenever I want to modify something schema related.

How can I achieve such a thing in a turbo monorepo or any other way?
Was this page helpful?