Skip to content

Latest commit

Β 

History

History
117 lines (104 loc) Β· 6.25 KB

README.md

File metadata and controls

117 lines (104 loc) Β· 6.25 KB

chair-server

μ˜μžμ†Œν†΅ API μ„œλ²„μž…λ‹ˆλ‹€.

ν¬μŠ€ν„°

μˆ˜ν–‰ λͺ©μ 

ν˜„λŒ€μΈλ“€μ˜ 잘λͺ»λœ μžμ„Έκ°€ μŠ΅κ΄€μ΄ λ˜λ²„λ¦¬κ³  μ–΄λ–€ μžμ„Έλ₯Ό μ·¨ν•˜κ³  μžˆλŠ”μ§€ 잘 λͺ¨λ¦…λ‹ˆλ‹€.
μ˜μžμ†Œν†΅μ€ 이λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•˜μ—¬ λ‚˜μœ μžμ„Έλ‘œ μ•‰λŠ” μŠ΅κ΄€μ„ λ°”λ‘œμž‘κ³  μ˜¬λ°”λ₯΄κ²Œ 의자λ₯Ό μ΄μš©ν•˜λ„λ‘ λ§Œλ“€μ–΄ μ‘ŒμŠ΅λ‹ˆλ‹€.

Reference

  • 순천ν–₯λŒ€ IT의료 곡학과
    • μ••λ ₯μ„Όμ„œλ₯Ό μ΄μš©ν•œ μ‹€μ‹œκ°„ 앉은 μžμ„Έ λͺ¨λ‹ˆν„°λ§ μ‹œμŠ€ν…œ
  • Eλ‚˜λΌν‘œμ€€μΈμ¦
    • ν‘œμ€€λ²ˆν˜Έ KS A ISO 7250-1
  • μ„ΈλΈŒλž€μŠ€λ³‘μ›
  • λŒ€κ΅¬ μž¬ν™œμš΄λ™μ„Όν„°
  • μ‹œμ—˜μ²™μΆ”λ³‘μ›
  • cm병원 κ΄€μ ˆμ „λ¬Έλ³‘μ›

μ£Όμš” κΈ°λŠ₯

  • μ‹€μ‹œκ°„ 앉은 μžμ„Έ λͺ¨λ‹ˆν„°λ§
  • μ‚¬μš©μžμ˜ μžμ„Έ 데이터에 λŒ€ν•œ 톡계 정보 μ‹œκ°ν™”
  • μžμ„Έ 정보 제곡 (병원 μ°Έκ³ )

μ‚¬μš© 기술

  • TypeScript
  • Node.js, ExpressJS
  • Sequelize, Nodemailer
  • MariaDB
  • AWS ec2, GCP
  • Notion, JANDI

ν”„λ‘œμ νŠΈ ꡬ쑰

src
β”œβ”€β”€ app.ts                 # App entry point
β”œβ”€β”€ api                    # Express route controllers for all the endpoints of the app 
β”‚   β”œβ”€β”€ middlewares            # Express middlewares
β”‚   └── routes                 # Endpoints
β”œβ”€β”€ config                 # Environment variables and configuration related stuff
β”œβ”€β”€ interface              # Applying Open-Closed Principle (OCP)
β”œβ”€β”€ loaders                # Split the startup process into modules
β”œβ”€β”€ models                 # Database models
β”œβ”€β”€ services               # All the business logic is here
β”œβ”€β”€ subscribers            # # Event handlers for async task
β”œβ”€β”€ types                  # Type declaration files (d.ts) for Typescript
β”‚   └── express                #  express.d.ts
└── views                  # Simple html files

DB

μ‚¬μš©μž

속성 νƒ€μž… μ„€λͺ…
p0 int λ°”λ₯Έ μžμ„Έ
p1 int μˆ™μΈ μžμ„Έ
p2 int λ‘”λΆ€ μ•ž μžμ„Έ
p3 int μ™Όμͺ½μœΌλ‘œ κΈ°μšΈμ–΄μ§„ μžμ„Έ
p4 int 였λ₯Έμͺ½μœΌλ‘œ κΈ°μšΈμ–΄μ§„ μžμ„Έ
p5 int κ±Έν„° 앉은 μžμ„Έ
nonp int κ·Έ μ™Έ
user_id int μ‚¬μš©μž pk

μžμ„Έ

속성 νƒ€μž… μ„€λͺ…
email varchar μ‚¬μš©μž 이메일
name varchar μ‚¬μš©μž 이름
password varchar λΉ„λ°€λ²ˆν˜Έ

API

  • λ°˜ν™˜ 객체(JSON)
  • Content-Type : 'application/json'
  • Content-Type : 'application/x-www-form-urlencoded'
  • λ‚ μ§œ 포멧 : YYYY-MM-DD hh:mm:ss
  • statusCode
    • 200 : 성곡
    • 400 : μš”μ²­ 처리 μ‹€νŒ¨
    • 403 : κΆŒν•œ μ—†μŒ (토큰이 μœ νš¨ν•˜μ§€ μ•Šμ„ λ•Œ)
    • 404 : μ—†λŠ” λ¦¬μ†ŒμŠ€ (μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” λ°μ΄ν„°λ‚˜ 경둜)
    • 409 : 데이터 쀑볡 (κ°€μž… μ‹œ 이메일 쀑볡일 λ•Œ)
    • 500 : μ„œλ²„ μ—λŸ¬ (λ‚΄κ°€ μž‘μ„ 수 μ—†λ˜ μ—λŸ¬)
  • 응닡
    /*
    * @this response.body
    * @description successκ°€ false일 λ•Œ 메세지 확인
    * @attributes { success, message, user, statistics, error }
    */
    {
    	"success": boolean,
    	"message": string,
    	"user"? : User
    	"error"? : { "message": string } // μ—†λŠ” 경둜둜 λ“€μ–΄μ˜¬ λ•Œ μ—λŸ¬λ§Œ 찍힘
    }
κΈ°λŠ₯ λ©”μ„œλ“œ URI μš”μ²­ 헀더 μš”μ²­ λ°”λ”” 응닡 헀더, λ°”λ””
둜그인 post api/users/login email, password header:token, message, success
첫 둜그인 체크 put api/users/login/check token check message, success
νšŒμ›κ°€μž… post api/users/signup email, name, password message, success
계정 정보 보기 get api/users/account token message, success, user
이메일 μˆ˜μ • put api/users/account/emailmodify token newEmail message, success
λΉ„λ°€λ²ˆν˜Έ μˆ˜μ • put api/users/account/passwordmodify token newPassword, password message, success
λΉ„λ°€λ²ˆν˜Έ μ°ΎκΈ° post api/users/find/password email, name message, success
νšŒμ›νƒˆν‡΄ delete api/users/withdrawal token password message, success
μžμ„Έ 데이터 μ €μž₯ post api/postures/save token postures message, success
일간 톡계 get api/statistic/date query:date, token message, statistics, success, time
μ›”κ°„ 톡계 get api/statistic/month query:date, token message, statistics, success, time
총 톡계 get api/statistic/all token message, statistics, success, time
총 톡계 비ꡐ get api/statistic/all/comparison token message, statistics, success
μžμ„Έ μΆ”μΈ‘ post api/postures/inference token posture inference, message, success