Playground 홈 · 문서 목록

신규 앱 설정 파일

신규 앱 만들기에서 필요한 단계만 따라오세요. 각 항목을 펼쳐 apps/portal/ 아래에 작성합니다. portal과 3002는 바꿀 수 있는 예시이며 기존 앱을 복사할 필요는 없습니다.

패키지

apps/portal/package.json 코드 보기
{
    "name": "portal",
    "version": "0.1.0",
    "type": "module",
    "private": true,
    "scripts": {
        "dev": "node ../../packages/fonts/generate.mjs && next dev --port 3002",
        "build": "node ../../packages/fonts/generate.mjs && next build",
        "start": "node ../../packages/fonts/generate.mjs && next start --port 3002",
        "lint": "eslint --max-warnings 0",
        "check-types": "next typegen && tsc --noEmit"
    },
    "dependencies": {
        "next": "catalog:",
        "react": "catalog:",
        "react-dom": "catalog:",
        "@repo/fonts": "workspace:*",
        "@repo/ui": "workspace:*",
        "@repo/env": "workspace:*",
        "@repo/auth": "workspace:*",
        "@repo/api-core": "workspace:*"
    },
    "devDependencies": {
        "@repo/eslint-config": "workspace:*",
        "@repo/typescript-config": "workspace:*",
        "@types/node": "catalog:",
        "@types/react": "catalog:",
        "@types/react-dom": "catalog:",
        "eslint": "catalog:",
        "typescript": "catalog:",
        "tailwindcss": "catalog:",
        "@tailwindcss/postcss": "catalog:",
        "postcss": "catalog:"
    }
}

타입스크립트

apps/portal/tsconfig.json 코드 보기
{
    "extends": "@repo/typescript-config/nextjs.json",
    "compilerOptions": {
        "plugins": [
            {
                "name": "next"
            }
        ],
        "strictNullChecks": true,
        "paths": {
            "@/*": ["./*"]
        }
    },
    "include": [
        "**/*.ts",
        "**/*.tsx",
        "next-env.d.ts",
        "next.config.js",
        ".next/types/**/*.ts"
    ],
    "exclude": ["node_modules"]
}

프레임워크

apps/portal/next.config.js 코드 보기
/** @type {import('next').NextConfig} */
const nextConfig = { transpilePackages: ["@repo/env", "@repo/auth"] };

export default nextConfig;

스타일 처리

apps/portal/postcss.config.mjs 코드 보기
const config = {
    plugins: {
        "@tailwindcss/postcss": {},
    },
};

export default config;

코드 검사

apps/portal/eslint.config.js 코드 보기
import { nextJsConfig } from "@repo/eslint-config/next-js";

/** @type {import("eslint").Linter.Config[]} */
export default nextJsConfig;

컴포넌트 생성

apps/portal/components.json 코드 보기
{
    "$schema": "https://ui.shadcn.com/schema.json",
    "style": "base-nova",
    "rsc": true,
    "tsx": true,
    "tailwind": {
        "config": "",
        "css": "../../packages/ui/src/styles/globals.css",
        "baseColor": "neutral",
        "cssVariables": true
    },
    "iconLibrary": "lucide",
    "aliases": {
        "components": "@/components",
        "ui": "@repo/ui/shadcn",
        "lib": "@/lib",
        "hooks": "@repo/ui/hooks",
        "utils": "@repo/ui/lib/utils"
    }
}

작업 연결

apps/portal/turbo.json 코드 보기
{
    "extends": ["//"],
    "tasks": {
        "dev": {
            "with": ["@repo/api-core#dev"]
        }
    }
}

환경변수

apps/portal/.env 코드 보기
NEXT_PUBLIC_APP_MODE=mock

새 앱을 추가한 뒤 루트에서 pnpm install을 실행해 lockfile을 갱신합니다. .env는 Git에 올리지 않습니다.