1. ํ๋ก์ ํธ ํด๋ ๋ง๋ค๊ธฐ
$ mkdir prj_folder
2. ํ๋ก์ ํธ ํด๋๋ก ์ด๋
$ cd prj_folder
3. ํด๋น ํด๋๋ฅผ VSCode์์ ์ด์ด๋ณด๊ธฐ
$ code .
4. package.json ํด๋ ์์ฑ
$ npm init -y
5. ํ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
- react : UI์ ๋ค๋ฅธ ๋ชจ๋ ๊ฒ์ ๊ตฌ์ฑ
- react-dom : ์์ ๊ฒ์ ๋ธ๋ผ์ฐ์ ์ Document Object Model(DOM)์ ๋ ๋ํ๋ ์ญํ
$ npm install react@latest next@latest react-dom@latest
6. jackage.json ์คํฌ๋ฆฝํธ ์์
"scripts" : {
"dev" : "next dev"
},
7. ํ๋ก์ ํธ ์คํ ํ์ธ
$ npm run dev
- local server ์คํ : http://localhost:3000
- Next.js๊ฐ ์๋์ผ๋ก
- typeScript dependencies ์ค์น
- app/page.tsx ๋ฅผ ์ฐธ์กฐํ์ฌ ํ๋ฉด ๋์ด์ค
- app/layout.tsx ํ์ผ ์์ฑ
8. README.md ํ์ผ ์ถ๊ฐ
$ touch README.md
'Next.js' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Next.js] fetch data, React vs Next.js (0) | 2024.03.19 |
---|---|
[Next.js] Server component vs Client component (0) | 2024.03.19 |
[Next.js] Library vs Framework (1) | 2024.03.15 |
[Next.js] CSR(client side render) vs SSR(server side render) (0) | 2024.03.15 |