{"id":29208919,"url":"https://github.com/yaodingyd/mozi","last_synced_at":"2025-09-12T13:32:41.100Z","repository":{"id":301825285,"uuid":"1009114440","full_name":"yaodingyd/mozi","owner":"yaodingyd","description":"Automatically analyze and rank your GitHub issues by fixability to focus on what matters most","archived":false,"fork":false,"pushed_at":"2025-06-29T03:06:13.000Z","size":9827,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-29T04:19:38.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mozi.yaodingyd.workers.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaodingyd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-26T15:44:42.000Z","updated_at":"2025-06-29T03:07:12.000Z","dependencies_parsed_at":"2025-06-29T04:29:56.180Z","dependency_job_id":null,"html_url":"https://github.com/yaodingyd/mozi","commit_stats":null,"previous_names":["yaodingyd/mozi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yaodingyd/mozi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaodingyd%2Fmozi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaodingyd%2Fmozi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaodingyd%2Fmozi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaodingyd%2Fmozi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaodingyd","download_url":"https://codeload.github.com/yaodingyd/mozi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaodingyd%2Fmozi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274821681,"owners_count":25356343,"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-09-12T02:00:09.324Z","response_time":60,"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":[],"created_at":"2025-07-02T20:37:16.459Z","updated_at":"2025-09-12T13:32:41.089Z","avatar_url":"https://github.com/yaodingyd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔍 Mozi - Intelligent GitHub Issue Analyzer\n\n\u003e **Automatically analyze and rank your GitHub issues by fixability to focus on what matters most.**\n\nMozi is a full-stack web application that intelligently analyzes GitHub issues across your repositories and ranks them by how likely they are to be fixable. Built on Cloudflare Workers with a modern tech stack, it provides automated insights to help developers prioritize their work.\n\n![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white)\n![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)\n![Cloudflare](https://img.shields.io/badge/Cloudflare-F38020?style=for-the-badge\u0026logo=Cloudflare\u0026logoColor=white)\n\n## ✨ Features\n\n### 🎯 **Intelligent Issue Analysis**\n- **Smart Scoring Algorithm**: Analyzes issue content, labels, stack traces, and context\n- **Fixability Ranking**: Issues categorized as High, Medium, Low, or Very Low fixability\n- **Context Gathering**: Automatically finds related files, code references, and discussions\n- **Rule-Based Analysis**: Multiple criteria including bug indicators, error messages, and code mentions\n\n### 🔄 **Automated Processing**\n- **Scheduled Analysis**: Hourly cron jobs automatically process new issues\n- **Manual Refresh**: On-demand analysis with real-time progress indicators\n- **Repository Management**: Easy addition and configuration of multiple repositories\n- **Persistent Storage**: All analysis results stored in Cloudflare D1 database\n\n### 🎨 **Modern Web Interface**\n- **Repository Filtering**: View issues for specific repositories or all at once\n- **GitHub-like Styling**: Familiar interface with clean, professional design\n- **Real-time Loading**: Smart loading states and progress indicators\n- **Responsive Design**: Works seamlessly across desktop and mobile devices\n\n### 📊 **Comprehensive Insights**\n- **Detailed Recommendations**: Specific advice for each issue based on analysis\n- **Context Metrics**: Shows related files, code references, and comment counts\n- **Applied Rules**: Transparent scoring with explanation of analysis factors\n- **Direct GitHub Links**: One-click access to original issues\n\n## 🏗️ System Architecture\n\n### **Technology Stack**\n```\n┌─────────────────────────────────────────────────────────────┐\n│                     🌐 Frontend (Preact)                    │\n│                Static files served via Cloudflare           │\n├─────────────────────────────────────────────────────────────┤\n│                   ⚡ Cloudflare Worker (Hono)               │\n│              REST API + Static Asset Serving                │\n├─────────────────────────────────────────────────────────────┤\n│                    🗄️ Cloudflare D1 Database               │\n│              SQLite with Drizzle ORM                        │\n├─────────────────────────────────────────────────────────────┤\n│                   🔧 External Services                      │\n│                GitHub API + Cron Triggers                   │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### **Core Components**\n\n#### **Backend Services (`src/services/`)**\n- **`github.ts`**: GitHub API integration and issue context gathering\n- **`analysis.ts`**: Fixability scoring algorithm and rule engine\n- **`cronjob.ts`**: Automated scheduled processing service\n\n#### **API Routes (`src/routes/`)**\n- **`/api/issues`**: Get issues with optional repository filtering\n- **`/api/repositories`**: Manage tracked repositories\n- **`/api/refresh`**: Trigger manual analysis\n- **`/`**: Static frontend application\n\n#### **Database Schema (`src/db/`)**\n- **`repositories`**: Tracked GitHub repositories\n- **`issues`**: Analyzed issues with scores and metadata\n- **`settings`**: Application configuration\n\n## 🚀 Quick Start\n\n### **Prerequisites**\n- Node.js 24+\n- pnpm package manager\n- GitHub Personal Access Token\n- Cloudflare account (for deployment)\n\n### **Local Development**\n\n1. **Clone and Install**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd mozi\n   pnpm install\n   ```\n\n2. **Database Setup**\n   ```bash\n   # Apply database migrations\n   pnpm db:migrate\n   ```\n\n3. **Environment Configuration**\n   ```bash\n   # Edit wrangler.toml and add your GitHub token\n   [vars]\n   GITHUB_TOKEN = \"your_github_personal_access_token\"\n   ```\n\n4. **Start Development**\n   ```bash\n   # Build frontend\n   pnpm build:client\n   \n   # Start Cloudflare Worker\n   pnpm dev\n   ```\n\n5. **Access Application**\n   - Frontend: `http://localhost:8787`\n   - API: `http://localhost:8787/api/*`\n\n### **Adding Repositories**\n\n1. Open the web interface at `http://localhost:8787`\n2. Use the \"Repository Settings\" section to add repositories\n3. Enter repository in format: `owner/repo` (e.g., `facebook/react`)\n4. Click \"Add Repository\"\n5. Use \"Refresh Issues\" to start analysis\n\n## 🔧 Configuration\n\n### **GitHub Token Setup**\n1. Go to GitHub Settings → Developer settings → Personal access tokens\n2. Generate token with `repo` and `read:org` permissions\n3. Add token to `wrangler.toml`:\n   ```toml\n   [vars]\n   GITHUB_TOKEN = \"github_pat_...\"\n   ```\n\n### **Database Management**\n```bash\n# Generate new migrations\npnpm db:generate\n\n# Apply migrations\npnpm db:migrate\n\n# Open database studio\npnpm db:studio\n```\n\n### **Cron Schedule**\nThe application runs analysis every hour by default. Configure in `wrangler.toml`:\n```toml\n[triggers]\ncrons = [\"0 * * * *\"]  # Every hour\n```\n\n## 📚 Usage Guide\n\n### **Managing Repositories**\n1. **Add Repository**: Enter `owner/repo` format in the form\n2. **Enable/Disable**: Toggle repository processing (planned feature)\n3. **View Issues**: Use repository filter dropdown to focus on specific repos\n\n### **Understanding Fixability Scores**\n\n| Level | Score Range | Indicators |\n|-------|-------------|------------|\n| 🟢 **High** | 70-100% | Clear bug reports, stack traces, specific file references |\n| 🟡 **Medium** | 40-69% | Good context, some error info, moderate complexity |\n| 🟠 **Low** | 20-39% | Limited context, vague descriptions, unclear requirements |\n| 🔴 **Very Low** | 0-19% | Questions, discussions, external dependencies |\n\n### **Analysis Rules**\n- **Positive Factors**: Bug labels, error messages, stack traces, code references\n- **Negative Factors**: Feature requests without context, questions, duplicates\n- **Context Gathering**: Related files, code searches, comment analysis\n\n## 🚢 Deployment\n\n### **Cloudflare Workers**\n```bash\n# Build and deploy\npnpm deploy\n\n# Deploy to production\nwrangler deploy --env production\n```\n\n### **Environment Variables**\nSet these in Cloudflare Dashboard or `wrangler.toml`:\n- `GITHUB_TOKEN`: GitHub Personal Access Token\n- `DB`: D1 Database binding (auto-configured)\n\n## 🛠️ Development\n\n### **Project Structure**\n```\nmozi/\n├── src/\n│   ├── index.ts              # Worker entry point\n│   ├── routes/               # API route handlers\n│   ├── services/             # Business logic\n│   ├── db/                   # Database schema\n│   └── app/                  # Frontend Preact app\n├── public/                   # Static HTML\n├── dist/                     # Built frontend assets\n├── migrations/               # Database migrations\n└── wrangler.toml            # Cloudflare Worker config\n```\n\n### **Available Scripts**\n```bash\npnpm dev              # Start development server\npnpm build:client     # Build frontend\npnpm deploy           # Build and deploy\npnpm db:migrate       # Apply database migrations\npnpm db:studio        # Open database studio\n```\n\n### **Testing**\n```bash\n# Test API endpoints\nnode test-new-features.js\n\n# Test application structure\nnode test-new-structure.js\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests and ensure build passes\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## 📝 License\n\nThis project is licensed under the ISC License - see the LICENSE file for details.\n\n## 🐛 Issues \u0026 Support\n\n- **Bug Reports**: Open an issue with detailed description\n- **Feature Requests**: Describe the feature and use case\n- **Questions**: Use GitHub Discussions for general questions\n\n## 🙏 Acknowledgments\n\n- Built with [Cloudflare Workers](https://workers.cloudflare.com/)\n- Powered by [Hono](https://hono.dev/) web framework\n- Frontend built with [Preact](https://preactjs.com/)\n- Database managed with [Drizzle ORM](https://orm.drizzle.team/)\n- Styled with GitHub-inspired design principles\n\n---\n\n**Made with ❤️ for developers who want to focus on what matters most.**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaodingyd%2Fmozi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaodingyd%2Fmozi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaodingyd%2Fmozi/lists"}