How to retrieve String IDs (CUID) from the database and dynamically attach them to the URL in order to retrieve data?

Hello, so I am trying to implement a function where if a user clicks on a post, the post will redirect the user to a modal where all the details about the post is displayed, but as a beginner, I was a bit confused, so I decided to follow the tutorial of a youtuber named (Javascript Mastery), but as my project was already 50% made, I decided to only follow his tutorial for a specific function I want.

So now, he is using something like this

const projectUrl = \/project/${Id}`;`

<Link
href={projectUrl}
className="flex items-center justify-center group relative h-full w-full"
passHref
>

where he is forwarding the user to the dynamically updated url, which will somehow retrieve the data from the database and fill in the modal, and the id increments automatically based on the posts clicked.

However, he is using grafbase for some strange reason, which makes his process significantly easier.

My project uses postgres, so I had to construct a new modal for my database, where ID is a string CUID.

I'm not sure how to proceed with my project with this. I can't just insert something like clsz2nrk40000oruqjzz9eknt into the project/id.

Could you possibly advise me? Please assist me.