feat: React 성능 최적화 및 Vercel 배포 시스템 구축 완료

🚀 성능 최적화 (Task 8):
- React.lazy를 활용한 코드 스플리팅 구현
- React.memo, useMemo, useCallback을 통한 메모이제이션 최적화
- 초기 번들 크기 87% 감소 (470kB → 62kB)
- 백그라운드 동기화 간격 최적화 (5분 → 30초)

📦 Vercel 배포 인프라 구축 (Task 9):
- vercel.json 배포 설정 및 보안 헤더 구성
- GitHub Actions 자동 배포 워크플로우 설정
- 환경별 배포 및 미리보기 시스템 구현
- 자동화된 배포 스크립트 및 환경 변수 관리
- 포괄적인 배포 가이드 및 체크리스트 작성

🔧 코드 품질 개선:
- ESLint 주요 오류 수정 (사용하지 않는 변수/import 정리)
- 테스트 커버리지 확장 (229개 테스트 통과)
- TypeScript 타입 안전성 강화
- Prettier 코드 포맷팅 적용

⚠️ 참고: 테스트 파일의 any 타입 및 일부 경고는 향후 개선 예정

🛠️ Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
hansoo
2025-07-12 20:52:04 +09:00
parent 4d9effce41
commit e72f9e8d26
38 changed files with 2360 additions and 1887 deletions

View File

@@ -5,11 +5,11 @@
* 이 스크립트는 .env.example 파일을 기반으로 Vercel 환경 변수를 설정합니다.
*/
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
const { execSync } = require("child_process");
const fs = require("fs");
const path = require("path");
const ENV_EXAMPLE_PATH = path.join(__dirname, '..', '.env.example');
const ENV_EXAMPLE_PATH = path.join(__dirname, "..", ".env.example");
function parseEnvFile(filePath) {
if (!fs.existsSync(filePath)) {
@@ -17,15 +17,15 @@ function parseEnvFile(filePath) {
process.exit(1);
}
const content = fs.readFileSync(filePath, 'utf-8');
const content = fs.readFileSync(filePath, "utf-8");
const envVars = {};
content.split('\n').forEach(line => {
content.split("\n").forEach((line) => {
line = line.trim();
if (line && !line.startsWith('#') && line.includes('=')) {
const [key, ...values] = line.split('=');
if (key.startsWith('VITE_')) {
envVars[key.trim()] = values.join('=').trim();
if (line && !line.startsWith("#") && line.includes("=")) {
const [key, ...values] = line.split("=");
if (key.startsWith("VITE_")) {
envVars[key.trim()] = values.join("=").trim();
}
}
});
@@ -34,52 +34,52 @@ function parseEnvFile(filePath) {
}
function setupVercelEnv() {
console.log('🚀 Vercel 환경 변수 설정을 시작합니다...');
console.log("🚀 Vercel 환경 변수 설정을 시작합니다...");
// Vercel CLI 설치 확인
try {
execSync('vercel --version', { stdio: 'ignore' });
execSync("vercel --version", { stdio: "ignore" });
} catch (error) {
console.error('❌ Vercel CLI가 설치되지 않았습니다.');
console.error('다음 명령어로 설치해주세요: npm i -g vercel');
console.error("❌ Vercel CLI가 설치되지 않았습니다.");
console.error("다음 명령어로 설치해주세요: npm i -g vercel");
process.exit(1);
}
// .env.example에서 환경 변수 파싱
console.log('📋 .env.example에서 환경 변수를 읽고 있습니다...');
console.log("📋 .env.example에서 환경 변수를 읽고 있습니다...");
const envVars = parseEnvFile(ENV_EXAMPLE_PATH);
if (Object.keys(envVars).length === 0) {
console.log('⚠️ VITE_ 접두사를 가진 환경 변수가 없습니다.');
console.log("⚠️ VITE_ 접두사를 가진 환경 변수가 없습니다.");
return;
}
console.log('🔧 다음 환경 변수들을 Vercel에 설정해야 합니다:');
Object.keys(envVars).forEach(key => {
console.log("🔧 다음 환경 변수들을 Vercel에 설정해야 합니다:");
Object.keys(envVars).forEach((key) => {
console.log(` - ${key}`);
});
console.log('\\n📝 Vercel 대시보드에서 수동으로 설정하거나,');
console.log('다음 Vercel CLI 명령어들을 사용하세요:\\n');
console.log("\\n📝 Vercel 대시보드에서 수동으로 설정하거나,");
console.log("다음 Vercel CLI 명령어들을 사용하세요:\\n");
// 환경별 설정 명령어 생성
const environments = [
{ name: 'production', flag: '--prod' },
{ name: 'preview', flag: '--preview' },
{ name: 'development', flag: '--dev' }
{ name: "production", flag: "--prod" },
{ name: "preview", flag: "--preview" },
{ name: "development", flag: "--dev" },
];
environments.forEach(env => {
environments.forEach((env) => {
console.log(`# ${env.name.toUpperCase()} 환경:`);
Object.keys(envVars).forEach(key => {
const placeholder = `your-${env.name}-${key.toLowerCase().replace('vite_', '').replace(/_/g, '-')}`;
Object.keys(envVars).forEach((key) => {
const placeholder = `your-${env.name}-${key.toLowerCase().replace("vite_", "").replace(/_/g, "-")}`;
console.log(`vercel env add ${key} ${env.flag} # 값: ${placeholder}`);
});
console.log('');
console.log("");
});
console.log('💡 팁: Vercel 대시보드 (Settings > Environment Variables)에서');
console.log(' 더 쉽게 환경 변수를 관리할 수 있습니다.');
console.log("💡 팁: Vercel 대시보드 (Settings > Environment Variables)에서");
console.log(" 더 쉽게 환경 변수를 관리할 수 있습니다.");
}
// 스크립트 실행
@@ -87,4 +87,4 @@ if (require.main === module) {
setupVercelEnv();
}
module.exports = { parseEnvFile, setupVercelEnv };
module.exports = { parseEnvFile, setupVercelEnv };