Skip to content

Latest commit

Β 

History

History
115 lines (84 loc) Β· 3.42 KB

File metadata and controls

115 lines (84 loc) Β· 3.42 KB

SHAP_STORY

πŸ“š 2021.07.10

  • XD κΈ°λ³Έ νŽ˜μ΄μ§€ 기획



  • front-end κΈ°λ³Έ ν™˜κ²½ setting - nvm으둜 node, yarn μ„€μΉ˜
    # nvm μ„€μΉ˜ ν›„
    
    # node μ•ˆμ •μ μΈ 버전 μ„€μΉ˜
    $ nvm install 12.18.4
    
    # μ•ˆμ •μ μΈ λ²„μ „μœΌλ‘œ λ°”κΎΈκΈ°
    $ nvm use 12.18.4
    
    # -g : 컴퓨터 전체에 μ„€μΉ˜
    $ npm install -g yarn
    
    $ yarn create react-app front_end



  • back-end κΈ°λ³Έ ν™˜κ²½ setting

    • Getting Start

      1. Node.js λ‹€μš΄
      2. npm install express-session --save

    • Running Server

      node app.js
      

    • DB table ꡬ성

      1. User(id(private key)(30), passwd(16), name, grade)

        • id -> μ‚¬μš©μž 아이디(PRIVATE KEY)
        • passwd -> μ‚¬μš©μž λΉ„λ°€λ²ˆν˜Έ (hash 단방ν–₯ μ‚¬μš©)
        • name -> 이름
        • grade -> ν•™λ…„(μ΄ˆλ“±ν•™μƒ κΈ°μ€€)
        • 이메일 선택 κΈ°λŠ₯ λ„£μ„μˆ˜λ„
      2. POST(head, type, body, user, show boolean, index autoindex(private key))

        • index -> κ²Œμ‹œλ¬Ό μˆœμ„œ(PRIVATE KEY) autoindex
        • head -> κΈ€ 제λͺ©
        • type -> κΈ€ λΆ„λ₯˜ ν•­λͺ©
        • body -> κΈ€ λ‚΄μš©
        • user -> μ‚¬μš©μž 아이디
        • show -> κ²Œμ‹œκΈ€ κ³΅κ°œμ—¬λΆ€(boolean)
      3. BaseClass(index autoindex(private key))

        • index -> μˆ˜μ—… 인덱슀(integer)(PRIVATE KEY) autoindex
      4. HardClass(index autoindex(private key))

        • index -> μˆ˜μ—… 인덱슀(integer)(PRIVATE KEY) autoindex
      5. lessonRate(id(private key), complete(), class_num integer, level

        • id -> μ‚¬μš©μž 아이디(PRIVATE KEY)
        • complete -> μ™„λ£Œ μ—¬λΆ€(boolean)
        • class_num -> μˆ˜μ—…μΈλ±μŠ€ (integer)
        • level -> base / hard

      νƒ€μž… ν‘œμ‹œν•˜μ§€ μ•Šμ€ 것은 text이닀.

πŸ“š 2021.07.17

  • front-end

    μ›Ή νŽ˜μ΄μ§€ λ””μžμΈμ„ ν™•μ •ν•˜κ³  ν”„λ‘œν† νƒ€μž…μ„ μ œμž‘ν•˜μ˜€λ‹€. μ›Ή νŽ˜μ΄μ§€λŠ” 메인, 둜그인, νšŒμ›κ°€μž…, ν•™μŠ΅ νƒ­, 질문 νƒ­, λ§ˆμ΄νŽ˜μ΄μ§€λ‘œ κ΅¬μ„±λœλ‹€. ν”„λ‘œν† νƒ€μž…μ€ μ•„λž˜μ™€ κ°™λ‹€.


    λ˜ν•œ React event Lister에 λŒ€ν•˜μ—¬ ν•™μŠ΅ν•˜κ³ , μΆ”κ°€ν•  κΈ°λŠ₯ 등을 λ…Όμ˜ν•˜μ˜€λ‹€.


    Event Listener ꡬ독 μˆœμ„œ

    a. Ref 작기(DOM에 μ ‘κ·Όν•˜κΈ° μœ„ν•˜μ—¬)
    b. Event μ •ν•˜κΈ°
    c. ν•¨μˆ˜ λ§Œλ“€κΈ°(ex. mouseover μ΄λ²€νŠΈκ°€ 일어났을 λ•Œ μ–΄λ–€ 행동을 ν•΄μ£Όκ² λ‹€λ₯Ό ν•¨μˆ˜λ‘œ ν‘œν˜„)
    d. componentDidMount()에 등둝
    e. μ»΄ν¬λ„ŒνŠΈκ°€ μ‚¬λΌμ‘Œμ„ λ•Œ ꡬ독 ν•΄μ œν•˜κΈ° μœ„ν•˜μ—¬ componentWillUnmount()μ—μ„œ 처리

    ```javascript
    // c. ν•¨μˆ˜ λ§Œλ“€κΈ° - hoverEvent ν•¨μˆ˜ 생성
    hoverEvent = (e) => {
            console.log(e);
            console.log(e.target);
    
            e.target.style.background = "#eee";
        }
    
    // d. componentDidMount()에 등둝
    componentDidMount() {
         this.div.current.addEventListener("mouseover", this.hoverEvent);
    }
    
    // e. componentWillUnmount()μ—μ„œ ꡬ독 ν•΄μ œ
    componentWillUnmount() {
         this.div.current.removeEventListener("mouseover", this.hoverEvent);
    }
    ```