Turborepo Strapi, Nextjs and SharedUi

Hello,

i found this monorepo (turborepo) which includes workspaces for Strapi a Nextjs Frontend as well as a shared ui workspace:

This is my first introduction to mono and turborepo so my questions are rather broad.
I’d appreciate any input from more experienced devs.

When it comes to deployment let’s say i want to deploy the Nextjs Frontend to Vercel and the Strapi Backend to Strapi Cloud.
In theory is it possible to deploy those turborepo workspaces individually?
What about the dependencies to the shared ui workspace for example when deploying the Frontend

Appreciate anyone who can shed some light give a (high level) overview

This topic has been created from a Discord post (1217830138952028280) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Going to answer this myself it might help other beginners.
Note though that i am still a bloody beginner and there are parts which i have wrong.

I managed to deploy the the workspaces from the turbo repo to different platforms.
I ended up deploying a Postgres Database and the Strapi Server to Railway ( i tried Strapi Cloud first but it errored on the very first step when the monorepo was chosen from github).
Secondly i deployed the frontend to Nextjs.

Note that all of this was within a turborepo including shared workspaces for ui and configuration (like eslint and typescript configs).
So both the Frontend and the Backend made use of shared workspaces within the repo.
That fact makes it impossible to deploy the FE or BE isolated.
Otherwise an isolated deployment in which you basically just CD into e.g apps/frontend and deploy only that part would be an option.

So if the app you are deploying has shared dependencies you have to turbo build --filter <workspacename>.
I tried yarn workspace <workspacename> buildwhich did not work on Railway. (The build failed)

The frontend was deployed to Vercel they have automatic detecting for turbo you can simply choose which workspace you want to deploy. It shows the detected framework and knows what parts needs to be build based on your turbo.json esp. dependsOn settings.

However in my case the Frontend depended on the Backend being build (since it pulls sites and types from the Strapi Backend via Api Calls for static generation). So be aware that in those cases the order matters. I had to deploy the BE first before i had any chance to succeed with the FE deployment.

Bonus tip:
On Railway if you deploy from a monorepo the CI reads the Node Engine from the root of your package.json
In my case that was just >18.0.0 so it chose Node 21 for some reason. Which is not supported by Strapi nor it Plugins.

Hope someone can learn something from that
Cheers

Note that Strapi Cloud does not support workspaces.
At the moment Strapi Cloud is not able to fetch dependencies and/or resolve multiple package.json files.

You can still deploy a monorepo to Strapi, but it would have to have a package.json in the root level of the Strapi code that’s complete and includes everything the Strapi instance needs to run.