Phase 1: Environment Setup
Ensure you have the required prerequisites:
- Install Node.js (LTS): Make sure you have Node.js and npm installed (check with node -v and npm -v).
- VS Code: Ensure you are using Visual Studio Code.
Phase 2: Create the Next.js Project with TypeScript
We will use the official Next.js installer, which correctly sets up React, TypeScript, and Tailwind CSS.
- Open Terminal: Open your integrated terminal in VS Code (Terminal > New Terminal).
- Run Initialization Command: Execute the following command to create your project:(This command forces TypeScript, Tailwind CSS, ESLint, and the recommended App Router (--app).)
- Bash npx create-next-app qml-viz-ts --ts --tailwind --eslint --app



- Navigate: Change into the new project directory:
Bash cd qml-viz-ts - Install D3.js and Types: Now, install the D3 library along with its TypeScript definitions (@types/d3). This step is crucial for TypeScript to understand D3's functions and methods.
Bash
npm install d3
npm install --save-dev @types/d3
- To run: npm run dev