You should have to deploy both frontend and backend folders separately, in netlify you can deploy only frontend, for backed find the node js server support database like render , railway etc.
when you deploy the backed then you will have the .env keys. so just you need to add those to your frontend.
For more details ask ai or see the example on youtube.