Deployment to Heroku and Vercel
To conclude this chapter and have a well-rounded, albeit incomplete, project, we will now deploy our backend (FastAPI) to Heroku and our frontend to Vercel, a Platform-as-a-Service and hosting company that is, incidentally, the creator of Next.js.
You should already have a Heroku account if you followed the workflow described in Chapter 3, Getting Started with FastAPI so we will now proceed and create an account on Vercel. You can and should log in with your GitHub account since your deploys will be automatic from your repository once you set up the project. The process of deploying FastAPI to Heroku has already been discussed in Chapter 5, Building the Backend for Our Application – we just need to pass additional environment variables from our /backend/.env
file, the new MongoDB database name, and Cloudinary data.
A personal note
Heroku seems to dislike when the requirements.txt
file contains the packages’ version numbers &...