๐๐ป Vite + ๋ฆฌ์กํธ ์ค์น ๋ฐ ์คํ(MacOS)
Installing and Running Vite + React (MacOS)
โ๏ธ Vite+React์์ Vite๋ ํ๋์ค์ด๋ก ๋น ๋ฅด๋ค๋ผ๋ ๋ป์
๋๋ค.
In Vite+React, Vite means fast in French.
โ๏ธ ๊ฐ๋ฐ ํ๊ฒฝ์ ๊ตฌ์ถํ๊ณ ์ฝ๋๋ฅผ ์คํํ๋ ์๋๋ฅผ ํ๊ธฐ์ ์ผ๋ก ๊ฐ์ ํ๋ ๊ฒ์ ๋ชฉํ๋ก ๋ง๋ค์ด์ก์ต๋๋ค.
It was created with the goal of dramatically improving the speed at which you can set up your development environment and run your code.
โ๏ธ Vite+๋ฆฌ์กํธ๋? UI ๋ผ์ด๋ธ๋ฌ๋ฆฌ (์ปดํฌ๋ํธ ๋ง๋ค๊ธฐ)๋น๋ ๋๊ตฌ[react] + ๊ฐ๋ฐ ์๋ฒ[vite]
What is Vite+React? A UI library (for building components) and a build tool (React) + a development server (Vite).
โ๏ธ ๋ณดํต nginx๊ฐ React๋ฅผ ์๋นํ๊ณ nodejs express๋ ์ฐ๋์ ํฉ๋๋ค.
Usually nginx serves React and connects with nodejs express.
# 1. ์ต์ Vite + React + TypeScript ํ๋ก์ ํธ ์์ฑ
# Create a modern Vite + React + TypeScript project
npm create vite@latest myvideo-admin --template react-ts
# ๋ง์ฝ yarn ์ฐ๋ ๊ฒฝ์ฐ
# If you use yarn
# yarn create vite myvideo-admin --template react-ts
# 2. ํ๋ก์ ํธ ํด๋๋ก ์ด๋
#Go to project folder
cd myvideo-admin
# 3. ์์กด์ฑ ์ค์น
# Installing dependencies
npm install
# 4. ๊ฐ๋ฐ ์๋ฒ ์คํ (์๋์ผ๋ก ๋ธ๋ผ์ฐ์ ์ด๋ฆผ)
# Run the development server (browser opens automatically)
npm run dev
โ๏ธ ์คํฌ๋ฆฐ์ท/ScreenShot


๐๐ปpostgresql ์ค์น(MacOS) / Start,Stop the PostgreSQL Service (MacOS)
โ๏ธ ์ค์น / install
brew install postgresql@17
โ๏ธ ํ๊ฒฝ๋ณ์์ค์ ๋ฐ ์คํ / Setting environment variables and running
# Homebrew postgresql@17์ bin ๊ฒฝ๋ก ์ถ๊ฐ (Apple Silicon Mac ๊ธฐ์ค)
# Added bin path for Homebrew postgresql@17 (based on Apple Silicon Macs)
echo 'export PATH="/opt/homebrew/opt/postgresql@17/bin:$PATH"' >> ~/.zshrc
# Intel Mac์ด๋ฉด /usr/local/opt/... ์ผ ์ ์์ โ ์๋๋ก ๋์ฒด
# If you have an Intel Mac, it may be /usr/local/opt/... โ Replace with below
# echo 'export PATH="/usr/local/opt/postgresql@17/bin:$PATH"' >> ~/.zshrc
# ๋ณ๊ฒฝ ์ ์ฉ (ํฐ๋ฏธ๋ ์ฌ์์ ์์ด ๋ฐ๋ก)
# Apply changes (immediately without restarting the terminal)
source ~/.zshrc
# ๋ค์ ํ์ธ
# check again
psql --version
# ์คํ ,Mac์์๋์ด๋ ๊ฒ ์คํํ๋ฉด ๋จ ์ํผ์ ์ ๊ฐ postgres๊ฐ ์๋.
# Run , on Mac, run like this. The superuser is not postgres.
psql postgres
โ๏ธ postgresql ์๋น์ค ์์ ์ข
๋ฃ(MacOS)
Start,Stop the PostgreSQL Service (MacOS)
brew services start postgresql@17 # start
brew services stop postgresql@17 # stop
โ๏ธ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ ์ / Database connection
psql postgres