From 4333745d9c8fe7e3bd89eda7487fc469b0de16ae Mon Sep 17 00:00:00 2001 From: snkchan <144839872+snkchan@users.noreply.github.com> Date: Mon, 20 May 2024 19:04:37 +0900 Subject: [PATCH 01/25] init : next-js init --- README.md | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/README.md b/README.md index d8300c8..b066aa1 100644 --- a/README.md +++ b/README.md @@ -1,53 +1 @@ # mobi-3rd-next.js -@see - -### 기간 -``` -2024.05.20 ~ 2024.06.01 (일요일 리뷰 가능하도록 PR 남기기, 스프레티드시트에 링크 등록) -2024.06.02 (WIL, 다른 페어 코드 리뷰, 회고 및 느낀점 발표) - -* 반드시 리드미에 프로젝트 개요와 설명, 시연 영상 등을 함께 작성해주세요 :) -``` - -### 페어-편성 -``` -1페어 Riel - Jeff - Chan -2페어 Gang - Wendy - Brilly -``` - -### 과제 -``` -1. NextJS 똑바로 알기 -2. NextJS 파일 [라우트] 시스템 알아보기 -3. NextJS의 폰트와 이미지 최적화 -4. 서버 사이드 랜더링 -5. NextJS 12와 13의 차이 -6. NextJS 공식 문서와 무료 강의로 러닝하기 -7. mark-down을 활용한 나만의 블로그 호스팅하기 -8. next-auth를 사용하여 로그인 구현하기 -``` - -### 진행방법 -``` -1. 페어는 각자 함께 할 수 있는 시간을 선정합니다. -2. 시간 선정이 완료되면 mobi 단톡방에 월~일요일 단위로 올려주세요. -ex) - 월 - - Jeff (14:00 ~ 22:00) - - Lucas (08:00 ~ 20:00) - - core-time (20:00~22:00) -- 코어 타임은 매일 매일 가져야합니다. 겹치는 시간을 최대한 활용하고 블락킹 된 부분과 풀이한 부분을 공유할 것 - - 화 ... - ... - 목 - 리프레쉬 데이 (같은 페어일 경우 요일 고정) - ... - 일 - - 20:00~22:00 WIL - - 22:00~23:00 1주차 회고 및 느낀점 - - 23:00~01:00 각 페어 코드 리뷰 -- 반드시 PR로 문서화할 것 - - -2. 과제는 스스로 풀어본 이후에 코어 타임에는 반드시 페어와 함께 고민하고 블락킹 된 부분의 해소와 풀이를 공유해야합니다. -3. 매일 매일 풀이한 과제는 해당 레포지토리에 브랜치에 Pair-n으로 commit-push 합니다. (리프레쉬 제외 1일 1커밋 준수) -4. 학습 시간에는 모비 항상 디스코드에 접속해서 학습을 진행해주셔야 합니다. -``` From 419e043a1fbd5af60a36840277422733f7ae416f Mon Sep 17 00:00:00 2001 From: snkchan <144839872+snkchan@users.noreply.github.com> Date: Tue, 21 May 2024 22:06:00 +0900 Subject: [PATCH 02/25] =?UTF-8?q?chore=20:=20nomad=EA=B0=95=EC=9D=98=201~2?= =?UTF-8?q?.8=20=EA=B9=8C=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task1/README.md | 0 nomad/.gitignore | 26 ++ nomad/app/about-us/page.tsx | 9 + nomad/app/layout.tsx | 17 ++ nomad/app/not-found.tsx | 12 + nomad/app/page.tsx | 9 + nomad/components/navigation.tsx | 22 ++ nomad/next-env.d.ts | 5 + nomad/package-lock.json | 455 ++++++++++++++++++++++++++++++++ nomad/package.json | 22 ++ nomad/tsconfig.json | 34 +++ 11 files changed, 611 insertions(+) create mode 100644 Task1/README.md create mode 100644 nomad/.gitignore create mode 100644 nomad/app/about-us/page.tsx create mode 100644 nomad/app/layout.tsx create mode 100644 nomad/app/not-found.tsx create mode 100644 nomad/app/page.tsx create mode 100644 nomad/components/navigation.tsx create mode 100644 nomad/next-env.d.ts create mode 100644 nomad/package-lock.json create mode 100644 nomad/package.json create mode 100644 nomad/tsconfig.json diff --git a/Task1/README.md b/Task1/README.md new file mode 100644 index 0000000..e69de29 diff --git a/nomad/.gitignore b/nomad/.gitignore new file mode 100644 index 0000000..221abb9 --- /dev/null +++ b/nomad/.gitignore @@ -0,0 +1,26 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.next +.env +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/nomad/app/about-us/page.tsx b/nomad/app/about-us/page.tsx new file mode 100644 index 0000000..65017c3 --- /dev/null +++ b/nomad/app/about-us/page.tsx @@ -0,0 +1,9 @@ +const AboutUs = () => { + return ( +
+

about Us

+
+ ) +} + +export default AboutUs diff --git a/nomad/app/layout.tsx b/nomad/app/layout.tsx new file mode 100644 index 0000000..2788d3d --- /dev/null +++ b/nomad/app/layout.tsx @@ -0,0 +1,17 @@ +import Navigation from "../components/navigation" + +export const metadata = { + title: "Next.js", + description: "Generated by Next.js", +} + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + + + + {children} + + + ) +} diff --git a/nomad/app/not-found.tsx b/nomad/app/not-found.tsx new file mode 100644 index 0000000..6a5f936 --- /dev/null +++ b/nomad/app/not-found.tsx @@ -0,0 +1,12 @@ +import Navigation from "../components/navigation" + +const NotFound = () => { + return ( +
+ +

Not Found

+
+ ) +} + +export default NotFound diff --git a/nomad/app/page.tsx b/nomad/app/page.tsx new file mode 100644 index 0000000..36e1489 --- /dev/null +++ b/nomad/app/page.tsx @@ -0,0 +1,9 @@ +const Page = () => { + return ( +
+

Hellow

+
+ ) +} + +export default Page diff --git a/nomad/components/navigation.tsx b/nomad/components/navigation.tsx new file mode 100644 index 0000000..e4fadd6 --- /dev/null +++ b/nomad/components/navigation.tsx @@ -0,0 +1,22 @@ +"use client" +import Link from "next/link" +import { usePathname } from "next/navigation" + +const Navigation = () => { + const path = usePathname() + return ( + + ) +} + +export default Navigation diff --git a/nomad/next-env.d.ts b/nomad/next-env.d.ts new file mode 100644 index 0000000..4f11a03 --- /dev/null +++ b/nomad/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/nomad/package-lock.json b/nomad/package-lock.json new file mode 100644 index 0000000..2dc51f1 --- /dev/null +++ b/nomad/package-lock.json @@ -0,0 +1,455 @@ +{ + "name": "nomad", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "nomad", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "next": "^14.2.3", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@types/node": "20.12.12", + "@types/react": "18.3.2", + "typescript": "5.4.5" + } + }, + "node_modules/@next/env": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.3.tgz", + "integrity": "sha512-W7fd7IbkfmeeY2gXrzJYDx8D2lWKbVoTIj1o1ScPHNzvp30s1AuoEFSdr39bC5sjxJaxTtq3OTCZboNp0lNWHA==" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.3.tgz", + "integrity": "sha512-3pEYo/RaGqPP0YzwnlmPN2puaF2WMLM3apt5jLW2fFdXD9+pqcoTzRk+iZsf8ta7+quAe4Q6Ms0nR0SFGFdS1A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.3.tgz", + "integrity": "sha512-6adp7waE6P1TYFSXpY366xwsOnEXM+y1kgRpjSRVI2CBDOcbRjsJ67Z6EgKIqWIue52d2q/Mx8g9MszARj8IEA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.3.tgz", + "integrity": "sha512-cuzCE/1G0ZSnTAHJPUT1rPgQx1w5tzSX7POXSLaS7w2nIUJUD+e25QoXD/hMfxbsT9rslEXugWypJMILBj/QsA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.3.tgz", + "integrity": "sha512-0D4/oMM2Y9Ta3nGuCcQN8jjJjmDPYpHX9OJzqk42NZGJocU2MqhBq5tWkJrUQOQY9N+In9xOdymzapM09GeiZw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.3.tgz", + "integrity": "sha512-ENPiNnBNDInBLyUU5ii8PMQh+4XLr4pG51tOp6aJ9xqFQ2iRI6IH0Ds2yJkAzNV1CfyagcyzPfROMViS2wOZ9w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.3.tgz", + "integrity": "sha512-BTAbq0LnCbF5MtoM7I/9UeUu/8ZBY0i8SFjUMCbPDOLv+un67e2JgyN4pmgfXBwy/I+RHu8q+k+MCkDN6P9ViQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.3.tgz", + "integrity": "sha512-AEHIw/dhAMLNFJFJIJIyOFDzrzI5bAjI9J26gbO5xhAKHYTZ9Or04BesFPXiAYXDNdrwTP2dQceYA4dL1geu8A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.3.tgz", + "integrity": "sha512-vga40n1q6aYb0CLrM+eEmisfKCR45ixQYXuBXxOOmmoV8sYST9k7E3US32FsY+CkkF7NtzdcebiFT4CHuMSyZw==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.3.tgz", + "integrity": "sha512-Q1/zm43RWynxrO7lW4ehciQVj+5ePBhOK+/K2P7pLFX3JaJ/IZVC69SHidrmZSOkqz7ECIOhhy7XhAFG4JYyHA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==" + }, + "node_modules/@swc/helpers": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", + "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", + "dependencies": { + "@swc/counter": "^0.1.3", + "tslib": "^2.4.0" + } + }, + "node_modules/@types/node": { + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/prop-types": { + "version": "15.7.12", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", + "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==", + "dev": true + }, + "node_modules/@types/react": { + "version": "18.3.2", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.2.tgz", + "integrity": "sha512-Btgg89dAnqD4vV7R3hlwOxgqobUQKgx3MmrQRi0yYbs/P0ym8XozIAlkqVilPqHQwXs4e9Tf63rrCgl58BcO4w==", + "dev": true, + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001620", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz", + "integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/next": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.3.tgz", + "integrity": "sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==", + "dependencies": { + "@next/env": "14.2.3", + "@swc/helpers": "0.5.5", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.2.3", + "@next/swc-darwin-x64": "14.2.3", + "@next/swc-linux-arm64-gnu": "14.2.3", + "@next/swc-linux-arm64-musl": "14.2.3", + "@next/swc-linux-x64-gnu": "14.2.3", + "@next/swc-linux-x64-musl": "14.2.3", + "@next/swc-win32-arm64-msvc": "14.2.3", + "@next/swc-win32-ia32-msvc": "14.2.3", + "@next/swc-win32-x64-msvc": "14.2.3" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/styled-jsx": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", + "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/nomad/package.json b/nomad/package.json new file mode 100644 index 0000000..569fd90 --- /dev/null +++ b/nomad/package.json @@ -0,0 +1,22 @@ +{ + "name": "nomad", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "next dev" + }, + "keywords": [], + "author": "", + "license": "MIT", + "dependencies": { + "next": "^14.2.3", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@types/node": "20.12.12", + "@types/react": "18.3.2", + "typescript": "5.4.5" + } +} diff --git a/nomad/tsconfig.json b/nomad/tsconfig.json new file mode 100644 index 0000000..ccb2ed9 --- /dev/null +++ b/nomad/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "strict": false, + "noEmit": true, + "incremental": true, + "module": "esnext", + "esModuleInterop": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "plugins": [ + { + "name": "next" + } + ] + }, + "include": [ + "next-env.d.ts", + ".next/types/**/*.ts", + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "node_modules" + ] +} From aa6d5ca3cac8aef0174274a81dc44b0a6e26b5c0 Mon Sep 17 00:00:00 2001 From: snkchan <144839872+snkchan@users.noreply.github.com> Date: Wed, 22 May 2024 02:49:13 +0900 Subject: [PATCH 03/25] =?UTF-8?q?feat=20:=20nomad=20movie=20trailer=20?= =?UTF-8?q?=EB=A7=8C=EB=93=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nomad/app/(home)/loading.tsx | 5 ++++ nomad/app/(home)/page.tsx | 29 ++++++++++++++++++++++ nomad/app/(movies)/movies/[id]/error.tsx | 7 ++++++ nomad/app/(movies)/movies/[id]/loading.tsx | 5 ++++ nomad/app/(movies)/movies/[id]/page.tsx | 19 ++++++++++++++ nomad/app/about-us/page.tsx | 4 +++ nomad/app/layout.tsx | 8 ++++-- nomad/app/not-found.tsx | 6 +++-- nomad/app/page.tsx | 9 ------- nomad/components/movie-info.tsx | 13 ++++++++++ nomad/components/movie-videos.tsx | 14 +++++++++++ 11 files changed, 106 insertions(+), 13 deletions(-) create mode 100644 nomad/app/(home)/loading.tsx create mode 100644 nomad/app/(home)/page.tsx create mode 100644 nomad/app/(movies)/movies/[id]/error.tsx create mode 100644 nomad/app/(movies)/movies/[id]/loading.tsx create mode 100644 nomad/app/(movies)/movies/[id]/page.tsx delete mode 100644 nomad/app/page.tsx create mode 100644 nomad/components/movie-info.tsx create mode 100644 nomad/components/movie-videos.tsx diff --git a/nomad/app/(home)/loading.tsx b/nomad/app/(home)/loading.tsx new file mode 100644 index 0000000..a81049f --- /dev/null +++ b/nomad/app/(home)/loading.tsx @@ -0,0 +1,5 @@ +const Loading = () => { + return

Loading...

+} + +export default Loading diff --git a/nomad/app/(home)/page.tsx b/nomad/app/(home)/page.tsx new file mode 100644 index 0000000..ef4d936 --- /dev/null +++ b/nomad/app/(home)/page.tsx @@ -0,0 +1,29 @@ +import Link from "next/link" + +export const metadata = { + title: "Home", +} + +const getMovies = async () => { + await new Promise((resolve) => setTimeout(resolve, 1000)) + const response = await fetch(API_URL) + const json = await response.json() + return json +} + +export const API_URL = "https://nomad-movies.nomadcoders.workers.dev/movies" + +const HomePage = async () => { + const movies = await getMovies() + return ( +
+ {movies.map((movie) => ( +
  • + {movie.title} +
  • + ))} +
    + ) +} + +export default HomePage diff --git a/nomad/app/(movies)/movies/[id]/error.tsx b/nomad/app/(movies)/movies/[id]/error.tsx new file mode 100644 index 0000000..99be3ad --- /dev/null +++ b/nomad/app/(movies)/movies/[id]/error.tsx @@ -0,0 +1,7 @@ +"use client" + +const ErrorOMG = () => { + return

    somthing broke...

    +} + +export default ErrorOMG diff --git a/nomad/app/(movies)/movies/[id]/loading.tsx b/nomad/app/(movies)/movies/[id]/loading.tsx new file mode 100644 index 0000000..6ccb032 --- /dev/null +++ b/nomad/app/(movies)/movies/[id]/loading.tsx @@ -0,0 +1,5 @@ +const Loading = () => { + return

    Loading a movie : id

    +} + +export default Loading diff --git a/nomad/app/(movies)/movies/[id]/page.tsx b/nomad/app/(movies)/movies/[id]/page.tsx new file mode 100644 index 0000000..a4eb89e --- /dev/null +++ b/nomad/app/(movies)/movies/[id]/page.tsx @@ -0,0 +1,19 @@ +import { Suspense } from "react" +import MovieInfo from "../../../../components/movie-info" +import MovieVideos from "../../../../components/movie-videos" + +const MovieDetail = async ({ params: { id } }: { params: { id: string } }) => { + return ( +
    +

    Movie Detail

    + Loading Movie Info}> + + +

    Video

    + Loading Movie Videos}> + + +
    + ) +} +export default MovieDetail diff --git a/nomad/app/about-us/page.tsx b/nomad/app/about-us/page.tsx index 65017c3..c6974d9 100644 --- a/nomad/app/about-us/page.tsx +++ b/nomad/app/about-us/page.tsx @@ -1,3 +1,7 @@ +export const metadata = { + title: "About Us ", +} + const AboutUs = () => { return (
    diff --git a/nomad/app/layout.tsx b/nomad/app/layout.tsx index 2788d3d..14a021e 100644 --- a/nomad/app/layout.tsx +++ b/nomad/app/layout.tsx @@ -1,7 +1,11 @@ import Navigation from "../components/navigation" +import { Metadata } from "next" -export const metadata = { - title: "Next.js", +export const metadata: Metadata = { + title: { + template: `%s | Next Movies`, + default: "Next Movies", + }, description: "Generated by Next.js", } diff --git a/nomad/app/not-found.tsx b/nomad/app/not-found.tsx index 6a5f936..497e92e 100644 --- a/nomad/app/not-found.tsx +++ b/nomad/app/not-found.tsx @@ -1,9 +1,11 @@ -import Navigation from "../components/navigation" +import { title } from "process" +export const metadata = { + title: "Not found", +} const NotFound = () => { return (
    -

    Not Found

    ) diff --git a/nomad/app/page.tsx b/nomad/app/page.tsx deleted file mode 100644 index 36e1489..0000000 --- a/nomad/app/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -const Page = () => { - return ( -
    -

    Hellow

    -
    - ) -} - -export default Page diff --git a/nomad/components/movie-info.tsx b/nomad/components/movie-info.tsx new file mode 100644 index 0000000..e4241f9 --- /dev/null +++ b/nomad/components/movie-info.tsx @@ -0,0 +1,13 @@ +import { API_URL } from "../app/(home)/page" + +const getMovie = async (id: string) => { + const response = await fetch(`${API_URL}/${id}`) + return response.json() +} + +const MovieInfo = async ({ id }: { id: string }) => { + const movie = await getMovie(id) + return
    {JSON.stringify(movie)}
    +} + +export default MovieInfo diff --git a/nomad/components/movie-videos.tsx b/nomad/components/movie-videos.tsx new file mode 100644 index 0000000..b347602 --- /dev/null +++ b/nomad/components/movie-videos.tsx @@ -0,0 +1,14 @@ +import { API_URL } from "../app/(home)/page" + +const getVideos = async (id: string) => { + // await new Promise((resolve) => setTimeout(resolve, 3000)) + // throw new Error("somting broke....") + const response = await fetch(`${API_URL}/${id}/videos`) + return response.json() +} + +const MovieVideos = async ({ id }: { id: string }) => { + const videos = await getVideos(id) + return
    {JSON.stringify(videos)}
    +} +export default MovieVideos From df8f8a6a1cf90751d4cf11cd3571a1c8322d89b2 Mon Sep 17 00:00:00 2001 From: snkchan <144839872+snkchan@users.noreply.github.com> Date: Wed, 22 May 2024 22:32:54 +0900 Subject: [PATCH 04/25] =?UTF-8?q?chore=20:=20next.js=20css=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nomad/app/layout.tsx | 1 + nomad/components/navigation.tsx | 8 +- nomad/styles/global.css | 136 +++++++++++++++++++++++++++++ nomad/styles/navigation.module.css | 8 ++ 4 files changed, 149 insertions(+), 4 deletions(-) create mode 100644 nomad/styles/global.css create mode 100644 nomad/styles/navigation.module.css diff --git a/nomad/app/layout.tsx b/nomad/app/layout.tsx index 14a021e..b82723b 100644 --- a/nomad/app/layout.tsx +++ b/nomad/app/layout.tsx @@ -1,3 +1,4 @@ +import "../styles/global.css" import Navigation from "../components/navigation" import { Metadata } from "next" diff --git a/nomad/components/navigation.tsx b/nomad/components/navigation.tsx index e4fadd6..8015f0d 100644 --- a/nomad/components/navigation.tsx +++ b/nomad/components/navigation.tsx @@ -1,18 +1,18 @@ "use client" import Link from "next/link" import { usePathname } from "next/navigation" +import style from "../styles/navigation.module.css" const Navigation = () => { const path = usePathname() return ( -