Skip to content

Commit

Permalink
docs: 기본 리드미 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
not-using committed Oct 11, 2023
1 parent ab03b95 commit ca20913
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 동아리 활동 기록 슬랙봇
## 개요
- 동아리 활동 기록을 대신 적어주는 슬랙봇


### 기능
1. 참여 확인 메세지 전송
- 매일 오늘의 사서에게 사서 근무 참여 확인 메세지 전송
- 매주 수요일 모든 사서에게 사서 회의 참여 확인 메세지 전송

![확인 메세지](/docs/확인메세지.png)

2. 확인 메세지 응답에 따라 활동 기록 추가
- "네, 활동표에 기록해주세요" 클릭시 해당 활동과 날짜, 응답자 확인후 구글 시트에 기록

![기록 완료](/docs/기록완료메세지.png)


### 기술스택
- axios : http 기본 라이브러리
- [Slack node sdk](https://slack.dev/node-slack-sdk/web-api) : 슬랙 web api 편의 라이브러리
- [Google auth library](https://cloud.google.com/nodejs/docs/reference/google-auth-library/latest) : 구글 인증 편의 라이브러리

### 실행 구조
![구조도](/docs/구조도.png)
- AWS Lambda : 현재 코드, 트리거 이벤트에 따라 동작
- AWS API Gateway : 슬랙에서 사용자 interaction에 따른 POST 요청 수신, Lambda로 전달
- AWS EventBridge : 주기적으로 이벤트 발생시키기 위한 cron job

### 폴더 구조
``` shell
src/
├── constants # 기타 상수
├── messages # 슬랙 메세지 포맷
├── services # 트리거에 따라 정의된 동작
└── utils # 유틸함수
index.mjs # lambda 기본함수, 트리거에 따라 동작수행
```

### 기타 참고사항
- 현재 레포지토리 main 브랜치에 커밋시 연결된 AWS lambda 계정 코드가 갱신되니 주의해주세요
- AWS 계정 문의 : sujikim @notusing11
47 changes: 47 additions & 0 deletions docs/구조도.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<mxfile host="app.diagrams.net" modified="2023-10-11T12:35:53.419Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" etag="8n6ctH4sdyWa5Ym2k7Wl" version="21.7.2" type="device">
<diagram name="페이지-1" id="1CIWbC4a7yUay3ugUWUv">
<mxGraphModel dx="1125" dy="767" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1200" pageHeight="600" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-35" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="280" y="50" width="460" height="330" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-30" value="사용자의 버튼클릭시&lt;br&gt;POST 요청" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="R8Y3Un9ZDwZsNewd_IeB-1" target="R8Y3Un9ZDwZsNewd_IeB-4">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="840" y="122" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-1" value="slack" style="shape=image;html=1;verticalAlign=top;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;aspect=fixed;image=https://cdn2.iconfinder.com/data/icons/social-media-2285/512/1_Slack_colored_svg-128.png" vertex="1" parent="1">
<mxGeometry x="800" y="242" width="70" height="70" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.75;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="R8Y3Un9ZDwZsNewd_IeB-4" target="R8Y3Un9ZDwZsNewd_IeB-6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-4" value="AWS APIGateway" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;gradientColor=#945DF2;gradientDirection=north;fillColor=#5A30B5;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.api_gateway;" vertex="1" parent="1">
<mxGeometry x="600" y="80" width="84" height="84" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-29" value="슬랙 메세지 &lt;br&gt;전송" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="R8Y3Un9ZDwZsNewd_IeB-6" target="R8Y3Un9ZDwZsNewd_IeB-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-6" value="AWS lambda" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;gradientColor=#F78E04;gradientDirection=north;fillColor=#D05C17;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.lambda;" vertex="1" parent="1">
<mxGeometry x="480" y="240" width="74" height="74" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-26" value="주기적으로 &lt;br&gt;실행" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.25;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="R8Y3Un9ZDwZsNewd_IeB-13" target="R8Y3Un9ZDwZsNewd_IeB-6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-13" value="Aws EventBridge" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;gradientColor=#FF4F8B;gradientDirection=north;fillColor=#BC1356;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.eventbridge;" vertex="1" parent="1">
<mxGeometry x="360" y="80" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-36" value="데이터 읽기 및 쓰기" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;startArrow=classic;startFill=1;exitX=0.85;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="R8Y3Un9ZDwZsNewd_IeB-33" target="R8Y3Un9ZDwZsNewd_IeB-6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R8Y3Un9ZDwZsNewd_IeB-33" value="Google Sheets" style="shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;image=https://lh3.ggpht.com/e3oZddUHSC6EcnxC80rl_6HbY94sM63dn6KrEXJ-C4GIUN-t1XM0uYA_WUwyhbIHmVMH=w300;points=[[0,0,0,0,0],[0,0.25,0,0,0],[0,0.5,0,0,0],[0,0.75,0,0,0],[0,1,0,0,0],[0.25,0,0,0,0],[0.25,1,0,0,0],[0.5,0,0,0,0],[0.5,1,0,0,0],[0.75,0,0,0,0],[0.75,1,0,0,0],[0.85,0.5,0,0,0],[1,0,0,0,0],[1,0.25,0,0,0],[1,0.75,0,0,0],[1,1,0,0,0]];" vertex="1" parent="1">
<mxGeometry x="120" y="227" width="100" height="100" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file added docs/구조도.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/기록완료메세지.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/확인메세지.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca20913

Please sign in to comment.