Skip to content

스마일게이트 서버개발캠프_ real-time notification api server using socket.io

License

Notifications You must be signed in to change notification settings

SmilegateDev/notification-api-server

Repository files navigation

Welcome to notification-api-server 👋

Version Documentation Maintenance License: MIT

socket.io 를 활용한 실시간 알림 api 서버

🥊 Youtube

Success images

알림성공

알림성공화면

Install

npm install

Usage

npm start

or

nodemon

Setting

.env file setting

COOKIE_SECRET=
KAKAO_ID=
GOOGLE_ID=
GOOGLE_SECRET=
GMAIL_ID=
GMAIL_PASS=
REDIS_ADDRESS=
REDIS_PASSWORD=
JWT_SECRET=

postman api

POST {url}/noti/like

request body

{
	"send_user": "send_test",
	"rec_user": "rec_test",
	"post_id": "abcdefg123"
}

response body

{
    "success": true,
    "data": {
        "_id": "5e5a2795ba9f44515c357562",
        "send_user": "send_test",
        "rec_user": "rec_test",
        "post_id": "abcdefg123",
        "createdAt": "2020-02-29T08:57:57.639Z",
        "id": 17,
        "status": "like",
        "contents": "send_test님이 회원님의 게시물을 좋아합니다",
        "__v": 0
    }
}

DELETE {url}/noti/unlike

request body

{
	"send_user": "send_test",
	"rec_user": "rec_test",
	"post_id": "abcdefg123",
	"status": "like"
}

response body

{
    "success": true
}

POST {url}/noti/follow

request body

{
	"send_user": "send_test",
	"rec_user": "rec_test"
}

response body

{
    "success": true,
    "data": {
        "_id": "5e5a28cfba9f44515c357564",
        "send_user": "send_test",
        "rec_user": "rec_test",
        "createdAt": "2020-02-29T09:03:11.145Z",
        "id": 18,
        "status": "follow",
        "contents": "send_test님이 회원님을 팔로우 하기 시작했습니다",
        "__v": 0
    }
}

DELETE {url}/noti/unfollow

request body

{
	"send_user": "send_test",
	"rec_user": "rec_test",
	"status": "follow"
}

response body

{
    "success": true
}

POST {url}/noti/reply

request body

{
	"send_user": "send_test",
	"rec_user": "rec_test",
	"post_id": "abcdefg123",
	"replyContents": "댓글 테스트"
}

response body

{
    "success": true,
    "data": {
        "_id": "5e5a298aba9f44515c357565",
        "send_user": "send_test",
        "rec_user": "rec_test",
        "post_id": "abcdefg123",
        "createdAt": "2020-02-29T09:06:18.726Z",
        "status": "reply",
        "id": 19,
        "contents": "send_test님이 회원님의 게시물에 댓글을 남기셨습니다 : 댓글 테스트",
        "__v": 0
    }
}

DELETE {url}/noti/replyBack

request body

{
	"send_user": "send_test",
	"rec_user": "rec_test",
	"status": "reply",
	"replyContents": "댓글 테스트"
}

response body

{
    "success": true
}

DELETE {url}/noti/delNoti/:id

ex) http://localhost:3000/noti/delNoti/5

request body

none

response body

{
    "success": true
}

References

Author

👤 Tim Jaeyong Lee

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 Tim Jaeyong Lee.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

About

스마일게이트 서버개발캠프_ real-time notification api server using socket.io

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published