1, apt-get install php7.0-curl
apt-get install php7.0-zip
sudo apt-get install php7.0-gmp
    apt install ffmpeg
    apt install nasm
    apt install libfdk-aac-dev
    apt install libmp3lame-dev
    apt-get install libass-dev
    apt-get install opus-dev
    apt-get install libopus-dev
    apt-get install librtmp-dev
    apt-get install libtheora-dev
    apt-get install libvorbis-dev
    apt-get install libvpx-dev
    apt-get install libx265-dev
    apt-get install libx264-dev
    git clone --depth 1 git://source.ffmpeg.org/ffmpeg
    cd ffmpeg
    ./configure   --enable-gpl   --enable-libass   --enable-libfdk-aac   --enable-libfreetype   --enable-libmp3lame   --enable-librtmp   --enable-libopus   --enable-libtheora   --enable-libvorbis   --enable-libvpx   --enable-libx264   --enable-libx265   --enable-nonfree
    pkg-config
    make -j5 install
    check ffmpeg

2, install node server
    apt install npm
    npm install express -g
    apt install redis-server

    /etc/redis/redis.conf
    bind 127.0.0.1
    Change the line above with
    bind 0.0.0.0
    service redis-server restart

    npm i -g pm2
    pm2 start /var/www/html/sns-line/node_serve/server.js
    pm2 startup ubuntu
    pm2 save

3, instal java service
    update-rc.d snsline enable
    update-rc.d snsline defaults
    sudo systemctl daemon-reload
    service snsline restart
    reboot
    
apt install php7.1-bcmath    

4, install nvm
    curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh -o install_nvm.sh
    bash install_nvm.sh

5. add & lme-ui component project:
# LME UI - Laravel Integration Guide

## Step 1: Add submodule into laravel project

## trên máy developer
1. add vào project lần đầu, chỉ tiến hành 1 lần (tương tự như việc cài 1 thư viện mới lần đầu vào dự án vào trong file package.json, composer.json)
**Lưu ý**: chỉ 1 người làm trên project local:
- Thêm submodule vào project

```bash
git submodule add https://github.com/WTML-2023/lme-ui.git public/lme-ui
```
- Set nhánh submodule sẽ dùng: mở file .gitmodules và thêm dòng `branch = main`
Kết quả:

[submodule "public/lme-ui"]
	path = public/lme-ui
	url = https://github.com/WTML-2023/lme-ui.git
	branch = lgram-main

- commit và push config vừa rồi cho cả team dùng chung
```bash
git add public/lme-ui
git commit -m "add lme-ui submodule"
git push
```

2. lấy code mới version mới nhất từ lme-ui:  Khi lme-ui có fix bug, thêm tính năng ... cần update bản mới nhất về dự án:
- get code tương ứng với commit mới nhất( thường chỉ 1 người chạy), rồi push version mới nhất lên cho cả team
```bash
git submodule update --remote --recursive
git add public/lme-ui
git commit -m "update version lme-ui submodule"
git push
```

3. Các thành viên trong team pull code lme-ui về theo version đã được chọn ở bước 1 hoặc 2 (chỉ pull về ko thay đổi version)
- get module về lần đầu nếu chưa có
```bash
git submodule update --init --recursive
```

- update module đến version đang chọn ở mục 2
```bash
git submodule update
```

## Trên server
### add submodule trên server khi chưa có:
step 1: add ssh key của server vào account github
step 2: sửa url git submodule http thành ssh
 nano .gitmodules
 sửa url sang dùng ssh  `url = git@github.com:WTML-2023/lme-ui.git`

step 3:  chạy 2 lệnh 
```bash
git submodule sync
git submodule update --init --recursive
```

### update module đến version đang chọn
`git submodule update`

 Sau khi add submodule, paths sẽ là:

```
your-project/
├── public/
│   └── lme-ui/              ← submodule
│       ├── src/
│       │   ├── css/          → /lme-ui/src/css/button/button.css
│       │   └── js/           → /lme-ui/src/js/button/lme-button.js
│       ├── icons/            → /lme-ui/icons/icon-name.svg
│       ├── vendor/           → /lme-ui/vendor/vue.js
│       └── integration/
│           └── laravel/      → Blade partials
```