-
Notifications
You must be signed in to change notification settings - Fork 0
API ๋ช ์ธ
- json: ์นด๋ฉ์ผ์ด์ค ์ฌ์ฉ
POST /auth/login
- ๋ก๊ทธ์ธ ์์ฒญ
{
"userId": "myid",
"password": "p@ssw0rd"
}
- ๋ก๊ทธ์ธ ์ฑ๊ณต
{
"statusCode": 200,
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"userId": "abcd1234",
}
}
- ๋ก๊ทธ์ธ ์คํจ
{
"statusCode": 401,
"error": "Unauthorized",
"message": "๋ก๊ทธ์ธ์ ์คํจํ์ต๋๋ค"
}
GET /auth/logout
- ๋ก๊ทธ์์ ์ฑ๊ณต
{
"status": 200
}
- ๋ก๊ทธ์์ ์คํจ
{
"status": 404
}
POST /user
- ํ์๊ฐ์ ์์ฒญ
{
"userId": "userId",
"password": "randowPW",
"pace": 390,
"hCode": "11000000",
"email": "[email protected]",
"receiveMail": true,
}
- ํ์๊ฐ์ ์ฑ๊ณต์
{
"statusCode": 201
}
- ํ์๊ฐ์ ์คํจ์
{
"statusCode": 400,
"error": "Bad Request",
"message": "ํ์๊ฐ์
์ ์คํจํ์ต๋๋ค"
}
GET /user/:id
- ์ค๋ณต ๊ฒ์ฌ ์๋ต
{
"statusCode": 200,
"data": {
"isExisting": true/false,
}
}
GET /auth/refresh
- ๊ฐฑ์ ์์ฒญ์
- HEADER
- Authorization: Bearer
- HEADER
- ๊ฐฑ์ ์ฑ๊ณต์
{
"statusCode": 201,
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"userId": "abcd1234",
}
}
- ๊ฐฑ์ ์คํจ์
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid refresh token"
}
GET /recruit?query=์ ๋ชฉ์
๋๋ค&hour=3&dist=5&maxLen=3000&minLen=1000&page=1&pageSize=10&title=true&author=true
{
"statusCode": 200,
"data": [
{
"id": 1,
"title": "Happy Tears",
"startTime": "2022-01-08T18:28:50.000Z",
"maxPpl": 4,
"currentPpl": 3,
"userId": "June1010",
"pace": 300,
"createdAt": "2022-11-21T08:55:33.171Z",
"course": {
"id": 3,
"title": "The Vengeance of Fu Manchu",
"path": [{lat: 0, lng: 0}, {lat: 1, lng: 1}],
"pathLength": 708,
"userId": "June1010",
"hDong": {
"name": "์ ์ค๋",
},
"createdAt": "2022-11-21T08:55:33.171Z",
}
}, ...
]
}
// ๋ชจ์ง๊ธ์ ์ฝ์ค ์ ๋ณด์ ์ง์ญ์ผ๋ก ๋ชจ์ง๊ธ ์ง์ญ์ ๋์ฒดํ๋ ๋๋ // ๋ชจ์ง๊ธ ์ ์ฒด ๋ชฉ๋ก ํ๋์ ์์ฒญํ ์ ์ ์ ID๊ฐ ์ฐธ์ฌ์ค์ธ ๋ชจ์ง๊ธ์ด๋ฉด "isParticipating" ์ถ๊ฐ ๊ณ ๋ คํด๋ณด๊ธฐ
`GET /course?query=์ ๋ชฉ์
๋๋ค&dist=5&maxLen=3000&minLen=1000&page=1&pageSize=10&title=true&author=true`
{
"statusCode": 200,
"data": [
{
"id": 3,
"title": "The Vengeance of Fu Manchu",
"path": [{"lat": 0, "lng": 0}, {"lat": 1, "lng": 1}],
"pathLength": 708,
"userId": "June1010",
"hDong": {
"name": "์ ์ค๋",
},
"createdAt": "2022-11-21T08:55:33.171Z"
}, ...
]
}
GET /recruit/:id
{
"statusCode": 200,
"data": {
"title": "๋ฌ๋ ค~๋ฌ๋ ค~",
"startTime": "2022-11-21T08:55:33.171Z",
"maxPpl": 5,
"currentPpl": 3,
"path": [{lat:123, lng: 123}, ... ],
"pathLength": 33,
"pace": 20,
"hDong": {
"name": "์ ์ค๋"
},
"userId": "pushedrumex",
"isParticipating": true/false,
"isAuthor": true/false,
}
}
GET /course/:id
{
"statusCode": 200,
"data": {
"id": 3,
"title": "The Vengeance of Fu Manchu",
"path": [{"lat": 0, "lng": 0}, {"lat": 1, "lng": 1}],
"pathLength": 708,
"userId": "June1010",
"hDong": {
"name": "์ ์ค๋",
},
"createdAt": "2022-11-21T08:55:33.171Z"
}
}
POST /recruit/join
HEADER : Authorization: Bearer
{
"recruitId": 1,
}
- ์ฐธ๊ฐ ์์ฒญ ์ฑ๊ณต์
{
"statusCode": 201,
}
- ์ฐธ๊ฐ ์์ฒญ ์คํจ์ (์ฐธ๊ฐ์ ์ฒญ์ธ์ ๊ฝ์ฐฌ๊ฒฝ์ฐ & ๊ธ์ด ๊ฐ์๊ธฐ ์ญ์ ๋ ๊ฒฝ์ฐ)
{
"status": 404(์กด์ฌํ์ง ์๋ ๊ธ์ ์ ์ฒญ) / 423(๋ด๊ฐ ๋ด๊บผ ์ ์ฒญ, ์ด๋ฏธ ์ ์ฒญ, ๋ง๊ฐ),
"error": "Not Found" / "Locked",
"message": "์กด์ฌํ์ง ์๋ ๋ชจ์ง๊ธ์
๋๋ค" / "์์ ์ ๋ชจ์ง์ ๋ฑ๋กํ ์ ์์ต๋๋ค" / "๋ชจ์ง ์ํ์ ๋๋ฌํ์ต๋๋ค" / "์ด๋ฏธ ์ฐธ์ฌ์ค์ธ ๋ชจ์ง๊ธ์
๋๋ค"
}
}
POST /recruit
HEADER : Authorization: Bearer
{
"title": "์ ๋ชฉ์
๋๋ค",
"startTime": "2022-11-15T09:00",
"maxPpl": 3,
"pace": 365,
"courseId": 40,
}
- ๋ชจ์ง ๋ฑ๋ก ์ฑ๊ณต์
{
"statusCode": 201,
"data": {
"recruitId": 210
}
}
- ๋ชจ์ง ๋ฑ๋ก ์คํจ์
// interceptor๋ก ๊ฐ๋ก์ฑ์ ๋ณํ
{
"statusCode": 500,
"error": "Internal server error"
"message": "์์ฒญ์ ์คํจํ์์ต๋๋ค. ๋ค์ ์๋ํด์ฃผ์ธ์"
}
POST /course
HEADER : content-type application/json, Authorization: Bearer
{
"title": "์ ๋ชฉ",
"path": [{lat: 33, lng: 126},{lat: 33, lng: 126},{lat: 33, lng: 126},{lat: 33, lng: 126}],
"pathLength": 3800,
"hCode": "1100000000"
}
- ์ฝ์ค ๋ฑ๋ก ์์ฒญ ์ฑ๊ณต์
{
"statusCode": 201,
"data": {
"courseId": 234
}
}
- ์ฝ์ค ๋ฑ๋ก ์์ฒญ ์คํจ์
// interceptor๋ก ๊ฐ๋ก์ฑ์ ๋ณํ
{
"statusCode": 500,
"error": "Internal server error"
"message": "์์ฒญ์ ์คํจํ์์ต๋๋ค. ๋ค์ ์๋ํด์ฃผ์ธ์"
}
GET /user/me
Header : Authorization: Bearer
- ๋ด ์ ๋ณด ์กฐํ ์์ฒญ ์ฑ๊ณต์
{
"statusCode": 200,
"data": {
"userId": "June1010"
"hDong": {
"name": "์์ธํน๋ณ์",
},
"pace": 380,
}
}
- ๋ด ์ ๋ณด ์กฐํ ์์ฒญ ์คํจ์
// interceptor๋ก ๊ฐ๋ก์ฑ์ ๋ณํ // 401์ ๋ฌด์กฐ๊ฑด ๋ก๊ทธ์ธ ํ์ด์ง๋ก ๋ณํ
{
"statusCode": 401,
"error": "Unauthorized"
"message": "๋ก๊ทธ์ธ์ด ํ์ํ ์๋น์ค์
๋๋ค"
}
PATCH /user/me
Header : Authorization: Bearer
{
"pace"?: 365,
"hCode"?: "1100000000"
}
- ๋ด ์ ๋ณด ์์ ์์ฒญ ์ฑ๊ณต์
{
"statusCode": 201
}
- ๋ด ์ ๋ณด ์์ ์์ฒญ ์คํจ์
{
"status": 401,
"error": "UnAuthorized",
"message": "๋ก๊ทธ์ธ์ด ํ์ํ ์๋น์ค์
๋๋ค"
}
GET /user/me/recruit
Header : Authorization: Bearer
- ๋ด ์ฐธ์ฌ ๋ชจ์ง๋ชฉ๋ก ์์ฒญ ์ฑ๊ณต์
{
"statusCode": 200,
"data": [
{
"id": 1,
"title": "Happy Tears",
"startTime": "2022-01-08T18:28:50.000Z",
"maxPpl": 4,
"currentPpl": 3,
"userId": "๋ชจ์ง๊ธ์์ฑ์",
"pace": 300,
"createdAt": "2022-11-21T08:55:33.171Z",
"course": {
"id": 3,
"title": "The Vengeance of Fu Manchu",
"path": [{lat: 0, lng: 0}, {lat: 1, lng: 1}],
"pathLength": 708,
"userId": "์ฝ์ค์์ฑ์",
"hDong": {
"name": "์ ์ค๋",
},
"createdAt": "2022-11-21T08:55:33.171Z",
}
}, ...
]
}
- ๋ด ์ฐธ์ฌ ๋ชจ์ง๋ชฉ๋ก ์์ฒญ ์คํจ์
{
"status": 401,
"error": "UnAuthorized",
"message": "๋ก๊ทธ์ธ์ด ํ์ํ ์๋น์ค์
๋๋ค"
}
GET /user/me/course
Header : Authorization: Bearer
- ๋ด ์ฝ์ค ๋ชฉ๋ก ์์ฒญ ์ฑ๊ณต์
{
"statusCode": 200,
"data": [
{
"id": 3,
"title": "The Vengeance of Fu Manchu",
"path": [{lat: 0, lng: 0}, {lat: 1, lng: 1}],
"pathLength": 708,
"userId": "์ฝ์ค ์์ฑ์",
"hDong": {
"name": "์ ์ค๋",
},
"createdAt": "2022-11-21T08:55:33.171Z"
}, ...
]
}
- ๋ด ์ฝ์ค ๋ชฉ๋ก ์์ฒญ ์คํจ์
{
"status": 401,
"error": "UnAuthorized",
"message": "๋ก๊ทธ์ธ์ด ํ์ํ ์๋น์ค์
๋๋ค"
}
DELETE /recuit/:id
HEADER : content-type application/json, Authorization: Bearer
- ๋ชจ์ง ์ทจ์ ์์ฒญ ์ฑ๊ณต ์
{
"statusCode": 200,
}
- ๋ชจ์ง ์ทจ์ ์์ฒญ ์คํจ ์
{
"statusCode": 500,
"error": "Internal server error"
"message": "์์ฒญ์ ์คํจํ์์ต๋๋ค. ๋ค์ ์๋ํด์ฃผ์ธ์"
}
DELETE /recuit/:id/join
HEADER : content-type application/json, Authorization: Bearer
- ์ฐธ์ฌ ์ทจ์ ์์ฒญ ์ฑ๊ณต ์
{
"statusCode": 200,
}
- ์ฐธ์ฌ ์ทจ์ ์์ฒญ ์คํจ ์
{
"statusCode": 500,
"error": "Internal server error",
"message": "์์ฒญ์ ์คํจํ์์ต๋๋ค. ๋ค์ ์๋ํด์ฃผ์ธ์"
}
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 ํ ์คํธ