-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate code and configuration to vercel template
- Loading branch information
Showing
37 changed files
with
1,420 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
browser: true, | ||
amd: true, | ||
node: true, | ||
es6: true, | ||
}, | ||
extends: ["eslint:recommended", "plugin:prettier/recommended"], | ||
rules: { | ||
"prettier/prettier": "error", | ||
"react/react-in-jsx-scope": "off", | ||
"react/prop-types": 0, | ||
"no-unused-vars": 0, | ||
"react/no-unescaped-entities": 0, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.tsx"], | ||
rules: { | ||
"no-undef": "off", | ||
}, | ||
}, | ||
], | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,66 @@ | ||
# Create React App | ||
# Today's Artwork | ||
|
||
This directory is a brief example of a [Create React App](https://github.com/facebook/create-react-app) site that can be deployed to Vercel with zero configuration. | ||
> 오늘의 미술작품을 큐레이팅해주는 페이지입니다. | ||
## Deploy Your Own | ||
- [설치 및 실행](#설치-및-실행) | ||
- [설계](#설계) | ||
- [사용 기술](#사용-기술) | ||
- [트러블 슈팅](#트러블슈팅) | ||
|
||
Deploy your own Create React App project with Vercel. | ||
--- | ||
|
||
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/create-react-app&template=create-react-app) | ||
## 설치 및 실행 | ||
|
||
_Live Example: https://create-react-template.vercel.app/_ | ||
`npm start` | ||
프로젝트 루트 폴더에서 실행합니다. | ||
|
||
## Available Scripts | ||
## 설계 | ||
|
||
In the project directory, you can run: | ||
> 메인 화면에는 오늘의 작품이 보이고, 최근목록페이지로 이동하면 최근 4일간의 작품이 보입니다. 최근 작품 중 하나를 클릭하면 메인화면과 동일한 구성의 화면이 보입니다. | ||
### `npm start` | ||
![메인](./public/page1.png) | ||
|
||
Runs the app in the development mode. Open [http://localhost:3000](http://localhost:3000) to view it in your browser. | ||
<!-- ![최근미술작품](./public/page2.png) --> | ||
|
||
The page will reload when you make changes. You may also see any lint errors in the console. | ||
### 사용하는 API : [메트로폴리탄 미술관 API](https://metmuseum.github.io/) | ||
|
||
### `npm test` | ||
> 미술작품의 id 기준으로 데이터를 불러오며, 올해의 날짜는 하나의 id와 매핑됩니다. | ||
Launches the test runner in the interactive watch mode. See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
## 사용 기술 | ||
|
||
### `npm run build` | ||
- React | ||
- Tailwindcss | ||
- CRA | ||
- Typescript | ||
- react-query | ||
|
||
Builds the app for production to the `build` folder. | ||
## 트러블슈팅 | ||
|
||
It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes. | ||
### 해싱 | ||
|
||
#### **초기 해싱 아이디어** | ||
|
||
- 미술작품은 최대값이 871891인 object id를 가진다. | ||
- 1년 동안에는 unique hash 값을 가지도록 하자. | ||
- 오늘의 날짜를 토대로 6자리 hash 값을 뽑아내자. | ||
|
||
#### **초기 아이디어의 문제점** | ||
|
||
- object id가 6자리가 아닌 미술작품은 절대 나오지 않는다. | ||
- object id는 연속함수가 아니다. 즉, 뽑아낸 hash값이 object id중에 없을 수도 있다. | ||
- 설명, 정보가 부실한 작품이 나올 수도 있다. | ||
- 퍼블릭 도메인이 아니라면 이미지를 제공하지 못할수도 있다. 즉, 유명한 작품이어도 이미지가 나오지 않는 사진이 있다!(isPublicDomain,hasImages 속성으로 필터링 가능) | ||
- The API (RESTful web service in JSON format) gives access to all of The Met’s Open Access data and to corresponding high resolution images (JPEG format) that are in the public domain.(https://www.metmuseum.org/art/collection/search/437133) | ||
|
||
#### **api의 추가 문제점** | ||
|
||
- query string과 다른 항목 하나 조합만 허용하고, 조건 2개이상의 검색을 허용하지 않는다. | ||
|
||
#### **대안** | ||
|
||
- 랜덤함수를 통해 404 뜨면 재탐색해서 불러오는 방식으로 처리한다. -> 그렇게 되면 오늘의 작품이라기보단 사이트에 접속할 때마다 결과가 달라진다. | ||
- 날짜별로 적절한 object id를 필터링해두고 curation하는 방식으로 변경한다. -> 노가다이긴 하지만 괜찮은 미술작품을 필터링할 수 있다. | ||
|
||
#### **장기 대안** | ||
|
||
- DB에 valid artwork의 집합을 만들어두고 그 안에서 랜덤성을 가지게 하기 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,3 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
import "./App.css"; | ||
import { QueryClient, QueryClientProvider } from "react-query"; | ||
import { ReactQueryDevtools } from "react-query/devtools"; | ||
import NavigationBar from "./component/NavigationBar"; | ||
import Artwork from "./component/Artwork"; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<QueryClientProvider client={queryClient}> | ||
<NavigationBar /> | ||
<Artwork /> | ||
{/* <ReactQueryDevtools initialIsOpen={false} /> */} | ||
</QueryClientProvider> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
Oops, something went wrong.
2922572
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.
Successfully deployed to the following URLs:
artworks – ./
artworks-git-main-tinajeong.vercel.app
artworks-tau.vercel.app
artworks-tinajeong.vercel.app