Still deciding if we should do it or not. From what I have tested on seneca-course-reviews, these are the pros and cons on a scale of 0 to 3.
Pros
Have a monorepo to separate backend and frontend (+3)
Multiple trips between backend and DB should theoretically be faster (+1).
We will have firebase functions code eventually for functions like document.onWrite (+1).
Don't need to include firebase secrets inside repo. This is a must-have if we are open to more contributors (+2). Probably can set up a firestore emulator with Next.js.
The endpoints cannot be called from another server or client (seem so). (+2)
Cons
Cold boot is slower (4-4.5s on average vs Next.js 3s). This should not be a problem if the web app is popular and used frequently though (-2).
No absolute import in backend (-1) Nevermind this, look like we cannot use absolute import in monorepo anywyay
Still have not figured out how to export types from repo api (e.g. Program_GetAll_Data).
Cannot deploy backend and frontend at the same time. Personally, I think this is not a downside though, they should be done in separated API. (-1)
Not possible to have REST standard. Again, I prefer this way for serverless functions. (-1)
Still deciding if we should do it or not. From what I have tested on seneca-course-reviews, these are the pros and cons on a scale of 0 to 3.
Pros
document.onWrite
(+1).Don't need to include firebase secrets inside repo. This is a must-have if we are open to more contributors (+2).Probably can set up a firestore emulator with Next.js.Cons
No absolute import in backend (-1)Nevermind this, look like we cannot use absolute import in monorepo anywyayStill have not figured out how to export types from repo api (e.g. Program_GetAll_Data).