---
# System prepended metadata

title: 2024 Backend Server 專案交接
tags: [Handover]

---

# 2024 Backend Server 專案交接
[TOC]

## How to build
- [How to build backend server](https://drive.google.com/file/d/1IJJvs-ak5J4sa8z-1xqh-mxWu7uMyhqj/view?usp=drive_link)

## How to package
- [如何發版SDK](https://drive.google.com/file/d/1afk18ozimdO-PksdhPvGj1qjX3ZoqwPC/view?usp=drive_link)
## How to use and first example
- [如何定義一個API](https://drive.google.com/file/d/1Uj3VyFjqCnuZLSJfL_I3QniUzysS5IHS/view?usp=drive_link)

## File Structure

├─📁 backend :arrow_left: 開發後端 api 的資料夾
│ ├─📁 config :arrow_left: 存放 env variables, ex: 資料庫連線相關的變數、attachment 檔案上傳設定等
│ ├─📁 src :arrow_left: 後端專案進入點資料夾
│ ├─├─📁 \_test\_ :arrow_left: 存放單元測試的資料
│ ├─├─📁 common :arrow_left: 存放一些 common function，偏向存放一些特殊定義或是專案設定，ex: nestjs decorators, nestjs guards, dtos, interface, etc...
│ ├─├─📁 declares :arrow_left: 定義 typescript declares
│ ├─├─📁 models :arrow_left: 與 repository 定義的 function 溝通，調用順序為 module ⭢ controller ⭢ service ⭢ repositry module ⭢ repository ⭢ schema
│ ├─├─📁 repository :arrow_left: 定義與 mongodb 溝通的 funtion
│ ├─├─📁 swagger-ui :arrow_left: 客製化 swagger ui style 的地方
│ └──-📁 utils :arrow_left: 存放一些 common function，偏向是存放演算法的地方
│ ├───📄 app.module.ts :arrow_left: 包裝 api 的 module，為 nestjs 特有的定義方式
│ ├───📄 app.service.ts :arrow_left: 讀取 api server 的啟動方式 (env.NODE_ENV)
│ ├───📄 main.ts :arrow_left: 程式進入點
│ └─📄 generator .sh :arrow_left: 用以生成 testing data 的腳本
├─📁 commonpackage :arrow_left: 開發前端與後端溝通的 sdk 資料夾
│ ├─📁 src :arrow_left: SDK 專案進入點資料夾
│ └──📁 api :arrow_left: 存放 API 溝通的變數

## Background Reference
- nestjs
    - [nestjs](https://docs.nestjs.com/)
    - [mongodb](https://docs.nestjs.com/techniques/mongodb)
    - [validation](https://docs.nestjs.com/techniques/validation)
    - [實用的初心者上手教學文](https://ithelp.ithome.com.tw/users/20119338/ironman/3880?page=1): 跑完之後應該就學會 nestjs 了👍
- express
    - [express](https://developer.mozilla.org/zh-TW/docs/Learn/Server-side/Express_Nodejs/Introduction)
- multer
    - [multer](https://www.npmjs.com/package/multer)
    - [教學文](https://medium.com/%E9%BA%A5%E5%85%8B%E7%9A%84%E5%8D%8A%E8%B7%AF%E5%87%BA%E5%AE%B6%E7%AD%86%E8%A8%98/%E7%AD%86%E8%A8%98-%E4%BD%BF%E7%94%A8-multer-%E5%AF%A6%E4%BD%9C%E5%A4%A7%E9%A0%AD%E8%B2%BC%E4%B8%8A%E5%82%B3-ee5bf1683113)
- rxjs
    - [observer](https://rxjs.dev/guide/observer)
- simple-git
    - [simple-git](https://www.npmjs.com/package/simple-git)
    - [demo](https://juejin.cn/post/7229906749070721085)

## Video & Document
- Message Box
    - [說明簡報](https://docs.google.com/presentation/d/1_3RveUSrLW9QXtAekWqbm6rf7-lSuhFDBF_NHtZD4gM/edit?usp=sharing)
    - [Messabe Box how1](https://drive.google.com/file/d/1AamSZVrbehDSQgXQKbpTZURKTFPex4XA/view?usp=drive_link)
    - [Messabe Box how2](https://drive.google.com/file/d/1AkD2XvTJEv55eVCmsi1WBF3v79Skmnaz/view?usp=drive_link)
    - [Messabe Box how3](https://drive.google.com/file/d/1upZIHNE08iBFvrAg4iaqsABeDQLOJZEP/view?usp=drive_link)
    - [Message Box UI/UX 優化](https://drive.google.com/file/d/1j_WXM7nobozay7Oka2-khk_Fj43Qrzmn/view?usp=drive_link)
    :::spoiler 相關 MR 資料
    - [後端實作](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/292)
    - [前端實作](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/293)
    - [Update the data structure of message page](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/311)
    - [Refactor UI/UX for Message box label](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/312)

- Submodule
    - [Submodule How1](https://drive.google.com/file/d/1o9kBaD2bZbr6ksLZQgOkebdUb0Sc5oCn/view?usp=drive_link)
    - [Submodule How2](https://drive.google.com/file/d/1FEjPVaSp9wcRnhnFLIwPXvuZvggYzkRx/view?usp=drive_link)
    - [Submodule How3](https://drive.google.com/file/d/1JX8g0Raz--jcfaHPAqXZHMmennewBy3F/view?usp=drive_link)
    - [Submodule How4](https://drive.google.com/file/d/1MxDgl0Gx5CuZUWM6RWcbHVQQRVUg5LQG/view?usp=drive_link)
    - [submodule_程式碼_how](https://drive.google.com/file/d/1aPwpuY0cQq9fMT9rg-PepaESI-b5TMjQ/view?usp=drive_link)
    :::spoiler 相關 MR 資料
    - [MR: Implement submodule APIs](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/262)

- Project Permission
    :::spoiler 相關 MR 資料
    - [MR: Implement api guard for the permission](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/137/diffs)

- File Path
    :::spoiler 相關 MR 資料
    - [MR: Add git diff for old file path issues](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/267)
- Trace-Doc Label
    :::spoiler 相關 MR 資料
    - [MR: Implement trace-doc label](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/230)

- 測試未覆蓋標籤相關應用
    :::spoiler 相關 MR 資料
    - [MR: 新增 Test Coverage 功能](http://140.115.59.165/geekynote/geekynote-web/-/merge_requests/301)

- backend video-label
    :::spoiler 相關 MR 資料
    - [實作與 Trace Case](http://140.115.59.165/geekynote/geekynote-web/uploads/832ffd50de80f1f303f9e02cafc70bc6/Backend_Why_Video.mp4)

## Future
- [後端欠缺的內容](https://hackmd.io/nn--TNqNRamXmICE_7Eubw?view)
- Message Box
    - UI/UX 的部分可以再優化，像是 panel 的部分可以拖動
    - 在看到程式碼變動的紀錄時，diff panel 也要可以顯示有哪些 Message Page 訊息（對應到版本的 Message Page）
    - Function Name 的判斷可以透過 Parser 的方式去抓，會比現在用 Regex 的方式好

## 文件建立準則
[110屆文件建立準則](https://docs.google.com/spreadsheets/d/19rPhpi012UmkJzs9Ez_JN_56sYSJBFVm/edit?gid=1228133264#gid=1228133264)
[111屆文件建立準則](https://docs.google.com/spreadsheets/d/19rPhpi012UmkJzs9Ez_JN_56sYSJBFVm/edit?gid=1477701032#gid=1477701032)
