Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions next-netflix/.gitignore
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
12 changes: 12 additions & 0 deletions next-netflix/.prettierignore
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
8 changes: 8 additions & 0 deletions next-netflix/.prettierrc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그냥 개인적 궁금인데 prettier 설정도 두분이 협의하셨나요?? 다른팀은 어떤지 궁금해서요..

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"
}
22 changes: 22 additions & 0 deletions next-netflix/.vscode/settings.json
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"
}
}
36 changes: 36 additions & 0 deletions next-netflix/README.md
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.
27 changes: 27 additions & 0 deletions next-netflix/app/api/tmdb/[...path]/route.ts
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",
},
});
}
5 changes: 5 additions & 0 deletions next-netflix/app/detail/[id]/page.tsx
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 />;
}
Binary file added next-netflix/app/favicon.ico
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안쓰는 파일은 정리해도 좋을것같습니다

Binary file not shown.
26 changes: 26 additions & 0 deletions next-netflix/app/globals.css
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;
}
25 changes: 25 additions & 0 deletions next-netflix/app/home/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Previews from "../../components/features/Home/Previews";

Choose a reason for hiding this comment

The 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>
</>
);
}
39 changes: 39 additions & 0 deletions next-netflix/app/layout.tsx
Copy link

Choose a reason for hiding this comment

The 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>
);
}
5 changes: 5 additions & 0 deletions next-netflix/app/page.tsx
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 />;
}
19 changes: 19 additions & 0 deletions next-netflix/app/providers.tsx
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>;
}
Loading