Creating a project
Let’s set up a proper JavaScript project from scratch. This is the same process you’ll follow for every new project.Create a folder and initialize npm
-y flag accepts all defaults. This creates a package.json file in your folder.Project structure
A typical JavaScript project looks like this:src/ folder — a flat structure with .js files at the root is fine. You’ll use a more structured layout when you get to React.
Setting up .gitignore
Create a.gitignore file in your project root:
.gitignore
node_modules/. This folder can contain thousands of files and hundreds of megabytes. Everyone who clones your project runs npm install to generate their own copy.
.env files
You’ll use.env files later in the course to store configuration like API URLs. Here’s a preview:
.env
.envfiles store configuration as key-value pairs- They should never be committed to git
- Create a
.env.examplefile (without real values) to show other developers what variables they need
Verify your setup
At this point, you should have:- Node.js installed (
node -vshows a version) - npm available (
npm -vshows a version) - VS Code with ESLint and Prettier extensions
- A practice folder where you can create and run
.jsfiles
What’s next?
Your development environment is set up. Time to learn the language. Let’s start with how JavaScript works and how it compares to Python.JavaScript basics
What JavaScript is, how it compares to Python, and essential syntax