Learning paths / Vibe coding to production / Already built it? Start here

Run it on your machine

Reading · 6 min · Module 2, lesson 2 of 416 min left in this module

Module 2 · Already built it? Start hereLesson 2 of 4

Goal: Install, configure and start an exported app locally, keeping machine-only settings in a .env file that never reaches Git.

Key idea

Before an app goes online, it has to run on your machine, started by you, from the repository. Code goes in Git. Settings that change per machine, and anything secret, go in environment variables, which on your laptop usually come from a .env file that Git ignores.

Install and start the starter

You need Node 20 or later. Check with node --version. Then, in labs/vibe-starter:

npm install
npm start

npm install downloads the dependencies listed in package.json, here just Express. npm start runs the start script, which is node server.js. You should see:

Tasks app listening on http://127.0.0.1:3000

Open http://localhost:3000 and add a task. In a second terminal, check the health endpoint:

curl http://localhost:3000/healthz

It answers {"status":"ok"}. Stop the app with Ctrl+C. Then run the tests with npm test; all of them pass.

Your own app may use another command. The scripts section of package.json, or the README, says which. If you can't tell, ask your agent to explain how the project starts, without changing anything.

Where settings live

Apps read settings from environment variables: process.env.PORT in Node, os.environ in Python. They're set outside the code, so the same code runs on your laptop and online with different values.

  • The same everywhere and not secret, like a page size: in the code or a committed config file.
  • Different per machine, like a port or a log level: an environment variable.
  • Secret, like API keys, passwords and database connection strings: an environment variable, never committed.

On your machine, a .env file is the usual place for those variables:

PORT=3000
ADMIN_KEY=demo-not-a-real-key-0000

Node 20.6 and later load it with node --env-file=.env server.js; other stacks use a small library or their framework's built-in support. The starter doesn't read any variables yet. Module 6 changes that.

Keep .env out of Git

Add .env to .gitignore before the file exists, then commit a .env.example with the same names and obviously fake values. Anyone cloning the project, including your agent, learns what to set without seeing your real values.

Online, the platform sets the same variables for you. On ComputeSphere, that's the service's variables and secrets, which the deploy module uses.

Check yourself

Your app needs a payment provider's API key to run locally. Where does it go?

In the docs