{"id":25227781,"url":"https://github.com/jay-chan9yu/heymoji","last_synced_at":"2025-10-26T04:32:52.526Z","repository":{"id":44616801,"uuid":"357904250","full_name":"JAY-Chan9yu/heymoji","owner":"JAY-Chan9yu","description":"🤩  슬랙 웹훅으로 리액션(reaction)을 받아서 이모지(Emoji) 랭킹을 구하는 웹훅 서비스 입니다! ","archived":false,"fork":false,"pushed_at":"2023-08-13T11:04:51.000Z","size":1335,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T21:04:31.375Z","etag":null,"topics":["emoji-rank","fastapi","heymoji","python","vuejs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JAY-Chan9yu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-14T12:52:00.000Z","updated_at":"2024-12-30T11:53:08.000Z","dependencies_parsed_at":"2023-02-16T00:31:23.574Z","dependency_job_id":null,"html_url":"https://github.com/JAY-Chan9yu/heymoji","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JAY-Chan9yu/heymoji","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAY-Chan9yu%2Fheymoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAY-Chan9yu%2Fheymoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAY-Chan9yu%2Fheymoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAY-Chan9yu%2Fheymoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JAY-Chan9yu","download_url":"https://codeload.github.com/JAY-Chan9yu/heymoji/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAY-Chan9yu%2Fheymoji/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281059645,"owners_count":26437056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emoji-rank","fastapi","heymoji","python","vuejs"],"created_at":"2025-02-11T09:10:06.022Z","updated_at":"2025-10-26T04:32:52.166Z","avatar_url":"https://github.com/JAY-Chan9yu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/210239909-7dab9b9a-f796-4495-a58d-091d25e0dc7c.png\"/\u003e\n\u003c/p\u003e\n\n\u003cimg src=\"https://img.shields.io/badge/coverage-93%25-green\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-3.10-orange\"\u003e\n\n# Hey + Emoji = Heymoji\n\n### 개발자의 한마디 👨🏻‍💻\n\n링크드인에서 \u003ca href=\"https://medium.com/mathpresso/%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94-mathpresso%EC%9D%98-backend-web-%ED%8C%80%EC%97%90%EC%84%9C-backend-engineer%EB%A1%9C-%EC%9D%BC%ED%95%98%EA%B3%A0-%EC%9E%88%EB%8A%94-dan%EC%9E%85%EB%8B%88%EB%8B%A4-c7a0641333e8\"\u003e\n매프 멤버들이 서로 토마토를 주는 이유는?\u003ca/\u003e 라는 글을 읽고, 슬랙 이모지(Emoji)로 멤버들에게 ``칭찬``이나 ``리스펙`` 할 수 있는 문화가 생긴다면 재밌기도 하고 고마움도 표현할 수 있을 것\n같았습니다.\u003cbr/\u003e\n\n그래서 이런 재미난 기능은 오픈소스로 공개하면 좋을 것 같다고 생각해서 토이 프로젝트로 만들어 보았습니다.\u003cbr/\u003e\n(근데 Nodejs로 만들어진게 이미 있었네요 \u003ca href=\"https://github.com/chralp/heyburrito\"\u003eheyburrito\u003c/a\u003e)\u003cbr/\u003e\u003cbr/\u003e\n좀 더 `재미난 기능 + 완성도 있는 프로젝트`가 되기위해 유지보수는 지속적으로 할 예정입니다.💪\u003cbr/\u003e\nFastAPI에 구조나 프로젝트 관련된 추가기능, 개선사항 `PR`은 언제나 환영입니다! \u003cbr/\u003e\n\n\u003cbr/\u003e\n\n## 👋 개요\n\n\u003cimg width=\"2247\" alt=\"헤이모지\" src=\"https://user-images.githubusercontent.com/24591259/210266806-1782cc63-7303-4f85-804f-f6d6fbe81647.png\"\u003e\n\n`Heymoji` API서버는 `Python 3.10`, `FastAPI` 로 개발되었습니다.\u003cbr/\u003e\n그 외 버전에서 패키지 및 동작에 대한 호환은 보장하지 않습니다. (근데 거의 다 될거에요 python3.7 이상이면...아마두~😁 )\u003cbr/\u003e\n프론트엔드는 `vuejs`를 사용해서 간단히 만들어 봤습니다!\n\n\u003cbr/\u003e\n\n## 🛠 프로젝트 구조\n\n처음 `Heymoji`를 개발할때는 DDD 구조가 아니었습니다. \u003cbr/\u003e\nDDD에 대한 스터디를 위해 구조를 변경했으며 https://github.com/Ermlab/python-ddd 를 참고하였습니다.\u003cbr/\u003e\n다소 복잡할 수 있으니 추후 유지보수와 여러 상태변경이 일어나는 경우 DDD가 좀 더 유연할 거라고 생각했습니다😁\n\n```\n├── apps\n|   ├─ api \n|   |  ├── dependancy\n|   |  └── router\n|   ├─ applications \n|   |  └── services (Application Service)\n|   ├─ domains\n|   |  └─ user (도메인)\n|   |     ├─ entities.py \n|   |     ├─ services.py (Domain Service)\n|   |     ├─ repositories.py\n|   |     └─ schemas.py\t\n|   ├─ infrastructure (infra 관련 정의 구조)\n|   ├─ utils\n|   ├─ tests\n|   └─ main.py\n├── conf\n|   └── settings.py\n├── scripts\n├── migrations (alembic DB 마이그레이션 설정)\n├── seed_work (프로젝트에서 기본적으로 제공해야하는 작업, 코드)\n├── alembic.ini\n├── requirements.txt\n├── docker-compose.yaml\n├── Dockerfile\n├── web.Dockerfile\n├── .env_sample\n└── frontend (heymoji 웹페이지 관련 코드)\n```\n\n\u003cbr/\u003e\n\n## 💾 세팅\n\n`.env_sample`을 참고해서 `.env`파일을 생성합니다.\u003cbr/\u003e\n원하시는 세팅으로 환경변수들을 세팅합니다.\u003cbr/\u003e\nDB는 `MySQL`을 사용하며 비동기 처리를 위해 `aiomysql`라이브러리를 함께 사용합니다.\u003cbr/\u003e\n다른 DB 사용하려면 `config` 설정이 조금 달라질 수 있습니다.\n\n| 이름                                | 설명                                    |\n|-----------------------------------|---------------------------------------|\n| ENV                               | 배포환경 정의                               |\n| ALLOW_ORIGINS                     | CORS를 허용할 ORIGIN 리스트                  |\n| DB_HOST                           | DB 호스트                                |\n| DB_PORT                           | DB 포트                                 |\n| DATABASE                          | DB 이름                                 |\n| DB_USERNAME                       | DB 접속 유저네임                            |\n| DB_PASSWORD                       | DB 패스워드                               |\n| SLACK_TOKEN                       | 슬랙 토큰                                 |\n| BOT_NAME                          | 슬랙봇 이름                                |\n| ERROR_CHANNEL                     | 슬랙 에러 리포팅 채널                          |\n| SPECIAL_EMOJI                     | 특별한 의미를 가진 이모지                        |\n| LIMIT_GIVE_COUNT_OF_SPECIAL_EMOJI | 매월 다른 멤버에게 줄 수 있는 SPECIAL_EMOJI 제한 개수 |\n| ALLOWED_REACTION_LIST             | 웹훅 리액션으로 허용된 이모지(reaction)들을 정의합니다.   |\n| ALLOWED_EMOJI_TYPES               | 핸들링할 이모지들을 정의합니다.                     |\n| RANK_URL                          | 랭킹 웹페이지 URK                           |\n| DEFAULT_AVATAR_URL                | 기본 프로필 이미지 URL                        |\n\n\u003cbr/\u003e\n\n## 🐳 Docker-Compose 실행\n\n`.env_sample`을 참고하여`.env`파일을 생성한 뒤 `docker-compose up -d` 를 실행합니다.\u003cbr/\u003e\napi, web, db 컨테이너가 모두 실행 된 후 http://127.0.0.1:8080 에 접속하여 동작을 확인합니다.\u003cbr/\u003e\n❗️주의: 컨테이너가 뜨고 패키지 설치에 시간이 걸릴수 있어서 애플리케이션 실행까지 몇분이 소요 될 수 있습니다.\n\n\u003cimg width=\"352\" alt=\"스크린샷 2023-01-02 오후 10 54 35\" src=\"https://user-images.githubusercontent.com/24591259/210240727-139572eb-5874-4fb9-8cd5-fdbc4761cea7.png\"\u003e\n\n`docker-comopse` 실행 전에 README 하단에 있는 \u003ca href=\"https://github.com/JAY-Chan9yu/heymoji#-slack-bot-%EC%84%A4%EC%A0%95\"\u003e\nSlack Bot 설정\u003c/a\u003e을 먼저 보시고 `SlackToken` 같은 환경변수를 먼저 주입해주세요!\n\n\u003cbr/\u003e\n\n## 💡 로컬 실행\n\n```\npip install -r requirements\n```\n\n`root경로`(/heymoji) 에 가서 \u003ca href=\"https://www.uvicorn.org/\"\u003euvicorn\u003c/a\u003e으로 서버를 실행시킵니다.\u003cbr/\u003e\n백그라운드로 실행하기 위해서는 `\u0026`를 마지막에 붙여주세요.\n\n```\nuvicorn app.main:app --port 8080\n```\n\n만약 백그라운드에서 실행되고 있는 프로세스를 제거하고싶은 경우\n\n```\n1. ps aux | grep uvicorn\n2. kill -9 {PID} \n```\n\n잘못된 프로세스 kill을 주의하세요!\u003cbr/\u003e\n\n\u003cbr/\u003e\n\n## 📝 API 문서 및 테스트\n\n``HOST_URL/docs``로 접속하면 ``Swagger``로 만들어진 web 페이지를 확인할 수 있습니다. (FastAPI는 swagger, redoc 지원)\n\n\u003cimg width=\"580\" alt=\"API 문서 및 테스트\" src=\"https://user-images.githubusercontent.com/24591259/222969592-d4a57642-62dd-49d6-805f-3c3031b9a46b.png\"\u003e\n\n\u003cbr/\u003e\n\n\u003cbr/\u003e\n\n## 👾 슬랙 맨션 명령어\n\n| 이름               | 설명                         |\n|------------------|----------------------------|\n| help             | 커멘드 관련 help                |\n| create_user      | user 생성                    |\n| update_user      | user 정보 업데이트               |\n| show_user        | 유저 is_display = True (노출)  |\n| hide_user        | 유저 is_display = False (숨김) |\n| show_best_member | 해당월 베스트 멤버 추출              |\n\n```\n🥳 멤버 등록\n이름은 필수 입니다!\n@EmojiBot --create_user --name=이름 --avatar_url=이미지URL --department=부서\n\n🛠 멤버 정보 업데이트\n업데이트할 정보만 적어주세요!\n@EmojiBot --update_user --avatar_url=이미지URL\n\n🎖 이번달 베스트 멤버 리스트 추출\n@EmojiBot --show_best_member --year=2022 --month=1\n\n🙈 유저 숨기기\n@EmojiBot --hide_user --slack_id=슬랙ID\n\n🙉 유저 보이기\n@EmojiBot --show_user --slack_id=슬랙ID\n```\n\n### 🎖 show_best_member 예시\n\n\u003cimg width=\"499\" alt=\"show_best_member 예시\" src=\"https://user-images.githubusercontent.com/24591259/222969485-290c6d9d-841c-4a01-bd77-12af62db63da.png\"\u003e\n\n### 🚀 Postman 으로 유저 등록 예시\n\n\u003cimg width=\"712\" alt=\"포스트맨 등록 예시\" src=\"https://user-images.githubusercontent.com/24591259/210569063-1c007cd0-28bd-459f-9694-90f1615f5f1f.png\"\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## 🧟‍♂️ 프로세스 Live 체크 (선택)\n\nshell script로 간단하게 Live 체크를 진행 할 수 있습니다! 크론탭에 1분마다 실행하도록 등록.\u003cbr/\u003e\n로깅도 추가하면 좋습니다.\n\n```\n#! /bin/bash\nPYTHON_PATH=/{{ path }}/venv/bin/python\nSCRIPT_PATH=/{{ path }}/heymoji/app\n\nchecker=`ps aux | grep -v \"grep\" | grep \"{{ 검색할 이름}}\" | wc -l`\n\nif [ \"$checker\" == \"0\" ]; then\n\tsource '{{ path }}/venv/bin/activate'\n\tcd $SCRIPT_PATH \u0026\u0026 `uvicorn main:app --port 8080 \u0026`\nfi\n```\n\n\u003cbr/\u003e\n\n# 🤖 Slack Bot 설정\n\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/114943304-bf743a80-9e80-11eb-85ad-30cb26591ea3.png\" width=\"400px\"/\u003e\n\nhttps://api.slack.com/apps 에 접속하여 create app 버튼을 클릭한 후, \u003cbr/\u003e\n원하는 ``workspace``에 ``app``을 생성해주세요!\n\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/114943770-78d31000-9e81-11eb-84fc-3e5964591eed.png\" width=\"400px\"/\u003e\n\n`Basic Information` 탭을 클릭후 하단에서 app의 ``프로필 이미지``를 추가하고 Save 해줍니다.\u003cbr/\u003e\n이건 안해도 되지만 하는게 좋아요. 왜냐하면 멋있거든요😎\n\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/114944994-84bfd180-9e83-11eb-9ee8-f6c8929dd099.png\" width=\"400px\"/\u003e\n\n`Add features and functionality`에서 `Event Subscriptions`을 클릭합니다.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/114944379-71603680-9e82-11eb-84fc-3f0aacfb1890.png\" width=\"400px\"/\u003e\n\n`Event`를 Enable(활성화) 시킨후 `Requst URL`을 넣어서 인증을 합니다. \u003cbr/\u003e\n\n\u003cimg width=\"400\" alt=\"스크린샷 2023-01-02 오후 10 12 32\" src=\"https://user-images.githubusercontent.com/24591259/210241355-8add5de3-b9ea-4156-a500-682b04a4040b.png\"\u003e\n\n위 화면에서 슬랙토큰을 copy하여 ``.env`` 파일에 추가합니다.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/114944830-45918080-9e83-11eb-9bfa-01c86bd8f9bd.png\" width=\"400px\"/\u003e\n\n로컬에서 테스트 하기 위해 \u003ca href=\"https://dashboard.ngrok.com/get-started/setup\"\u003engrok\u003ca/\u003e을 사용하시면 편합니다.실제 prod\n환경에서는 `Nginx + uvicorn`으로 실행하면 되요!\n\u003cbr/\u003eNginx Config 에서 `proxy_pass` 만 uvicorn으로 실행한 로컬 서버로 연결해주면 됩니다!\u003cbr/\u003e\n\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/114946460-2811e600-9e86-11eb-8cc5-bbb8bcf7db42.png\" width=\"400px\"/\u003e\n\n`Heymoji`는 슬랙 멤버들의 `reaction_added`, `reaction_removed` 이벤트와 bot을 호출하는 `app_mention` 이렇게 3가지 이벤트를 받습니다.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/153050733-875d2f7a-da23-42b6-a4a2-bbb35e6d2f82.png\" width=\"400px\"/\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24591259/153050405-191203ea-3a0c-450e-bac2-fb66aef7e3ab.png\" width=\"400px\"/\u003e\n\n슬랙봇과 DM을 통해 명령어를 실행하기 위해서는 `message.im`을 선택하고 Message Tab 기능을 on 시켜주셔야 합니다.\u003cbr/\u003e\n\n마지막으로 `app`을 `workspace`에 설치(install)하면 설정한 이벤트가 일어날때마다 `slack`에서 `Heymoji`서버로 웹훅 api를 호출합니다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjay-chan9yu%2Fheymoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjay-chan9yu%2Fheymoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjay-chan9yu%2Fheymoji/lists"}