Platform foundations
Prepare the Next.js project
Verify the application locally and define its build, runtime, environment, and version-control assumptions before involving a deployment platform.
8 minute lesson
A platform cannot make a broken production build reliable. Start from the Field Notes app built in the Next.js course or another small repository you control.
Run linting and the production build, remove machine-specific paths, document required environment variables, and ensure generated files and secrets are ignored appropriately. Commit the source to Git. Vercel can deploy without Git through its CLI, but a repository gives the course a repeatable review and release workflow.
npm install
npm run lint
npm run build
git status
The clean-clone test is stronger than “it works on my machine.” It reveals undeclared files, globally installed tools, missing lockfiles, case-sensitive path mistakes, and environment values that exist only in one shell. Pin the Node.js and package-manager versions the project depends on, and make the production build the same command Vercel will run.
Document each environment variable by name, purpose, scope, and whether it is required during build or request handling. Do not put secret values in the document. Add a health route that checks application startup without exposing credentials or performing a destructive dependency test, then define one real user path for the post-deployment smoke check.
Clone the repository into a temporary folder and build it using only the committed files plus documented local environment values.
Lesson completed