μ΄ λ¬Έμμμλ Altsis νλ‘μ νΈμ λ‘컬 κ°λ° νκ²½μ ꡬμΆνλ λ°©λ²μ μ€λͺ ν©λλ€.
- νμ λꡬ
- μ μ₯μ ν΄λ‘ λ° μμ‘΄μ± μ€μΉ
- νκ²½ λ³μ μ€μ
- λ‘컬 μλ² μ€ν
- κ°λ° λꡬ μΆμ²
μλ λꡬλ€μ΄ μμ€ν μ μ€μΉλμ΄ μμ΄μΌ ν©λλ€.
| λꡬ | μ΅μ λ²μ | μ€μΉ λ°©λ² |
|---|---|---|
| Node.js | LTS (18.x μ΄μ) | nodejs.org λλ nvm install --lts |
| Yarn | 1.22.x μ΄μ | npm install -g yarn |
| Git | 2.x μ΄μ | git-scm.com |
| MongoDB | 6.x μ΄μ | mongodb.com |
| Redis | 7.x μ΄μ | redis.io |
| λꡬ | μ©λ |
|---|---|
| MongoDB Compass | MongoDB GUI ν΄λΌμ΄μΈνΈ - λ°μ΄ν° μ‘°ν/μμ μ νΈλ¦¬ |
| Redis CLI / RedisInsight | Redis μΈμ λ°μ΄ν° νμΈ |
| Postman | API ν μ€νΈ |
| nvm (Node Version Manager) | Node.js λ²μ κ΄λ¦¬ |
# Node.js λ²μ νμΈ
node --version
# v18.x.x μ΄μμ΄μ΄μΌ ν©λλ€
# Yarn λ²μ νμΈ
yarn --version
# Git λ²μ νμΈ
git --versiongit clone <repository-url> school-information-system
cd school-information-systemνλ‘μ νΈλ 루νΈ, backend/, frontend/ μΈ κ³³μ κ°κ° package.jsonμ΄ μμ΅λλ€. κ° λλ ν 리μμ μμ‘΄μ±μ μ€μΉν΄μΌ ν©λλ€.
# λ£¨νΈ μμ‘΄μ± μ€μΉ
yarn install
# λ°±μλ μμ‘΄μ± μ€μΉ
cd backend
yarn install
# νλ‘ νΈμλ μμ‘΄μ± μ€μΉ
cd ../frontend
yarn installμ°Έκ³ : λ°±μλλ
"type": "module"μ μ¬μ©νμ¬ ES Module λ¬Έλ²(import/export)μ μ¬μ©ν©λλ€.
λ°±μλλ NODE_ENV κ°μ λ°λΌ λ€λ₯Έ .env νμΌμ λ‘λν©λλ€:
| NODE_ENV | νμΌ μμΉ |
|---|---|
local |
backend/.env.local |
test |
backend/.env.test |
| κΈ°ν (production λ±) | backend/.env (dotenv κΈ°λ³Έ) |
backend/.env.local νμΌμ μμ±νκ³ μλ νλͺ©μ μ€μ ν©λλ€:
# μλ² μ€μ
PORT=4000
# λ°μ΄ν°λ² μ΄μ€
DB_URL=mongodb://localhost:27017
# Redis
REDIS_URL=redis://localhost:6379
# μΈμ
session_key=your_session_secret_key_here
# CORS νμ© λλ©μΈ (νλ‘ νΈμλ URL)
URL=http://localhost:3000
# AWS S3 (νμΌ μ
λ‘λ)
AWS_ACCESS_KEY=your_aws_access_key
AWS_SECRET_KEY=your_aws_secret_key
AWS_REGION=ap-northeast-2
AWS_BUCKET=your_bucket_name
# Google OAuth (μ ν)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretfrontend/.env νμΌμ μμ±ν©λλ€:
# λ°±μλ μλ² URL
REACT_APP_SERVER_URL=http://localhost:4000μ£Όμ:
.envνμΌμ μ λ Gitμ 컀λ°νμ§ λ§μμμ€..gitignoreμ μ΄λ―Έ ν¬ν¨λμ΄ μλμ§ νμΈνμμμ€.
# MongoDB μμ (macOS - Homebrew)
brew services start mongodb-community
# Redis μμ (macOS - Homebrew)
brew services start rediscd backend
# κ°λ° λͺ¨λ (nodemon - νμΌ λ³κ²½ μ μλ μ¬μμ)
yarn dev
# λλ λ‘컬 λͺ¨λ (.env.local μ¬μ©)
yarn localμ μ μ€ν μ μλμ κ°μ λ‘κ·Έκ° μΆλ ₯λ©λλ€:
NODE_ENV is development
debug: process.env.DB_URL is mongodb://localhost:27017
Express server listening on port 4000
cd frontend
# κ°λ° λͺ¨λ (Hot Reload)
yarn startμ μ μ€ν μ λΈλΌμ°μ μμ http://localhost:3000μ΄ μλμΌλ‘ μ΄λ¦½λλ€.
| μμΉ | λͺ λ Ήμ΄ | μ€λͺ |
|---|---|---|
backend/ |
yarn dev |
κ°λ° λͺ¨λ (nodemon, NODE_ENV=development) |
backend/ |
yarn local |
λ‘컬 λͺ¨λ (nodemon, NODE_ENV=local, .env.local μ¬μ©) |
backend/ |
yarn prod |
νλ‘λμ λͺ¨λ (NODE_ENV=production) |
backend/ |
yarn test |
Jest ν μ€νΈ μ€ν |
backend/ |
yarn jsdoc |
JSDoc λ¬Έμ μμ± |
frontend/ |
yarn start |
κ°λ° μλ² (React Scripts, Hot Reload) |
frontend/ |
yarn build |
νλ‘λμ λΉλ |
frontend/ |
yarn test |
ν μ€νΈ μ€ν |
| νμ₯ νλ‘κ·Έλ¨ | μ©λ |
|---|---|
| ESLint | JavaScript/TypeScript λ¦°ν |
| Prettier - Code formatter | μ½λ ν¬λ§€ν |
| SCSS IntelliSense | SCSS μλ μμ± |
| CSS Modules | CSS Module ν΄λμ€λͺ μλ μμ± |
| ES7+ React/Redux/React-Native snippets | React μ½λ μ€λν« |
| GitLens | Git μ΄λ ₯ μΆμ |
| Thunder Client | VS Code λ΄ API ν μ€νΈ |
| MongoDB for VS Code | MongoDB λ°μ΄ν° μ‘°ν |
settings.jsonμ μλ μ€μ μ μΆκ°νλ©΄ κ°λ° κ²½νμ΄ ν₯μλ©λλ€:
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"typescript.tsdk": "frontend/node_modules/typescript/lib",
"css.modules.camelCase": true
}| νμ₯ νλ‘κ·Έλ¨ | μ©λ |
|---|---|
| React Developer Tools | React μ»΄ν¬λνΈ νΈλ¦¬ κ²μ¬, μν νμΈ, μ±λ₯ νλ‘νμΌλ§ |
| Redux DevTools | Zustand μ€ν μ΄ μν λλ²κΉ (Zustandλ Redux DevTools νΈν) |
MongoDB Compassλ₯Ό μ¬μ©νλ©΄ λ°μ΄ν°λ₯Ό μκ°μ μΌλ‘ νμν μ μμ΅λλ€:
- MongoDB Compass μ€μΉ: λ€μ΄λ‘λ
- μ°κ²° λ¬Έμμ΄ μ
λ ₯:
mongodb://localhost:27017 - μμΉ΄λ°λ―Έλ³ λ°μ΄ν°λ² μ΄μ€λ₯Ό νμΈν μ μμ΅λλ€
ν: λ©ν° λ°μ΄ν°λ² μ΄μ€ ꡬ쑰μ΄λ―λ‘, κ° μμΉ΄λ°λ―Έλ
academyIdλ₯Ό μ΄λ¦μΌλ‘ νλ λ³λμ λ°μ΄ν°λ² μ΄μ€λ₯Ό μ¬μ©ν©λλ€.
| μ¦μ | μμΈ | ν΄κ²° λ°©λ² |
|---|---|---|
ECONNREFUSED (MongoDB) |
MongoDBκ° μ€νλμ§ μμ | brew services start mongodb-community |
ECONNREFUSED (Redis) |
Redisκ° μ€νλμ§ μμ | brew services start redis |
| CORS μ€λ₯ | .envμ URL κ°μ΄ νλ‘ νΈμλ URLκ³Ό λΆμΌμΉ |
URL=http://localhost:3000 νμΈ |
| μΈμ μ μ§ μλ¨ | μΏ ν€ μ€μ λ¬Έμ | νλ‘ νΈμλμ λ°±μλκ° κ°μ λλ©μΈμΈμ§ νμΈ |
MODULE_NOT_FOUND |
μμ‘΄μ± λ―Έμ€μΉ | ν΄λΉ λλ ν 리μμ yarn install μ¬μ€ν |
| ν¬νΈ μΆ©λ | μ΄λ―Έ μ¬μ© μ€μΈ ν¬νΈ | lsof -i :4000μΌλ‘ νμΈ ν νλ‘μΈμ€ μ’
λ£ |