{"id":47974193,"url":"https://github.com/seonghobae/discord-bot","last_synced_at":"2026-04-04T10:52:26.612Z","repository":{"id":305430353,"uuid":"1018628908","full_name":"seonghobae/discord-bot","owner":"seonghobae","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-29T17:26:11.000Z","size":298,"stargazers_count":0,"open_issues_count":6,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T10:52:22.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Vooster-AI/discord-bot","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seonghobae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-07-12T17:15:43.000Z","updated_at":"2026-02-15T10:16:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/seonghobae/discord-bot","commit_stats":null,"previous_names":["seonghobae/discord-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seonghobae/discord-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonghobae%2Fdiscord-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonghobae%2Fdiscord-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonghobae%2Fdiscord-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonghobae%2Fdiscord-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seonghobae","download_url":"https://codeload.github.com/seonghobae/discord-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seonghobae%2Fdiscord-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31397055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-04-04T10:52:24.632Z","updated_at":"2026-04-04T10:52:26.593Z","avatar_url":"https://github.com/seonghobae.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Discord Bot Server (Clean Architecture Edition)**\n\nDiscord 서버와 연동하여 사용자 활동을 추적하고, 포인트 기반의 보상 및 레벨 시스템을 제공하는 고품질 TypeScript 봇 서버입니다. 이 프로젝트는 **클린 아키텍처(Clean Architecture)** 와 **테스트 주도 개발(TDD)** 원칙을 기반으로 설계되어 뛰어난 안정성, 확장성, 그리고 유지보수성을 자랑합니다.\n\n[![Test Coverage](https://img.shields.io/badge/Coverage-82.75%25-brightgreen)](./coverage/index.html)\n[![Build Status](https://img.shields.io/badge/Build-Passing-success)](https://github.com/)\n[![License](https://img.shields.io/badge/License-ISC-blue.svg)](./LICENSE)\n\n## ✨ 핵심 가치\n\n- **✅ 테스트 가능성 (Testability)**: 비즈니스 로직과 외부 의존성(Discord.js, Prisma)을 완벽히 분리하여, 순수한 단위 테스트를 통해 핵심 로직의 안정성을 100% 보장합니다.\n- **📦 모듈화 및 유연성 (Modularity \u0026 Flexibility)**: 각 계층(Domain, Application, Infrastructure)이 명확한 책임을 가지므로, Discord.js를 다른 라이브러리로 교체하거나 데이터베이스를 변경하더라도 비즈니스 로직의 수정 없이 대응할 수 있습니다.\n- **🔧 유지보수성 (Maintainability)**: 의존성 방향이 명확하여 코드 변경 시 영향 범위를 쉽게 예측하고, 새로운 기능을 안전하게 추가할 수 있습니다.\n\n---\n\n## 🏗️ 아키텍처: 클린 아키텍처\n\n이 프로젝트는 Uncle Bob의 클린 아키텍처를 따릅니다. 의존성은 항상 외부에서 내부로 향하며, 이를 통해 핵심 비즈니스 로직을 외부 세계로부터 보호합니다.\n\n![Clean Architecture Diagram](https://blog.cleancoder.com/uncle-bob/images/2012-08-13-the-clean-architecture/CleanArchitecture.jpg)\n\n### 계층별 역할\n\n| 계층 (Layer)                | 디렉토리                         | 역할                                                                                         |\n| --------------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- |\n| **Domain (도메인)**         | `src/domain`                     | **순수한 비즈니스 규칙과 데이터 구조(Entity, Interface).** 다른 어떤 계층에도 의존하지 않음. |\n| **Application (응용)**      | `src/application`                | **유스케이스(Use Cases) 구현.** 도메인 계층의 인터페이스를 활용하여 비즈니스 로직을 지휘.    |\n| **Infrastructure (인프라)** | `src/infrastructure`             | **외부 세계와의 연결(Adapters).** 인터페이스를 실제 라이브러리(Prisma, Discord.js)로 구현.   |\n| **Entrypoints (진입점)**    | `src/infrastructure/entrypoints` | **애플리케이션 구동.** Discord Bot 이벤트 핸들러, Express API 라우터가 여기에 해당.          |\n\n자세한 내용은 [CLEAN_ARCHITECTURE.md](./CLEAN_ARCHITECTURE.md) 문서를 참고하세요.\n\n---\n\n## 🛠 기술 스택\n\n| 구분            | 기술                            |\n| --------------- | ------------------------------- |\n| **Backend**     | Node.js, Express.js             |\n| **Language**    | TypeScript                      |\n| **Database**    | PostgreSQL (Supabase)           |\n| **ORM**         | Prisma                          |\n| **Discord API** | Discord.js v14                  |\n| **Testing**     | **Vitest**, @vitest/coverage-v8 |\n| **Package Mgr** | pnpm                            |\n\n---\n\n## 🚀 시작하기\n\n### 1. 전제 조건\n\n- Node.js (v18 이상 권장)\n- pnpm\n\n### 2. 설치 및 설정\n\n```bash\n# 1. 저장소 클론\ngit clone \u003crepository-url\u003e\ncd discord-bot-server\n\n# 2. 의존성 설치\npnpm install\n\n# 3. 환경 변수 설정\n# .env.example 파일을 복사하여 .env 파일을 생성하고, 내부 값을 채워주세요.\ncp .env.example .env\n\n# 4. 데이터베이스 마이그레이션\n# .env 파일의 DATABASE_URL이 올바르게 설정되었는지 확인하세요.\npnpm prisma migrate dev --name init\n\n# 5. Discord에 슬래시 커맨드 배포\n# .env 파일의 Discord 관련 변수들이 올바르게 설정되었는지 확인하세요.\npnpm deploy-commands\n```\n\n### 3. 서버 실행\n\n```bash\n# 개발 모드로 실행 (파일 변경 시 자동 재시작)\npnpm dev\n\n# 프로덕션 모드로 실행\n# 먼저 빌드 과정을 거쳐야 합니다.\npnpm build\npnpm start\n```\n\n---\n\n## 🧪 테스트\n\n이 프로젝트는 **테스트 주도 개발(TDD)**을 지향하며, 높은 코드 커버리지를 유지합니다.\n\n```bash\n# 모든 단위 테스트 실행\npnpm test\n\n# Watch 모드로 테스트 실행\npnpm test:watch\n\n# 테스트 커버리지 리포트 생성\npnpm test:coverage\n```\n\n`pnpm test:coverage` 실행 후, `coverage/index.html` 파일을 열어 상세한 커버리지 리포트를 확인할 수 있습니다.\n\n---\n\n## 🔧 API 엔드포인트\n\nAPI 서버는 데이터 마이그레이션과 같은 관리자용 기능을 제공합니다.\n\n- **기본 URL**: `http://localhost:3000`\n- **인증**: 모든 요청은 `Authorization` 헤더에 `Bearer \u003cAPI_SECRET_KEY\u003e` 형식의 API 키를 포함해야 합니다.\n\n| 메서드 | 경로                   | 설명                                 | 추가 헤더 (`-H`)                |\n| ------ | ---------------------- | ------------------------------------ | ------------------------------- |\n| `POST` | `/api/discord/migrate` | 과거 채널 기록을 마이그레이션합니다. | `X-Admin-Key: \u003cyour_admin_key\u003e` |\n| `GET`  | `/api/discord/status`  | 봇 서버의 현재 상태를 확인합니다.    | -                               |\n| `GET`  | `/api/discord/health`  | API 서버의 헬스 체크 (인증 불필요)   | -                               |\n\n**요청 예시 (cURL):**\n\n```bash\ncurl -X POST http://localhost:3000/api/discord/migrate \\\n  -H \"Authorization: Bearer your_api_secret_key\" \\\n  -H \"X-Admin-Key: your_admin_key\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n        \"channelId\": \"your_channel_id\",\n        \"limit\": 500\n      }'\n```\n\n---\n\n## 🤝 기여하기\n\n이 프로젝트에 기여하는 것을 환영합니다! 기여 절차는 다음과 같습니다.\n\n1.  이 저장소를 Fork 하세요.\n2.  새로운 기능이나 버그 수정을 위한 브랜치를 만드세요. (`git checkout -b feature/amazing-feature`)\n3.  **TDD 사이클**(`Red -\u003e Green -\u003e Refactor`)에 따라 테스트를 먼저 작성하고 코드를 구현하세요.\n4.  모든 테스트가 통과하는지 확인하세요. (`pnpm test`)\n5.  변경 사항을 커밋하세요. (`git commit -m 'feat: Add some amazing feature'`)\n6.  브랜치를 Push 하세요. (`git push origin feature/amazing-feature`)\n7.  Pull Request를 생성하세요.\n\n## 📄 라이선스\n\n이 프로젝트는 [ISC 라이선스](./LICENSE) 하에 배포됩니다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseonghobae%2Fdiscord-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseonghobae%2Fdiscord-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseonghobae%2Fdiscord-bot/lists"}