Running Projects Locally
Once you’ve got your project set up and your dependencies installed, you need to actually run the thing. And this is where you’ll experience localhost (Means ‘this/your computer’ - it’s a hostname that points to your own machine. When you run a local server, you access it at localhost.). Localhost is just your computer pretending to be a web server (A program (or computer) that waits for requests and sends back responses. Your browser asks a web server for pages; the server delivers them.). The agent will start the server and you go to localhost, and it’ll show your project running on your machine.
You’ll see localhost:3000 or localhost:8080 or some number. That number is the port (A number that apps use to talk on a computer. localhost:3000 means the app is listening on port 3000.). It’s like different channels. So you could have one project running on 3000 and another on 3001 at the same time. They don’t interfere with each other because they’re on different ports.
To run a project, you usually do something like npm run dev or npm start. It depends on how the project is set up. There’ll usually be a README file that tells you, or the coding agent will figure it out. And when you run it, the terminal will show you the URL, like “ready on localhost:3000,” and you just open that in your browser.
It’s running, it’s live, but only on your machine. No one else can see it, you can’t share that link with anyone. It’s local. You’re developing, you’re testing, you’re making sure it works before you deploy (The process of putting your code on a server so people can use it.) it to the actual internet where everyone can see it.
When you make changes to your code while the dev server is running, most of the time it’ll automatically refresh. You don’t have to restart it. That’s called hot reloading. It just picks up the changes.