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
24 changes: 24 additions & 0 deletions Week10/gureum/mission1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
35 changes: 35 additions & 0 deletions Week10/gureum/mission1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Week10 Mission1 - Movie Search

TMDB APIλ₯Ό ν™œμš©ν•œ μ˜ν™” 검색, 성인 μ½˜ν…μΈ  포함 μ—¬λΆ€, μ–Έμ–΄ 선택, μ˜ν™” 상세 λͺ¨λ‹¬, SPA 배포 섀정을 ν¬ν•¨ν•œ 10μ£Όμ°¨ λ―Έμ…˜μž…λ‹ˆλ‹€.

## μ‹€ν–‰

```bash
npm install
npm run dev
```

## ν™˜κ²½λ³€μˆ˜

`.env` νŒŒμΌμ€ Git에 μ˜¬λ¦¬μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. `.env.example`을 μ°Έκ³ ν•΄ μ•„λž˜ 값을 μ„€μ •ν•΄μ£Όμ„Έμš”.

```bash
VITE_TMDB_BASE_URL=https://api.themoviedb.org/3
VITE_TMDB_API_KEY=your_tmdb_bearer_token
```
Comment on lines +14 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== .env.example 쑴재 확인 =="
fd -HI '^\.env\.example$'

echo
echo "== README ν™˜κ²½λ³€μˆ˜ ν‚€ 확인 =="
rg -n 'VITE_TMDB_BASE_URL|VITE_TMDB_API_KEY' Week10/gureum/mission1/README.md -C2

echo
echo "== .env.example λ‚΄ ν‚€ 확인 (파일이 μžˆμ„ λ•Œλ§Œ) =="
if fd -HI '^\.env\.example$' | grep -q .; then
  fd -HI '^\.env\.example$' -x sh -c 'echo "--- $1 ---"; rg -n "VITE_TMDB_BASE_URL|VITE_TMDB_API_KEY" "$1" -C2 || true' sh {}
fi

Repository: HSU-Makeus-Challenge-10th/Web

Length of output: 284


.env.example 파일이 μ‘΄μž¬ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. νŒŒμΌμ„ μƒμ„±ν•˜κ±°λ‚˜ README μ§€μ‹œλ¬Έμ„ μˆ˜μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.

README 14번 λΌμΈμ—μ„œλŠ” κ°œλ°œμžλ“€μ΄ .env.example을 μ°Έκ³ ν•˜λ„λ‘ μ•ˆλ‚΄ν•˜κ³  μžˆμœΌλ‚˜, ν•΄λ‹Ή 파일이 μ €μž₯μ†Œμ— μ‘΄μž¬ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. .env.example νŒŒμΌμ„ μƒμ„±ν•˜μ—¬ ν•„μš”ν•œ ν™˜κ²½ λ³€μˆ˜λ₯Ό ν¬ν•¨μ‹œν‚€κ±°λ‚˜, README의 μ°Έκ³  μ§€μ‹œλ¬Έμ„ μˆ˜μ •ν•˜μ„Έμš”.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Week10/gureum/mission1/README.md` around lines 14 - 19, The README currently
instructs developers to reference a `.env.example` file for environment variable
setup, but this file does not exist in the repository. Either create a
`.env.example` file in the project root that contains the required environment
variable templates (VITE_TMDB_BASE_URL and VITE_TMDB_API_KEY with placeholder
values), or update the README instruction in lines 14-19 to remove the reference
to the non-existent `.env.example` file and directly provide the environment
variable names and format that developers need to configure.

Comment on lines +17 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | πŸ—οΈ Heavy lift

ν΄λΌμ΄μ–ΈνŠΈ λ²ˆλ“€μ— Bearer 토큰을 λ…ΈμΆœν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

Line 17-19처럼 VITE_ 접두사 ν™˜κ²½λ³€μˆ˜μ— TMDB Bearer 토큰을 λ„£μœΌλ©΄ λΈŒλΌμš°μ €μ—μ„œ κ·ΈλŒ€λ‘œ λ…ΈμΆœλ©λ‹ˆλ‹€. ν˜„μž¬ κ΅¬μ‘°λŠ” ν‚€ λ‚¨μš©/μΏΌν„° μ†Œμ§„ λ¦¬μŠ€ν¬κ°€ μžˆμ–΄, 토큰은 μ„œλ²„(ν”„λ‘μ‹œ/API route)둜 μ΄λ™ν•˜κ³  ν”„λ‘ νŠΈλŠ” μ„œλ²„ μ—”λ“œν¬μΈνŠΈλ§Œ ν˜ΈμΆœν•˜λ„λ‘ λ°”κΎΈλŠ” 편이 μ•ˆμ „ν•©λ‹ˆλ‹€.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Week10/gureum/mission1/README.md` around lines 17 - 19, The VITE_TMDB_API_KEY
environment variable with the Bearer token is being exposed to the client bundle
because VITE_ prefixed variables are automatically bundled into the browser. To
fix this security issue, remove the VITE_TMDB_API_KEY from the client
environment variables, move the TMDB Bearer token to server-side environment
variables (not prefixed with VITE_), create a server-side proxy endpoint or API
route that uses the token to make requests to TMDB, and update the client code
to call your server endpoint instead of directly calling the TMDB API with the
token. This way the token remains protected on the server and the client never
has access to it.


## κ΅¬ν˜„ λ‚΄μš©

- `form` 기반 μ˜ν™” 검색 UI
- μ˜ν™” 제λͺ© μž…λ ₯ μƒνƒœ 관리
- 성인 μ½˜ν…μΈ  포함 μ—¬λΆ€λ₯Ό `include_adult` νŒŒλΌλ―Έν„°λ‘œ 전달
- ν•œκ΅­μ–΄, μ˜μ–΄, 일본어 선택 값을 `language` νŒŒλΌλ―Έν„°λ‘œ 전달
- μ˜ν™” μΉ΄λ“œ 클릭 μ‹œ 상세 λͺ¨λ‹¬ ν‘œμ‹œ
- IMDb 검색 λ²„νŠΌ μƒˆ νƒ­ μ—΄κΈ°
- `/movies/:movieId` λΌμš°νŒ… μœ μ§€
- `vercel.json`으둜 SPA μƒˆλ‘œκ³ μΉ¨ 404 λ°©μ§€
- `React.memo`, `useCallback`, `useMemo` 기반 λ Œλ”λ§ μ΅œμ ν™”

## μ΅œμ ν™” 기둝

[OPTIMIZATION.md](./OPTIMIZATION.md)에 μ˜ν™” νŽ˜μ΄μ§€ μ΅œμ ν™” λ‚΄μš©κ³Ό LP νŽ˜μ΄μ§€ μ„±λŠ₯ κ°œμ„  포인트λ₯Ό μ •λ¦¬ν–ˆμŠ΅λ‹ˆλ‹€.
23 changes: 23 additions & 0 deletions Week10/gureum/mission1/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
])
13 changes: 13 additions & 0 deletions Week10/gureum/mission1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>mission1</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading