-
Notifications
You must be signed in to change notification settings - Fork 8
[6주차] Team Menual 신용섭 & 최무헌 과제 제출합니다. #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7b60029
12c61fe
61d9f9a
9a57c01
c3ba7f0
2c8e639
74fcbdd
a97524e
85f292e
f085ca0
eba77d6
1df5b34
2a232d6
df99749
6998a57
31e7f63
0e5bc10
eca2174
3a5b747
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
|
||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.* | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/versions | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # next.js | ||
| /.next/ | ||
| /out/ | ||
|
|
||
| # production | ||
| /build | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| .pnpm-debug.log* | ||
|
|
||
| # env files (can opt-in for committing if needed) | ||
| .env* | ||
| .env | ||
|
|
||
| # vercel | ||
| .vercel | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| .next | ||
| node_modules | ||
| out | ||
| build | ||
| dist | ||
| public | ||
| *.config.js | ||
| *.config.mjs | ||
| next-env.d.ts | ||
| package-lock.json | ||
| yarn.lock | ||
| pnpm-lock.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "semi": true, | ||
| "singleQuote": false, | ||
| "tabWidth": 2, | ||
| "trailingComma": "es5", | ||
| "printWidth": 100, | ||
| "arrowParens": "always" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "editor.formatOnSave": true, | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.codeActionsOnSave": { | ||
| "source.fixAll.eslint": "explicit" | ||
| }, | ||
| "[javascript]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode" | ||
| }, | ||
| "[javascriptreact]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode" | ||
| }, | ||
| "[typescript]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode" | ||
| }, | ||
| "[typescriptreact]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode" | ||
| }, | ||
| "[json]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). | ||
|
|
||
| ## Getting Started | ||
|
|
||
| First, run the development server: | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| # or | ||
| yarn dev | ||
| # or | ||
| pnpm dev | ||
| # or | ||
| bun dev | ||
| ``` | ||
|
|
||
| Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
|
||
| You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
|
|
||
| This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. | ||
|
|
||
| ## Learn More | ||
|
|
||
| To learn more about Next.js, take a look at the following resources: | ||
|
|
||
| - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
| - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
|
||
| You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! | ||
|
|
||
| ## Deploy on Vercel | ||
|
|
||
| The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
|
||
| Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { NextResponse } from "next/server"; | ||
|
|
||
| const API_BASE = "https://api.themoviedb.org/3"; | ||
|
|
||
| export async function GET(req: Request, { params }: { params: Promise<{ path: string[] }> }) { | ||
| const token = process.env.TMDB_API_KEY; | ||
| if (!token) { | ||
| return NextResponse.json({ message: "TMDB_API_KEY missing" }, { status: 500 }); | ||
| } | ||
|
|
||
| const { searchParams } = new URL(req.url); | ||
| const { path } = await params; | ||
| const joined = (path ?? []).join("/"); | ||
| const target = `${API_BASE}/${joined}?${searchParams.toString()}`; | ||
|
|
||
| const res = await fetch(target, { | ||
| headers: { accept: "application/json", Authorization: `Bearer ${token}` }, | ||
| cache: "no-store", | ||
| }); | ||
|
|
||
| return new NextResponse(await res.text(), { | ||
| status: res.status, | ||
| headers: { | ||
| "content-type": res.headers.get("content-type") ?? "application/json", | ||
| }, | ||
| }); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import Detail from "@/components/features/Detail"; | ||
|
|
||
| export default function Page() { | ||
| return <Detail />; | ||
| } |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 안쓰는 파일은 정리해도 좋을것같습니다 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| @import "tailwindcss"; | ||
|
|
||
| :root { | ||
| --background: #ffffff; | ||
| --foreground: #171717; | ||
| } | ||
|
|
||
| @theme inline { | ||
| --color-background: var(--background); | ||
| --color-foreground: var(--foreground); | ||
| --font-sans: var(--font-geist-sans); | ||
| --font-mono: var(--font-geist-mono); | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: dark) { | ||
| :root { | ||
| --background: #0a0a0a; | ||
| --foreground: #ededed; | ||
| } | ||
| } | ||
|
|
||
| body { | ||
| background: var(--background); | ||
| color: var(--foreground); | ||
| font-family: Arial, Helvetica, sans-serif; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import Previews from "../../components/features/Home/Previews"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 절대경로 일관되게 적용하시는게 더 좋을 거 같습니다..! |
||
| import Thumb from "../../components/features/Home/Thumb"; | ||
| import Continue from "../../components/features/Home/Continue"; | ||
| import { getTrendingMoviesDay, getPopularMovies, getTopRatedMovies } from "@/lib/tmdbServer"; | ||
| import Popular from "@/components/features/Home/Popular"; | ||
|
|
||
| export default async function Home() { | ||
| // SSR: 서버에서 데이터 페칭 | ||
| const [trendingData, popularData, topRatedData] = await Promise.all([ | ||
| getTrendingMoviesDay("en-US"), | ||
| getPopularMovies("en-US"), | ||
| getTopRatedMovies("en-US"), | ||
| ]); | ||
|
|
||
| return ( | ||
| <> | ||
| <main className="mx-auto max-w-[430px]"> | ||
| <Thumb movies={trendingData.results} /> | ||
| <Previews movies={topRatedData.results} /> | ||
| <Continue movies={popularData.results} /> | ||
| <Popular movies={trendingData.results} /> | ||
| </main> | ||
| </> | ||
| ); | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 화면 전체 크기를 설정하지 않고 축소하면 계속 축소되도록 의도하신건가요?? 개인적으로는 화면 크기가 고정되어있는것도 좋을것같습니다 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import "./globals.css"; | ||
| import type { Metadata } from "next"; | ||
| import { Geist, Geist_Mono } from "next/font/google"; | ||
| import { TabBar } from "@/components/features/TabBar"; | ||
| import { NavBar } from "@/components/features/NavBar"; | ||
| import Providers from "./providers"; | ||
|
|
||
| const geistSans = Geist({ | ||
| variable: "--font-geist-sans", | ||
| subsets: ["latin"], | ||
| }); | ||
|
|
||
| const geistMono = Geist_Mono({ | ||
| variable: "--font-geist-mono", | ||
| subsets: ["latin"], | ||
| }); | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Create Next App", | ||
| description: "Generated by create next app", | ||
| }; | ||
|
|
||
| export default function RootLayout({ children }: { children: React.ReactNode }) { | ||
| return ( | ||
| <html lang="en"> | ||
| <body | ||
| className={`${geistSans.variable} ${geistMono.variable} antialiased m-0 p-0 flex justify-center bg-black`} | ||
| > | ||
| <Providers> | ||
| <div className="min-h-dvh pb-[calc(72px+env(safe-area-inset-bottom))] w-[375px] bg-black relative"> | ||
| <NavBar /> | ||
| {children} | ||
| <TabBar /> | ||
| </div> | ||
| </Providers> | ||
| </body> | ||
| </html> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import LandingPageComponent from "@/components/features/landingPage"; | ||
|
|
||
| export default function LandingPage() { | ||
| return <LandingPageComponent />; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| "use client"; | ||
|
|
||
| import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
| import { useState, type ReactNode } from "react"; | ||
|
|
||
| export default function Providers({ children }: { children: ReactNode }) { | ||
| const [client] = useState( | ||
| () => | ||
| new QueryClient({ | ||
| defaultOptions: { | ||
| queries: { | ||
| staleTime: 60_000, // 1분 fresh | ||
| refetchOnWindowFocus: false, // 포커스될 때 재요청 방지 | ||
| }, | ||
| }, | ||
| }) | ||
| ); | ||
| return <QueryClientProvider client={client}>{children}</QueryClientProvider>; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그냥 개인적 궁금인데 prettier 설정도 두분이 협의하셨나요?? 다른팀은 어떤지 궁금해서요..