https://github.com/ssi02014/youtube
https://github.com/ssi02014/youtube
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ssi02014/youtube
- Owner: ssi02014
- Created: 2021-01-26T19:27:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-13T16:05:41.000Z (almost 4 years ago)
- Last Synced: 2024-12-30T06:44:37.301Z (10 months ago)
- Language: JavaScript
- Size: 49.4 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ป Youtube App
### node.js์ react๋ก ๋ง๋ Youtube App
## ๐ฅ MainPage View

## ๐ YouTube App์ ์ฌ์ฉํ๊ธฐ ์ ํ๋ ์์น
1. **" npm install or yarn install "** ์ backend ํด๋์์ ์
๋ ฅํด์ฃผ์ธ์. (๋ฐฑ์๋ ์ข
์์ฑ ๋ค์ด๋ฐ๊ธฐ)
2. **" npm install or yarn install "** ์ client ํด๋์์ ์
๋ ฅํด์ฃผ์ธ์. (ํ๋ก ํธ์๋ ์ข
์์ฑ ๋ค์ด๋ฐ๊ธฐ)
3. backend ํด๋์์ **" npm start or yarn start "** ๋ฅผ ํตํด server๋ฅผ ์คํ์์ผ์ฃผ์ธ์.
4. client ํด๋์์ **" npm start or yarn start "** ๋ฅผ ํตํด client๋ฅผ ์คํ์์ผ์ฃผ์ธ์.
### โโ ๋ณธ ํ๋ก์ ํธ๋ ๊ธฐ์กด์ ๋ง๋ Boiler-Plater์ ์๋ฒ์ ๊ณต์ ๋๊ณ ์์ต๋๋ค.
- Boiler-Plater: https://github.com/ssi02014/BoilerPlate
## ๐จ๐ปโ๐ป Youtube App ๊ธฐ๋ฅ
1. **Boiler-Plate: Login, Register, Logout**
2. **Home Page**
- ์ ์ ๊ฐ ์
๋ก๋ํ Video๋ค ๋์ด
3. **Video Upload**
- ์๋ฒ์ ๋น๋์ค ์ ์ฅ
- ์๋ฒ์ ๋น๋์ค ์ธ๋ค์ผ ์ ์ฅ
4. **Video Detail Page**
- ์
๋ก๋ ๋ ๋น๋์ค ์์ฒญ
- ์ฌ์ด๋์ ๋น๋์ค Section
5. **User Subscribe**
- ๊ตฌ๋
ํ์ด์ง์์๋ ๊ตฌ๋
ํ ํ์์ Video๋ง ๋์ค๊ฒ ํ๊ธฐ
6. **Comment**
- ๋๋๊ธ ๊ธฐ๋ฅ
7. **Like, Dislike ๊ธฐ๋ฅ**
- Video์ like, dislike
- comment์ like, dislike
## ๐ Server ์ถ๊ฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
1. multer: ๋
ธ๋ ์๋ฒ์ ํ์ผ์ ์ ์ฅํ๊ธฐ ์ํ Dependency
2. fluet-ffmpeg: thumbnail ์์ฑ์ ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
- fluet-ffmpeg๋ฅผ ์ค์นํ๊ธฐ ์ ์ ffmpeg๋ฅผ ์ค์นํด์ผ๋จ
- **ffmpeg ์๋์ฐ ์ค์น ์ฐธ๊ณ ** : https://blog.naver.com/chandong83/222095346417
## ๐ Client ์ถ๊ฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
1. react-dropzone: video uploadํ ๋ ์ฌ์ฉ (VideoUploadComponent)
2. antd ๋ผ์ด๋ธ๋ฌ๋ฆฌ: ๋์์ธ์ ํธ๋ฆฌํ๊ฒ ํ๊ธฐ ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
3. multer: ๋
ธ๋ ์๋ฒ์ ํ์ผ์ ์ ์ฅํ๊ธฐ ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
## ๐ Server) static ํ์ผ๋ค์ ์ฒ๋ฆฌํ๊ธฐ ์ํ ์ถ๊ฐ ์์ค ์ฝ๋
### static ํ ํ์ผ: ์ด๋ฏธ์ง, css, javacript ํ์ผ ๋ฑ
```javascript
{
//index.js์ ์ถ๊ฐํ๊ธฐ
app.use('/uploads', express.static('uploads'));
}
```
## ๐ Client) Antd 4.0 ๋ถํฐ Icon ์ฌ์ฉ ๋ฐฉ๋ฒ ๋ณ๊ฒฝ
```javascript
//3.0 ๊ธฐ์กด
import { Icon } from 'antd';
//4.0 ๋ณ๊ฒฝ
import { PlusOutlined, LikeOutlined, DislikeOutlined } from '@ant-design/icons';
```
## ๐ Client) Input ํ๊ทธ์๋ค ๊ฐ์ ์
๋ ฅํ๊ธฐ ์ํ ๋ฐฉ๋ฒ(์์)
### 1. useState ์ ์
```javascript
const [videoTitle, setVideoTitle] = useState('');
const [videoDescription, setVideoDescription] = useState('');
```
### 2. ํจ์ ์ ์
```javascript
const onTitleChange = e => {
setVideoTitle(e.currentTarget.value);
}
const onDescriptionChange = e => {
setVideoDescription(e.currentTarget.value);
}
```
### 3. ํ๊ทธ์ onChange ์์ฑ์๋ค ์ ์ํ ํจ์ ๋ฃ๊ธฐ
```javascript
```
## ๐ Client) router์ match ๊ฐ์ฒด
### match ๊ฐ์ฒด๋ฅผ ๋ฐ์์ค๋ ค๋ฉด ๊ผญ! withRouter๋ฅผ import ํด์ผํจ
```javascript
import { withRouter } from 'react-router-dom';
const VideoUpladComponent = () => {
return (
//์์ค์ฝ๋
);
}
//์ฝ๋ ๋ง์ง๋ง์ withRouter์์๋ค exportํ ์ปดํฌ๋ํธ ์ถ๊ฐํ๊ธฐ
export default withRouter(VideoUploadComponent);
```