Focusing ๐ฏ on life, so will be a bit slow for a couple of weeks
seokjeon / subtube Goto Github PK
View Code? Open in Web Editor NEWmadcamp week3 project
madcamp week3 project
๊ณ ๊ฐ์ ๋ง์ดํ์ด์ง์์ ์์ ์ด ๋ฒ์ญํ ๋ฌธ์ฅ ๋ธ๋ก๋ค๊ณผ ๋ชจ์ ๋ด์ฌ์๊ฐ์ ํ์ธํ ์ ์๋ค.
๊ณ ๊ฐ์ ์ต์ ์ ๋ฒ์ญ์ ์ ํํ๊ธฐ ์ํด ๋ง์์ ๋๋ ๋ฒ์ญ์ ์ ํํ์ฌ ์ถ์ฒํ ์ ์๋ค.
duration , start time period ๋น๊ตํด์ ๋ ์์ ๊ฐ์ db์ ์ ์ฅ
๊ณ ๊ฐ์ ๋ฒ์ญํ๊ณ ์ ํ๋ ์์์ ์ ํํ๊ธฐ ์ํด url์ ์ ๋ ฅ ํ ์ ์๋ค.
์๋น์ค ์ ๊ณต์๋ ๊ณ ๊ฐ์ด ๋ด์ฉ ์ฐธ๊ณ ๋ฐ ํฌํ๋ฅผ ํ ์ ์๊ฒ, ๋ฌธ์ฅ ๋ธ๋ก๋ค์ ๋ํ ๋ค๋ฅธ ์ฌ๋๋ค์ ๋ฒ์ญ ์ ๋ณด(์์ด ์๋ฌธ๊ณผ, ๋ฒ์ญ๋ฌธ, ์ถ์ฒ ์)๋ฅผ ์ถ๋ ฅํ ์ ์๋ค.
์ฒดํฌ ๋ฒํผ์ ๋๋ฌ ์์ ์ฌํญ์ ๋ฐ์ํ ์ ์๋ค.
๊ณ ๊ฐ์ ๋ฌธ์ฅ์ ๋ฌธ๋งฅ์ ํ์ธํ๊ธฐ ์ํด, ๋ฌธ์ฅ ๋ธ๋ก์ ์, ์๋ ๋ฐฉํฅํค๋ก์ ํ์ํ ์ ์๋ค.
์์ ์ด ๋ฒ์ญํ ๋ฌธ์ฅ ๋ธ๋ก์ ํด๋ฆญ ํ ์ ํด๋น ์์ ํ์ด์ง์ ํด๋น ๋ฌธ์ฅ์ผ๋ก ์ด๋ํ๋ค.
๊ณ ๊ฐ์ ํ ๋ฌธ์ฅ์ฉ ๋ฒ์ญ์ ์งํํ ์ ์๋ค.
์๋น์ค ์ ๊ณต์๋ ์๊ฐ ๋ณ ํ ์คํธ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถ ๋ฐ ์ ์ ํ๊ธฐ ์ํด url ์ ์์์ ์์ฑ ์ธ์ ํ ์ ์๋ค.
๋ฐ์ดํฐ ๋ฐ์ธ๋ฉ ๋ก์ง with react
D๊ณ ๊ฐ์ ์์ ์ ์๋ง์ ์ญ์ ํ๊ธฐ ์ํด, ์์ ์ ๋ฒ์ญ ๋ฌธ์ฅ ๋ธ๋ก์์ X ๋ฒํผ์ ํด๋ฆญํ ์ ์๋ค.
DB์ vote model + ์ ์ฅ ๋ก์ง + routing + ๋ฒํผ ์ด๋ฒคํธ ๋ฆฌ์ค๋
๋ฆฌ์คํธ ํด๋ฆญ ์ timeout์ด ๋๋๊ธฐ ์ ์ ๋ค๋ฅธ ๋ธ๋ก์ ํด๋ฆญํ๋ฉด
์ด์ ์ call ํ๋ timeout๋๋ฌธ์ ์ผ์ฐ ์ ์ง๊ฐ ๋จ.
์ ์ญ๋ณ์๋ก timeout์ ๋ถ๋ฅธ ํ์ cleartimeout์ ํ๊ฑฐ๋
state๋ก timeout์ ์ค์ ํด์ setstate๋ฅผ ํด์ผ ํ ๋ฏ -> ๊ทผ๋ฐ ์ด๊ฑฐ๋ ๋น๋๊ธฐ ๋๋ฌธ์ ์ข ๊ผฌ์ผ๋ฏ?
์ ํ๋ธ url ์ ๋ ฅ ํผ ์์ฑ
์ ์ฅ๋ ์ต์ ์ (votes์๊ฐ ์ ์ผ ๋์ ) ์๋ง export
๊ณ ๊ฐ์ ์๋ง ๋ฒ์ญ์ ํ ๋, ํน์ ๋ฌธ์ฅ ๋ธ๋ก์ ์ ํํ์ฌ, ์๋์์ฑ๋ ์์ด ํ ์คํธ์, ์์ ๋ง์ ๋ฒ์ญ์ ์ฌ๋ฆด ์ ์๋ค.
์ฐํ๋ฒํผ ํด๋ฆญ ์ ์ด๋ฒคํธ ์ฒ๋ฆฌ(state ๋ณ๊ฒฝ โ ํผ ์์ฑ ์์ ) + ๊ธฐ์กด ๋ฐ์ดํฐ ๋ฐ์ธ๋ฉ
๊ณ ๊ฐ์ ๋ฌธ์ฅ์ ๋ฌธ๋งฅ์ ํ์ธํ๊ธฐ ์ํด, ๋ฌธ์ฅ ๋ธ๋ก์ ํ์ฑํ ํ์ฌ ์ ํ๋ ๋ฌธ์ฅ ๊ตฌ๊ฐ์ ์์์ผ๋ก ํ์ธํ ์ ์๋ค.
๊ณ ๊ฐ์ export ๋ฒํผ์ ๋๋ฌ, ํ์ฌ ์ต์ ์ ๋ฒ์ญ ๋ฐ์ดํฐ๋ฅผ ๋ชจ์ ์๋ง ํ์ผ๋ก ๋ณํํ์ฌ ๋ค์ด๋ก๋ ํ ์ ์๋ค.
์ ์ ๋ ๋ง์ดํ์ด์ง์์ ๋ฒ์ญํ ๋ฌธ์ฅ ๋ธ๋ก๋ค์ ํ์ธํ ์ ์๋ค.
๋ค๋น๊ฒ์ด์ ๋ฐ์ ๋๋ฏธ๋ฐ์ดํฐ๋ก ๋ด์ฌ์๊ฐ ํ์ธ, ํ๋ ๊น์ ์ ์ ์ด๋ฆ๋ ๋๋ฏธ ๋ฐ์ดํฐ๋ก?
์ ์ ๋ ๋ฒ์ญ์ ๋ณด์์ผ๋ก ๋ด์ฌ ์๊ฐ์ ๋ฐ์ ์ ์๋ค.
X ๋ฒํผ์ ๋๋ฌ ์์ ์ฌํญ์ ์ทจ์ํ ์ ์๋ค.
๋ฆฌ์กํธ ๊ณต๋ถ
๊ณ ๊ฐ์ ์ ์ฒด ์์์ ํ์ธํ๊ธฐ ์ํด, ๊ธฐ๋ณธ์ ์ธ ์์ ์ ์ด๋ฅผ ํ ์ ์๋ค.
๋๋น ์คํค๋ง
์ ์
- ์ด๋ฆ
- ์ด ๋ด์ฌ ๊ธฐ๊ฐ
- ๋ด ๋ฒ์ญ ids
๋์์
- url
- ๋ฌธ์ฅ ๋ธ๋ก๋ค ids
- contributor๋ค ids // user ids
==================================
(optional)
- ์ธ๋ค์ผ ์ด๋ฏธ์ง // ๊ด๋ จ api ์ฌ์ฉ์ด ํธํ๋ค๋ฉด.
๋ฌธ์ฅ ๋ธ๋ก
- ํด๋นํ๋ ๋์์ id
- raw eng
- start_timing
- duration
- num_of_translation
- num_of_most_votes
๋ฒ์ญ๋ค
- translator // user id
- ํด๋นํ๋ ๋ฌธ์ฅ ๋ธ๋ก ids
- is_modified
- modified_eng
- translatd_kor
- num_of_votes
์ถ์ฒ
- ์ถ์ฒํ ๋ฒ์ญ ids
- voter // user
์ ์ ๊ฐ ๋ฒ์ญ์ ๋ํ ๋ณด์๊ณผ ์์ ์ ์ ๋ณด๋ฅผ ํ์ธํ ์ ์๋ค.
U๊ณ ๊ฐ์ ์์ ์ ์๋ง์ ์์ ํ๊ธฐ ์ํด, ์์ ์ ๋ฒ์ญ ๋ฌธ์ฅ ๋ธ๋ก์์ ์ฐํ ๋ฒํผ์ ํด๋ฆญํ ์ ์๋ค.
์๋น์ค ์ ๊ณต์๋ ๊ณ ๊ฐ์ด ์์ ์ด ๋ฒ์ญํ ๋ฌธ์ฅ์ ํ์ธํ ์ ์๊ฒ ํ๊ธฐ ์ํด ๋ณ๊ฒฝ์ฌํญ ์ ์ฅ ํ ๋ค๋ฅธ ์ฌ๋๋ค์ ๋ฒ์ญ ๋ฆฌ์คํธ ๋ทฐ์ ํด๋น ๋ด์ฉ์ ์ถ๋ ฅํ ์ ์๋ค.
YouTube url์ home์์ ์ ๋ ฅํ์ ๋, ๋ฐฑ์๋์์ ์ ๋ณด๋ฅผ ๋ฐ์ ์ด๋ฏธ DB์ ์กด์ฌํ๋ YouTube ์์์ธ์ง ํ๋ณํ๊ณ , ์ด๋ฏธ ์กด์ฌํ ๊ฒฝ์ฐ DB์์, ์กด์ฌํ์ง ์์ ๊ฒฝ์ฐ api ์๋ฒ์์ ์ ๋ณด๋ฅผ ๋ฐ์ ๋๊ฒจ์ค๋ค.
api ์๋ฒ์์ ์ ๋ณด๋ฅผ ๋ฐ์์์ ๊ฒฝ์ฐ ์๋กญ๊ฒ ๋ง๋ค์ด์ง Video์ Transcript ์ ๋ณด๋ฅผ ๋ง๋ค์ด์ DB์ ์ ์ฅํ๋๋ก ํ๋ค.
url์ ๋๊ฒจ๋ฐ์ ๊ฒฝ์ฐ, ์์์ parsing ํด์ video์ id (v="***") ๋ฅผ ์ฐพ์์ฌ ์ ์๋๋ก ํ๋ค.
React๊ฐ ๋๊ฒจ๋ฐ์ ์ ๋ณด๋ฅผ render์ ๋ฟ๋ ค์ค ์ ์๋๋ก ํ๋ค.
Translate ๋ฒํผ ๋์ ํฌ๊ธฐ ์กฐ์
์๋ฒ ์ฝ๋์ ํด๋ผ์ด์ธํธ ์ธก ์ฝ๋๋ฅผ ํตํฉํ๋ค.
์๋น์ค ์ ๊ณต์๋ ๊ณ ๊ฐ์ด ๋ฒ์ญํ ๋ฌธ์ฅ์ ์ ํํ ์ ์๊ฒ, ๋ฆฌ์คํธ ๋ทฐ์์ ๋ฌธ์ฅ ๋ธ๋ก์ ๊ดํ ๋ค์ํ ์ ๋ณด(์๊ฐ, ๋ฒ์ญ ์, ์ต๋ค ์ถ์ฒ ์)๋ฅผ ์ถ๋ ฅํ ์ ์๋ค.
์ค๋ฅธ์ชฝ์ ๋ฆฌ์คํธ๋ทฐ item ์ถ๊ฐ, ๋ฐ์ดํฐ ๋ฐ์ธ๋ฉ
์ฒซ ๋ฒ์งธ ํ์ด์ง url ์ ํ๊ธฐ
์ ํ๋ธ url ์ ๋ ฅ ํ, ๊ฒ์ ๋ฒํผ์ ๋๋ฅด๋ฉด, ํด๋น url์ด ์๋ฒ์ ์ ์ ์ก๋๋์ง ํ์ธ
์๋ฒ์ url์ด ์ ๋์ฐฉํ ์ดํ, ํ์ด์ง ๋ฆฌ๋ค์ด๋ ์ ๊ธฐ๋ฅ ๊ตฌํ
๊ณ ๊ฐ์ ๋ฒ์ญ์ ์ํ๋ ์์์ ์ ํ ํ ์ ์๋ค.
์ ํํ ์๋ง ๋ธ๋ก์ ๋ฐ๋ณต์ฌ์ํ๋ค
๊ณ ๊ฐ์ ์ํ๋ ๋ธ๋ก์ ์์์ ์ฌ์ํ๊ธฐ ์ํด, ์ํฐ ํค๋ก ์์ ์ฌ์์ ์ ์ดํ ์ ์๋ค.
๊ณ ๊ฐ์ ํ๋ก๊ทธ๋จ์ด ์๋์ผ๋ก ์์ฑํ ์์ด ๋ฌธ์ฅ์ ์์ ํ ์ ์๋ค.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.