This commit is contained in:
2025-12-15 18:24:02 +09:00
48 changed files with 2232 additions and 4018 deletions

14
frontend/.env Normal file
View File

@@ -0,0 +1,14 @@
# ==============================================
# 로컬 개발용 (npm run dev)
# ==============================================
NODE_ENV=development
# 클라이언트 API URL
NEXT_PUBLIC_API_URL=http://localhost:4000
# 서버사이드 프록시용 (next.config.ts rewrites)
BACKEND_INTERNAL_URL=http://localhost:4000
# 앱 설정
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
NEXT_TELEMETRY_DISABLED=1

14
frontend/.env.dev Normal file
View File

@@ -0,0 +1,14 @@
# ==============================================
# Docker 개발 환경용 (docker-compose)
# ==============================================
NODE_ENV=development
# 클라이언트 API URL (브라우저에서 호출)
NEXT_PUBLIC_API_URL=/backend/api
# 서버사이드 프록시용 (next.config.ts rewrites)
BACKEND_INTERNAL_URL=http://host.docker.internal:4000
# 앱 설정
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
NEXT_TELEMETRY_DISABLED=1

14
frontend/.env.prod Normal file
View File

@@ -0,0 +1,14 @@
# ==============================================
# 프로덕션 환경용 (배포)
# ==============================================
NODE_ENV=production
# 클라이언트 API URL (브라우저에서 호출)
NEXT_PUBLIC_API_URL=/backend/api
# 서버사이드 프록시용 (next.config.ts rewrites)
BACKEND_INTERNAL_URL=http://host.docker.internal:4000
# 앱 설정
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
NEXT_TELEMETRY_DISABLED=1

68
frontend/.gitignore vendored
View File

@@ -1,6 +1,6 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
# ==============================================
# Dependencies
# ==============================================
/node_modules
/.pnp
.pnp.*
@@ -10,32 +10,68 @@
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
# ==============================================
# Build Output
# ==============================================
/.next/
/out/
# production
/build
# misc
# ==============================================
# Testing
# ==============================================
/coverage
# ==============================================
# IDE & Editors
# ==============================================
/.idea
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# ==============================================
# OS Files
# ==============================================
.DS_Store
Thumbs.db
*.pem
# debug
# ==============================================
# Debug Logs
# ==============================================
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
# vercel
# ==============================================
# Vercel
# ==============================================
.vercel
# typescript
# ==============================================
# TypeScript
# ==============================================
*.tsbuildinfo
next-env.d.ts
# ==============================================
# Misc
# ==============================================
.temp
.tmp
# ==============================================
# Environment Variables
# ==============================================
.env
.env.local
.env.prod
# .env.dev는 허용 (배포용)
!.env.dev
!.env.example

View File

@@ -11,13 +11,11 @@ COPY package*.json ./
# 의존성 설치
RUN npm install
# 소스 코드 복사
# 소스 코드 복사 (node_modules 제외 - .dockerignore)
COPY . .
# 빌드 시 필요한 환경 변수 설정
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
ENV NEXT_PUBLIC_API_URL=/backend/api
# Next.js 빌드
RUN npm run build

View File

@@ -1,19 +1,22 @@
import type { NextConfig } from "next";
// Next.js 핵심 설정 파일, Next.js가 시작할 때 이 파일을 찾아서 읽음
// 여기에 Next.js 설정 옵션을 정의할 수 있음
// 백엔드 URL 설정
// 로컬: http://localhost:4000
// Docker: http://host.docker.internal:4000
const BACKEND_URL = process.env.BACKEND_INTERNAL_URL || 'http://localhost:4000';
const nextConfig: NextConfig = {
eslint: {
ignoreDuringBuilds: true, // 빌드 시 ESLint warning 무시
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true, // 빌드 시 TypeScript 에러 무시 (임시)
ignoreBuildErrors: true,
},
async rewrites() {
return [
{
source: '/backend/api/:path*', // /api가 붙은 모든 요청
destination: 'http://192.168.11.249:4000/:path*', // 백엔드 API로 요청
source: '/backend/api/:path*',
destination: `${BACKEND_URL}/:path*`,
},
];
},

View File

@@ -1,22 +0,0 @@
import type { NextConfig } from "next";
// Next.js 핵심 설정 파일, Next.js가 시작할 때 이 파일을 찾아서 읽음
// 여기에 Next.js 설정 옵션을 정의할 수 있음
const nextConfig: NextConfig = {
eslint: {
ignoreDuringBuilds: true, // 빌드 시 ESLint warning 무시
},
typescript: {
ignoreBuildErrors: true, // 빌드 시 TypeScript 에러 무시 (임시)
},
async rewrites() {
return [
{
source: '/backend/api/:path*', // /api가 붙은 모든 요청
destination: 'http://192.168.11.249:4000/:path*', // 백엔드 API로 요청
},
];
},
};
export default nextConfig;