# Setup Guide — Web Technologies

Install everything you need for this course. Pick your platform and run the steps.

## What you'll need

| Tool             | Used in                  | Min version |
|------------------|--------------------------|-------------|
| Web browser      | All labs                 | Latest Chrome/Firefox/Edge |
| VS Code          | All labs                 | Latest      |
| Git              | All labs (submission)    | 2.30+       |
| Node.js + npm    | L6+ (JS, React, Express) | 20 LTS      |
| JDK 21           | L10a (Spring Boot)       | 21          |
| Maven (or wrapper) | L10a                  | 3.9+ (or use `./mvnw`) |
| Python           | L10c (Django)            | 3.11+       |
| Docker Desktop   | L13, Lab 8               | 4.20+       |
| SQLite (built-in via `sqlite3`) | L9, Lab 5  | 3.35+       |

## macOS

Install Homebrew if you don't have it: <https://brew.sh/>

```bash
# Core
brew install git node@20 python@3.12 sqlite

# Java
brew install --cask temurin@21

# VS Code
brew install --cask visual-studio-code

# Docker
brew install --cask docker
```

Verify:

```bash
git --version
node --version          # v20.x
java -version           # 21
python3 --version       # 3.11+
docker --version
```

## Windows

Use **winget** (built into Windows 11):

```powershell
winget install --id Git.Git
winget install --id OpenJS.NodeJS.LTS
winget install --id Python.Python.3.12
winget install --id EclipseAdoptium.Temurin.21.JDK
winget install --id Microsoft.VisualStudioCode
winget install --id Docker.DockerDesktop
```

After installing Docker, **restart Windows**, then enable WSL2 if prompted.

## Linux (Ubuntu/Debian)

```bash
sudo apt update
sudo apt install -y git curl python3 python3-venv python3-pip sqlite3

# Node 20 via nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
exec $SHELL
nvm install 20

# Java 21
sudo apt install -y openjdk-21-jdk

# VS Code: download .deb from https://code.visualstudio.com/

# Docker — follow https://docs.docker.com/engine/install/ubuntu/
```

## VS Code extensions (recommended)

Open VS Code → Extensions, install:

- **Live Server** (Ritwick Dey) — preview HTML files
- **Prettier - Code formatter**
- **ESLint**
- **HTML CSS Support**
- **GitLens**
- **GitHub Pull Requests and Issues**
- **REST Client** (Huachao Mao) — test APIs from `.http` files
- **Docker** (Microsoft)
- **Python** (Microsoft)
- **Extension Pack for Java** (Microsoft) — for Spring Boot
- **ES7+ React/Redux/React-Native snippets** — for React

## GitHub & Classroom

1. Create a free GitHub account: <https://github.com/signup>
2. Set up SSH or use HTTPS with a Personal Access Token.
3. Configure Git locally (one time):
   ```bash
   git config --global user.name  "Your Name"
   git config --global user.email "you@example.com"
   ```
4. Click your first Classroom invite from the course page → accept → you'll get a private repo.

## Verifying your setup

Run this one-liner inside any folder. If everything succeeds, you're good:

```bash
git --version && node --version && npm --version && java -version && python3 --version && docker --version
```

## Troubleshooting

**Node says "command not found"** — restart your terminal after install.

**Docker won't start (Windows)** — make sure WSL2 is enabled. See <https://docs.docker.com/desktop/install/windows-install/>.

**Docker is super slow (Mac)** — go to Docker Desktop → Settings → Resources, raise CPU/RAM.

**`npm install` is very slow / fails** — check your network, try `npm install --no-audit --no-fund`.

**Java version mismatch** — `java -version` and `javac -version` should both print 21. On Mac:
```bash
/usr/libexec/java_home -V                 # list installed JDKs
export JAVA_HOME=$(/usr/libexec/java_home -v 21)
```

Still stuck? Bring it to lab — we'll debug together.
