React — Setup
- Setting Up Development Environment
- Installing Node.js and npm (Node Package Manager).
Download nodejs for your OS:
Below is the screenshot for windows running x64:
This will install LTS of NodeJS v20.11.1 and NPM v10.5.0.
Open Terminal and verify if The installation is successful:
- Creating a new React project using Create React App.
Choose appropriate framework:
I’ll be going with NextJS but feel free to use your preferable version:
npx create-next-app@latest
- Overview of project structure.
Open the project folder in your favorite editor. I’ll be using VSCode:
app
App Router
pages
Pages Router
public
Static assets to be served
next.config.js
Configuration file for Next.js
package.json
Project dependencies and scripts
instrumentation.ts
OpenTelemetry and Instrumentation file
middleware.ts
Next.js request middleware
.env
Environment variables
.env.local
Local environment variables
.env.production
Production environment variables
.env.development
Development environment variables
.eslintrc.json
Configuration file for ESLint
.gitignore
Git files and folders to ignore
next-env.d.ts
TypeScript declaration file for Next.js
tsconfig.json
Configuration file for TypeScript
jsconfig.json
Configuration file for JavaScript
Below link has detailed explanation for the project structure:
Congratulations, you have created a new NextJS project.