Skip to content
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

[오현택 : NextJS] Good-Night-Hackathon-Frontend 제출 #7

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d5e588a
init: next 프로젝트 셋업
HyunTaek5 Aug 27, 2023
4cfd4d1
fix: 파비콘 수정
HyunTaek5 Aug 27, 2023
7b64821
add: ui 관련 패키지 추가
HyunTaek5 Aug 27, 2023
dc77b46
deps: next 버전이슈 해결
HyunTaek5 Aug 27, 2023
92785cb
add: nextui 셋업
HyunTaek5 Aug 27, 2023
9717852
add: 영화추가 드롭다운 추가
HyunTaek5 Aug 27, 2023
7ab0f01
add: date-picker 추가
HyunTaek5 Aug 27, 2023
aec36b5
add: axios 추가
HyunTaek5 Aug 27, 2023
826704d
add: 영화등록페이지 구현
HyunTaek5 Aug 27, 2023
3d753b7
add: 진행상황 반영
HyunTaek5 Aug 27, 2023
4ca57d8
add: 영화 목록 페이지 조회 api 연동 완료
HyunTaek5 Aug 27, 2023
2ea4871
add: GNB에 드롭다운 페이지 이동 추가
HyunTaek5 Aug 27, 2023
46046c2
add: 영화 삭제 구현
HyunTaek5 Aug 27, 2023
92f29a8
add: 영화 수정 구현
HyunTaek5 Aug 27, 2023
0015293
add: 영화 상세 페이지 구현
HyunTaek5 Aug 27, 2023
8e27c2f
add: 영화 상세 리뷰 등록 구현
HyunTaek5 Aug 27, 2023
d2bfc68
add: 리뷰 목록조회 구현
HyunTaek5 Aug 27, 2023
0f4e1d1
add: 리뷰 목록조회 필터링 구현
HyunTaek5 Aug 27, 2023
8623cca
add: 영화 상세 조회 예외처리 추가
HyunTaek5 Aug 27, 2023
de8856b
fix: 로고 404 수정
HyunTaek5 Aug 27, 2023
df7e4bc
add: 관리자 모드 기본 세팅 zustand 추가
HyunTaek5 Aug 27, 2023
93af986
add: 관리자 모드 구현
HyunTaek5 Aug 27, 2023
24f3083
add:진행 사항 업데이트
HyunTaek5 Aug 27, 2023
3fb7bb3
add:영화 추가페이지에서 관리자 해제시 메인페이지로 리턴되게 수정
HyunTaek5 Aug 27, 2023
721dcfb
add: 영화 장르와 상영 여부 필터링 추가
HyunTaek5 Aug 27, 2023
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_API_URL=http://localhost:8080/api/v1
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.next
.vscode
/node_modules
```
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
<br>

## 기능
- [X] 영화 등록 페이지
- [X] 영화 목록
- [X] 영화 수정
- [X] 영화 상세 정보
- [X] 리뷰 등록
- [X] 어드민 페이지 (추가기능)

### 영화 등록 페이지
> **영화 정보 입력**: 사용자는 영화 정보를 입력할 수 있습니다.
Expand Down
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
19 changes: 19 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @type {import('next').NextConfig} */

const nextConfig = {
reactStrictMode: true,
swcMinify: true,
basePath: "",
images: {
unoptimized: true,
},
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
return config;
},
};

module.exports = nextConfig;
91 changes: 91 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"name": "goodnight",
"author": {
"email": "[email protected]",
"name": "Dylan Oh"
},
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"prebuild": "rimraf .next",
"build": "next build",
"preexport": "rimraf out",
"export": "next export",
"touch": "touch out/.nojekyll",
"posttouch": "touch out/_next/.nojekyll",
"start": "next start",
"lint": "next lint",
"lint:fix": "eslint --fix ./src",
"format": "prettier --check --ignore-path .gitignore .",
"format:fix": "prettier --write --ignore-path .gitignore .",
"prepare": "husky install"
},
"dependencies": {
"@lottiefiles/react-lottie-player": "^3.5.2",
"@next/font": "13.1.1",
"@nextui-org/react": "^2.1.7",
"@tailwindcss/forms": "^0.5.5",
"@tailwindcss/ui": "^0.7.2",
"@toss/utils": "^1.3.1",
"@types/node": "18.11.18",
"@types/react": "18.0.26",
"@types/react-datepicker": "^4.15.0",
"@types/react-dom": "18.0.10",
"autoprefixer": "^10.4.13",
"axios": "^1.5.0",
"date-fns": "^2.29.3",
"framer-motion": "^10.16.1",
"husky": "^8.0.3",
"lodash": "^4.17.21",
"next": "^13.3.0",
"next-compose-plugins": "^2.2.1",
"next-images": "^1.8.4",
"postcss": "^8.4.21",
"react": "18.2.0",
"react-datepicker": "^4.16.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.45.4",
"react-query": "^3.39.3",
"react-toastify": "^9.1.1",
"rimraf": "^4.4.1",
"sb": "^6.5.16",
"tailwindcss": "^3.2.4",
"typescript": "4.9.4",
"util": "^0.12.5",
"zustand": "^4.4.1"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@svgr/webpack": "^6.5.1",
"@typescript-eslint/eslint-plugin": "^5.23.0",
"babel-loader": "^8.3.0",
"eslint": "8.31.0",
"eslint-config-next": "13.1.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"prettier": "^2.6.2",
"prettier-plugin-tailwindcss": "^0.1.10"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"resolutions": {
"webpack": "^5"
},
"volta": {
"node": "16.14.2",
"npm": "8.5.5",
"yarn": "1.22.17"
}
}
51 changes: 51 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { Controls, Player } from '@lottiefiles/react-lottie-player';
import { useRouter } from 'next/router';
import React from 'react';

import Layout from '../src/layouts/Layout';

function Error404() {
const router = useRouter();

return (
<section className='py-8 px-4 text-center'>
<div className='max-w-auto md:max-w-4xl mx-auto'>
<div className='flex flex-col items-center my-12 md:my-20'>
{/** asset 주소: https://lottiefiles.com/search?q=404&category=animations&animations-sort=popular */}
<Player
autoplay
loop
src='https://assets9.lottiefiles.com/packages/lf20_zyu0ctqb.json'
className='max-w-[500px]'
>
<Controls
visible={false}
buttons={['play', 'repeat', 'frame', 'debug']}
/>
</Player>
<div className='font-bold text-3xl xl:text-7xl lg:text-6xl md:text-5xl'>
존재하지 않는 페이지입니다.
</div>
<div className='text-main-1 font-medium text-sm md:text-xl lg:text-2xl mt-8'>
The page you are looking for does not exist.
</div>
<button
type='button'
className='flex items-center rounded-lg bg-main-1 px-4 py-2 text-white mt-8'
onClick={() => router.replace('/')}
>
<span className='font-medium'>
Back To Homepage
</span>
</button>
</div>
</div>
</section>
);
}

export default Error404;

Error404.getLayout = function getLayout(page: React.ReactElement) {
return <Layout>{page}</Layout>;
};
38 changes: 38 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import "tailwindcss/tailwind.css";
import "../styles/globals.css";

import { NextPage } from "next";
import type { AppProps } from "next/app";
import Head from "next/head";
import { NextUIProvider } from "@nextui-org/react";
import React, { ReactElement, ReactNode } from "react";
import { QueryClient, QueryClientProvider } from "react-query";

type Page<P = Record<string, never>> = NextPage<P> & {
getLayout?: (page: ReactElement) => ReactNode;
};

type Props = AppProps<{ dehydratedState: unknown }> & {
Component: Page<{ dehydratedState: unknown }>;
};

function App({ Component, pageProps }: Props) {
const getLayout = Component.getLayout ?? ((page) => page);

const queryClient = new QueryClient();

return (
<QueryClientProvider client={queryClient}>
<NextUIProvider>
<div className="flex min-h-screen flex-1 flex-col bg-white font-montserrat text-main-1 tablet:px-10">
<Head>
<title>테커 굿나잇 2nd 해커톤</title>
</Head>
{getLayout(<Component {...pageProps} />)}
</div>
</NextUIProvider>
</QueryClientProvider>
);
}

export default App;
25 changes: 25 additions & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Head, Html, Main, NextScript } from 'next/document';

export default function Document() {
return (
<Html lang='en'>
<Head>
<link
href='https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard-dynamic-subset.css'
rel='stylesheet'
type='text/css'
/>
<link
href='https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&family=Roboto&display=swap'
rel='stylesheet' />
<link
href='https://fonts.googleapis.com/css2?family=Tinos:wght@100;200;300;400;500;600;700;800;900&family=Roboto&display=swap'
rel='stylesheet' />
</Head>
<body id='app'>
<Main />
<NextScript />
</body>
</Html>
);
}
19 changes: 19 additions & 0 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import Layout from "../src/layouts/Layout";
import MovieListSection from "../src/components/Section/MovieListSection";

function Home() {
return (
<>
<main className="mx-10 mt-10 flex flex-col justify-center">
<MovieListSection />
</main>
</>
);
}

export default Home;

Home.getLayout = function getLayout(page: React.ReactElement) {
return <Layout>{page}</Layout>;
};
Loading