Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Next.js portfolio application with Contentful CMS and a complete Firebase hosting and Cloud Functions deployment guide.

Portfolio library replicating the GitHub UI, built with Next.js, TypeScript, and Tailwind CSS.
Next JS Portfolio is a portfolio application template built on Next.js 10 and Contentful, bundled with a step-by-step guide for deploying it to Firebase Hosting and Cloud Functions. This repository serves as both a working portfolio site for milon27.com and a practical reference for developers who want to run a Next.js application on Firebase's serverless platform.
This is a front-end portfolio project that uses the Next.js framework (version 10.0.5) with React 17.0.1 and includes Contentful as its content management system. Out of the box it provides the application code and a custom server.js file that integrates Next.js with Firebase Functions, so the entire Next.js app can be served through a Firebase Hosting rewrite. The repository also contains a Firebase configuration and deployment scripts, making it a complete starter for deploying a Next.js app on Firebase.
nextServer, allowing the Next.js application to run serverless.firebase-functions and next prepares the Next.js app and passes each request to its request handler.npm run deploy and npm run deploy2 commands that use cross-env and the Firebase CLI to deploy both functions and hosting.firebase.json and deleting the placeholder index.html from the public folder.npm run build, and push it with npm run deploy.server.js and firebase.json rewrites show a working pattern for serving a Next.js app on Firebase.The deployment flow starts with building the Next.js project to generate the .next folder. The Firebase CLI then deploys the nextServer Cloud Function and the hosting configuration. The firebase.json file sets the hosting public directory to public, ignores common files, and rewrites every route to the nextServer function. The function itself uses firebase-functions to create an HTTPS endpoint, initializes the Next.js server in production mode, and forwards all requests to Next's request handler.
The deployment instructions explicitly say to upgrade to the Pay-as-you-go Firebase plan. Cloud Functions requires a billing account on Firebase, even if the invocation volume stays within free tier limits.
The repository uses Next.js 10.0.5, React 17.0.1, firebase-functions 3.13.0, and firebase-admin 9.4.2. The firebase.json functions runtime is set to Node.js 12.
index.html from the public directory?The default Next.js starter creates a public/index.html file that would be served by Firebase Hosting before the rewrite can forward requests to the Cloud Function. Deleting it ensures all requests go through the Next.js server.
The code is written for Next.js 10, but the general pattern of using a custom server with firebase-functions is still applicable to newer versions as long as you adjust the dependencies and the Node.js runtime.
