-
Notifications
You must be signed in to change notification settings - Fork 0
API ๋ช ์ธ
minjungkim edited this page Nov 22, 2022
·
22 revisions
- json: ์นด๋ฉ์ผ์ด์ค ์ฌ์ฉ
POST /auth/login
- ๋ก๊ทธ์ธ ์์ฒญ
{
"userId": "myid",
"password": "p@ssw0rd"
}
- ๋ก๊ทธ์ธ ์ฑ๊ณต
{
"status": 200,
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"userId": "abcd1234",
"id": 3,
}
}
- ๋ก๊ทธ์ธ ์คํจ
{
"status": 401,
"error": {
"message": "Your login request has failed",
}
}
GET /auth/logout
- ๋ก๊ทธ์์ ์ฑ๊ณต
{
"status": 200
}
- ๋ก๊ทธ์์ ์คํจ
{
"status": 404
}
POST /user
- ํ์๊ฐ์ ์์ฒญ
{
"userId": "userId",
"password": "randowPW",
"pace": 390,
"zipCode": 01234,
}
- ํ์๊ฐ์ ์ฑ๊ณต์
{
"status": 201
}
- ํ์๊ฐ์ ์คํจ์
{
"status": 400
}
GET /check/user/:id
- ์ค๋ณต ๊ฒ์ฌ ์๋ต
{
"status": 200,
"exists": true/false
}
GET /auth/refresh
- ๊ฐฑ์ ์์ฒญ์
- HEADER
- Authorization: Bearer
- HEADER
- ๊ฐฑ์ ์ฑ๊ณต์
{
"status": 201,
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"userId": "abcd1234",
}
}
- ๊ฐฑ์ ์คํจ์
{
"status": 401,
"error": {
"message": "Invalid refresh token"
}
}
GET /recruit/:id
{
title: "๋ฌ๋ ค~๋ฌ๋ ค~",
startTime: 2022-11-11-20:20,
maxPpl: 5,
currentPpl: 3,
path: [{lat:123, lng: 123}, ... ],
pathLength: 33,
pace: 20,
hCode: "12345",
userId: "pushedrumex",
}
GET /course/:id
{
title: "~~ ์ฝ์ค์
๋๋ค.",
pathLength: 100,
hCode: "12345",
userId: "pushedrumex"
}
POST /recruit/join
HEADER : Authorization: Bearer
{
"recruitId": "1",
"userId": "34", // ๋ณ๊ฒฝ๋ ๋ถ๋ถ: ์ฌ์ฉ์ id -> DB์์์ id๊ฐ(PK)
}
- ์ฐธ๊ฐ ์์ฒญ ์ฑ๊ณต์
{
"status": 201,
"success": true/false
}
- ์ฐธ๊ฐ ์์ฒญ ์คํจ์ (์ฐธ๊ฐ์ ์ฒญ์ธ์ ๊ฝ์ฐฌ๊ฒฝ์ฐ & ๊ธ์ด ๊ฐ์๊ธฐ ์ญ์ ๋ ๊ฒฝ์ฐ)
{
"status": 409,
"error": {
"message": "Maximum cap reached" / "Deleted post"
}
}
POST /recruit
HEADER : Authorization: Bearer
{
"title": "์ ๋ชฉ์
๋๋ค",
"courseId": "40",
"startTime": "2022-11-15 09:00:00",
"maxPpl": 3,
"pace": 365,
"zipCode": 1234,
"authorId": "jagijasin"
}
- ๋ชจ์ง ๋ฑ๋ก ์ฑ๊ณต์
{
"status": 201,
"data": {
"recruitId": 210
}
}
- ๋ชจ์ง ๋ฑ๋ก ์คํจ์
{
"status": 500,
"error": {
"message": "Internal server error"
}
}
POST /course
HEADER : content-type multipart/form-data, Authorization: Bearer
{
"title": "์ ๋ชฉ",
"path": [{lat: 33, lng: 126},{lat: 33, lng: 126},{lat: 33, lng: 126},{lat: 33, lng: 126}],
"pathLength": 3800,
"userId": "abcd1234",
"img" : "data................."
}
- ์ฝ์ค ๋ฑ๋ก ์์ฒญ ์ฑ๊ณต์
{
"status": 201,
"data": {
"courseId": 234
}
}
- ์ฝ์ค ๋ฑ๋ก ์์ฒญ ์คํจ์
{
"status": 500,
"error": {
"message": "Internal server error"
}
}
GET /user/:userId/profile
Header : Authorization: Bearer
- ๋ด ์ ๋ณด ์กฐํ ์์ฒญ ์ฑ๊ณต์
{
"status": 200,
"data": {
"userId": "abcd1234",
"zipCode": 12354,
"pace": 380,
}
}
- ๋ด ์ ๋ณด ์กฐํ ์์ฒญ ์คํจ์
{
"status": 500,
"error": {
"message": "Internal server error"
}
}
PATCH /user/:userId/profile
Header : Authorization: Bearer
{
"pace"?: 365,
"zipCode"?: 12367
}
- ๋ด ์ ๋ณด ์์ ์์ฒญ ์ฑ๊ณต์
{
"status": 201
}
- ๋ด ์ ๋ณด ์์ ์์ฒญ ์คํจ์
{
"status": 500,
"error": {
"message": "Internal server error"
}
}
GET /user/:userId/recruit
Header : Authorization: Bearer
- ์ ์ ์ฐธ์ฌ ๋ชจ์ง๋ชฉ๋ก ์์ฒญ ์ฑ๊ณต์
{
"status": 200,
"data": {
"recruits": [
{
"title": "1๋ฒ ๋ชจ์ง๊ธ",
"recruitId": "1",
"courseId": "1",
"startTime": "2022-11-15 09:00:00",
"maxPpl": 3,
"pace": 365,
"zipCode": 12345,
"authorId": "jagijasin"
},
{
"title": "2๋ฒ ๋ชจ์ง๊ธ",
"recruitId": "2",
"courseId": "2",
"startTime": "2022-11-15 09:00:00",
"maxPpl": 3,
"pace": 365,
"zipCode": 12345,
"authorId": "jagijasin"
}, ...
]
}
}
- ์ ์ ์ฐธ์ฌ ๋ชจ์ง๋ชฉ๋ก ์์ฒญ ์คํจ์
{
"status": 500,
"error": {
"message": "Internal server error"
}
}
GET /user/:userId/course
Header : Authorization: Bearer
- ์ ์ ์ฝ์ค ๋ชฉ๋ก ์์ฒญ ์ฑ๊ณต์
{
"status": 200,
"data": {
courses: [
{
"title": "์ ๋ชฉ1",
"courseId": 1,
"path": [(1, 1), (2, 2), (3, 3)...],
"pathLength": 3800,
"userId": "abcd1234",
"img" : "https://ncp.storage.imglink"
},
{
"title": "์ ๋ชฉ2",
"courseId": 2,
"path": [(1, 1), (2, 2), (3, 3)...],
"pathLength": 3800,
"userId": "abcd1234",
"img" : "https://ncp.storage.imglink"
}, ...
]
}
}
- ์ ์ ์ฝ์ค ๋ชฉ๋ก ์์ฒญ ์คํจ์
{
"status": 500,
"error": {
"message": "Internal server error"
}
}
Daily Scrum
- React + ์ ์ญ์ํ๊ด๋ฆฌ
- Docker + Kubernetes
- NginX
- ORM
- CI/CD with github actions
- NestJS + Prisma
- styled-component ํํ ๋ฆฌ์ผ
- NestJS ์์ํ๊ธฐ
- React Hooks
- JWT
- Storybook
- Faker Library
- CI ์ต์ ํํ๊ธฐ
- React-Query
- Message-Queue
- TanstackQuery ๋์
- ๋ฌดํ์คํฌ๋กค ๋์ ๊ธฐ - ๋ ๋ชป์ง๋๊ฐ๋ค(์ฝ๋ฐฑ ํ)
- WebpackโVite ์ ํ๊ธฐ
- ๋ฒ๋ค ์ฌ์ด์ฆ ์ต์ ํ
- ์ญ๋ฐฉํฅ ๋ฌดํ์คํฌ๋กค
- Repository Pattern ๋์ ๊ธฐ
- Nestjs ๋ฐฑ์๋ ๋ฆฌํฉํ ๋ง
- Redis Job Queue๋ฅผ ํตํ ์๋ฆผ์๋ฒ ๋์ ๊ธฐ
- Message Sync Queue๋ฅผ ํตํ ์ค์๊ฐ ์ฑํ
- Jest๋ฅผ ํตํ e2e ํ ์คํธ