๐คทโ๏ธ ๋ณธ๋ก ์ ์์
Tailwind๋?
Tailwind CSS๋ React์ Next ํ๋ ์์ํฌ์์ ๋ง์ด ์ฌ์ฉ๋๋ CSS ํ๋ ์ ์ํฌ์ ๋๋ค.
Tailwind CSS๋ ‘utility-first’ ๋ชฉ์ ์ ๊ธฐ๋ฐ์ผ๋ก ๋ค๋ฅธ CSS ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ฌ๋ฆฌ CSS ํ์ผ & style ํ๊ทธ๋ฅผ ์ฌ์ฉํ์ง ์๊ณ class ์์ฑ์ผ๋ก CSS ์คํ์ผ๋ง ํ ์ ์์ต๋๋ค.
Tailwind CSS ์ฌ์ฉํ๋ ์ด์ ?
Tailwind CSS ํ๋ ์์ํฌ๋ฅผ ํตํด์ UI๋ฅผ ๋น ๋ฅด๊ณ ์ ์ฐํ๊ฒ ๋์์ธํ๊ณ ์คํ์ผ๋งํ ์ ์์ต๋๋ค.
class(className) ๊ธฐ๋ฐ์ ํ๋ฉด์ ์คํ์ผ๋ง ํ๊ธฐ ๋๋ฌธ์ ๊ฐ๋ฐ์์ ์์ฐ์ฑ๊ณผ ๋น ๋ฅด๊ฒ ํ๋ฉด์ ๋ง๋ค ์ ์๋ ์ฅ์ ์ด ์์ต๋๋ค.
๐คทโ๏ธ Tailwind ์ฌ์ฉ๋ฒ
Next.js or React์์ Tailwind CSS ์ ์ฉํ๋ ๋ฐฉ๋ฒ์ ๊ฐ๋จํฉ๋๋ค.
1. tailwind ์ค์น
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
* ์์ ๋ช ๋ น์ด๋ฅผ ์์๋๋ก ํฐ๋ฏธ๋์ ์ ๋ ฅํด์ ์ค์นํฉ๋๋ค.
Next JS ๋ณด์ผ๋ฌํ๋ ์ดํธ
https://github.com/yoogukhyeon/next-boilerplate
GitHub - yoogukhyeon/next-boilerplate
Contribute to yoogukhyeon/next-boilerplate development by creating an account on GitHub.
github.com
Next JS ๋ณด์ผ๋ฌํ๋ ์ดํธ ๊ฐ๋
https://cometruedream.tistory.com/216
๋ณด์ผ๋ฌํ๋ ์ดํธ(Boilerplate code)๋? - ๊ฐ๋ , ํ์ํ ์ด์
๐ ๋ณด์ผ๋ฌ ํ๋ ์ดํธ๋? ์ฝ๋ฉ์ ํ๋ค ๋ณด๋ฉด ์๋ฏธ ์๋ ์ฝ๋ฉ์ ํ ๋๋ ์๊ณ ๋ถํ์ํ ์์ ์ ๋๋ฌธ์ ์ ๋ฌด ์์ฐ์ฑ์ด ๋จ์ด์ง๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. ์ด๋ด ๊ฒฝ์ฐ๋ฅผ ๋๋นํด ๋ณด์ผ๋ฌ ํ๋ ์ดํธ๋ก ๊ธฐ๋ณธ์ ์ธ
cometruedream.tistory.com
2. ์ค์น ํ์ 2๊ฐ์ ํ์ผ์ด ์์ฑ๋ฉ๋๋ค.
3. ์ค์น ํ์ 2๊ฐ์ ํ์ผ์ด ์์ฑ๋ฉ๋๋ค.
postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./app/**/*.{js,ts,jsx,tsx,mdx}',
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
// Or if using `src` directory:
'./src/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {},
},
plugins: [],
};
* ์์ 2๊ฐ์ ํ์ผ์ ๊ฐ๊ฐ์ ๊ฐ์ ์ ์ฉ์ํค๋ฉด Tailwind CSS ์ฌ์ฉํ ์ ์์ต๋๋ค.
4. globals.css ์ ํ
@tailwind base;
@tailwind components;
@tailwind utilities;
* globals.css ํ์ผ์ ์์ ๊ฐ๋ ์ ํ ์ํฉ๋๋ค.
๐คทโ๏ธ Tailwind CSS ์ ์ฉ์ด ์๋ ๋?
์์ ๋ฐฉ์๋๋ก ํ๋๋ฐ Tailwind CSS ์ ์ฉ์ด ์๋์ ์ฌ๋ฌ๊ฐ์ง ์ฝ์ง์ ํ ์๋ ์์ต๋๋ค.
Next.js ์์๋ globals.css ํ์ผ ์์น๋ ์ค์ํฉ๋๋ค.
ํ์ผ์์น๊ฐ ์ด์ํ๋ฉด Tailwind CSS ์ ์ฉ์ด ์๋ ์๋ ์์ต๋๋ค.
์ถ์ฒ: Next.js ๊ณต์๋ฌธ์
Good to know: This is different from the pages directory, where you can only import global styles inside the _app.js file.
Next.js ๋ฒ์ ๋ง๋ค ํ์ผ์์น์ ์ฐจ์ด๊ฐ ์์์ ์์ง๋ง ํ์ผ ์์น๊ฐ styles ํด๋ ์์ ์๊ฑฐ๋ ๋ค๋ฅธ ํด๋ ์์ ์์์๋ ์์ต๋๋ค.
Next.js ๊ณต์๋ฌธ์์์๋ global.css ํ์ผ ์์น์ ๋ํด์ ํผ๋๋ฐฑ์ ์ฃผ๊ณ ์์ต๋๋ค.
์ฝ๊ฒ ์ค๋ช ํ์๋ฉด _app.tsx ํ์ผ๊ณผ ๊ฐ์ ๋์ค ์์น์ global.css ํ์ผ์ด ์์นํด ์์ด์ผ tailwind CSS ์ ์ฉ ๋ฉ๋๋ค.
์๋์ ๊ฐ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค.
์ฌ๋ฐ๋ ์ค๋์ ๋ ๋ณ ์ด์ธ ๋ณด๊ณ ๊ฐ์ธ์!
https://cometruedream.tistory.com/243
NestJS Lifecycle (์๋ช ์ฃผ๊ธฐ) ๊ฐ๋
๐คทโ๏ธ ๋ณธ๋ก ์ ์์ Nest JS ๊ฐ๋ ?Nest JS๋ Node JS ๊ธฐ๋ฐ์ผ๋ก ํ ์๋ฒ ์ดํ๋ฆฌ์ผ์ด์ ํ๋ ์์ํฌ ์ ๋๋ค. ์๋ฐ์คํฌ๋ฆฝํธ๋ ์๋นํ ์ค๋ซ๋์ Express ๊ธฐ๋ฐ์ผ๋ก ์๋ฒ ์ดํ๋ฆฌ์ผ์ด์ ๊ฐ๋ฐ์์ ์๋์ ์ธ ์
cometruedream.tistory.com
https://cometruedream.tistory.com/242
๋ฆฌ์กํธ Vite Proxy ํ์ฉํ CORS ์ค๋ฅ ํด๊ฒฐ
๐คทโ๏ธ ๋ณธ๋ก ์ ์์ํ๋ก ํธ์๋ ๋ฒ๋ค๋ฌ ๊ฐ๋ ๊ณผ webpack vs vite ๋น๊ต์ ๋ํด์ ๊ณต๋ถ๋ฅผ ํ๊ณ ๊ธ์ ๋ณด์๋ฉด ๋ ๋ง์ ๋์์ด ๋ฉ๋๋ค^^ํ๋ก ํธ์๋ ๊ฐ๋ฐ์ ์ํ ๋ฒ๋ค๋ฌ ๊ฐ๋ ๊ณผ webpack vs vite ๋น๊ตhttps://comet
cometruedream.tistory.com
https://cometruedream.tistory.com/241
React ํด๋๊ตฌ์กฐ FSD ๊ธฐ๋ฅ ๋ถํ ์ค๊ณ ์ํคํ ์ฒ
๐คทโ๏ธ ๋ณธ๋ก ์ ์์ํ๋ก์ ํธ๋ฅผ ์์ํ๊ธฐ์ ์์ ํด๋ ๊ตฌ์กฐ, ์ค๊ณ์ ๋ํ ์ํคํ ์ฒ๋ฅผ ๋ง๋๋ ๊ฒ์ ์๋นํ ์ด๋ ต๋ค. ์ด๋ฒ ํ๋ก์ ํธ์ React FSD ํด๋๊ตฌ์กฐ ์ํคํ ์ฒ๋ฅผ ์ค๊ณํ ์์ ์ด๋ผ์ FSD ์ํคํ
cometruedream.tistory.com
https://cometruedream.tistory.com/244
์ฝ๊ฒ ์ดํดํ๊ณ ์ฌ์ฉํ ์ ์๋ Prisma ๋ช ๋ น์ด ์ ๋ฆฌ
๐คทโ๏ธ Prisma ๋ช ๋ น์ด ๋ณธ๋ก ์ ์์ Prisma๋?Nest JS ํ๋ ์์ํฌ์ Prisma ORM์ ํ์ฉํด์ ํ๋ก์ ํธ๋ฅผ ์งํํ๋ฉด์ Prisma๋ Node JS ๊ธฐ๋ฐ์ ํ๋ ์์ํฌ/๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ํธ์์ฉ์ด ์๋๋ฉฐ Prisma + DB ์ฐ๋์ผ
cometruedream.tistory.com
'React' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[React-query] ๋ฐ์ดํฐ ํ๋ฆฌํ์นญ ์ฌ์ฉ๋ฒ ์ ๋ฆฌ (1) | 2024.06.19 |
---|---|
[React] Tailwind ํ์ค, ๋์ค, ์ธ์ค ํจ๊ณผ className ์ปค์คํ (1) | 2024.06.03 |
๋ฆฌ์กํธ Vite Proxy ํ์ฉํ CORS ์ค๋ฅ ํด๊ฒฐ (1) | 2024.05.03 |
React ํด๋๊ตฌ์กฐ FSD ๊ธฐ๋ฅ ๋ถํ ์ค๊ณ ์ํคํ ์ฒ (1) | 2024.05.02 |
react input ๋ชจ๋ ํ ์คํธ ์ ํํ๋ ๋ฐฉ๋ฒ (0) | 2024.03.21 |