This is a starter project implementing a server side rendering Next.js progressive web application on Firebase Cloud Function with Firebase Hosting. Enjoy it !
- 🚀 Server side rendering application
- 🏳🌈 Internationalization
- 🚀 Progressive web app
- 💯 High Lighthouse scores
- ✅ Cache control
- 🚀 SEO optimized
- ✅ Twitter Cards meta
- ✅ OpenGraph structured data
- 📦 Uses the popular, well-maintained Material UI React component library
- 🚀 Styles optimized (postcss, clean-css)
# Install dependencies
npm install
# Log in to firebase account
node_modules/.bin/firebase login
# Choose a firebase project
node_modules/.bin/firebase use <project_id>
# Build
npm run build-all
# Run in dev mode
npm run dev
# Deploy locally
npm run serve
# Deploy to firebase
npm run deploy-<dev|stag|prod>
-
Firebase configuration :
- Log in to your firebase account with the command
node_modules/.bin/firebase login
. - Update the file
.firebaserc
with your own firebase projects id. You can get them usingnode_modules/.bin/firebase projects:list
. - Add your Firebase project configurations in
/src/app/utils/firebase.js
.
- Log in to your firebase account with the command
-
Common configurations (
/src/app
) :- You can configure somes in the folder
utils
: the common config of the application inconfig.js
, the material-ui themes in the foldertheme
. - To configure the localization, update
locales.json
. The locale path folder is atutils/locales/
.
- You can configure somes in the folder
-
Internationalization (
/src/app
):- The locale is implemented manually in the style of react-i18next. The locales can be configured with
locales.json
. - The locale folder is located in
utils/locales/
. - We attribute for each page a key to identify it in the locale resources. This keys are specified in
locales.json
.
- The locale is implemented manually in the style of react-i18next. The locales can be configured with