An example or boilerplate for combining 3 technologies together Next.js, Nest.js and Firebase functions and hosting.
- Nest.js (server-side)
- Next.js (server-side render for react)
- React.js (do i have to tell you about it? :P)
- nest-next (An easy bridge between Nest.js and Next.js)
- Firebase functions (Nest.js and Next.js runs on the Firebase Cloud functions)
- Firebase Hosting (Next.js static bundle will be delivered from Firebase CDN, learn more about it here)
- For Local development, go to app folder run
npm ioryarnandnpm run devwill launch development server. - Hot module replacement for Next.js and incremental build for Nest.js.
- For Production, run
npm run build, this will create.next,distand will copy static bundle topublicfolder for instant deploy. - You can check and test this production build in local by running
npm run firebase:localto emulate how you app will run in Firebase functions and hosting. - Finally, to deploy it to Firebase functions and hosting run
npm run firebase:deploy.
Before deploy or firebase serve, change the project ID in .firebaserc file to your firebase project ID or else the build will get failed.
This app is fork of nest-next package example and modified it to work with firebase functions and hosting.