AOSSIE-Org / AOSSIE-Org/Devr.AI

BUG: Landing Page Repository Input Not Connected to CodeGraph Indexing

未关闭
#170 6 条评论 0 个 reaction 已指派 1 人 已被 @DecodeX15 认领 在 GitHub 查看
bug good first issue
主要语言
Python
星标
102
派生
137
PR 合并指标
30 天内没有已合并 PR

描述

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

## 📌 Issue Overview

**Landing Page Repository Input Not Connected to CodeGraph Indexing**

The landing page allows users to enter a GitHub repository URL, but clicking "Analyze Repository" fails because the frontend calls a non-existent backend API endpoint (`/api/repo-stats`). The repository indexing functionality with FalkorDB exists in the codebase but is not exposed via the REST API for the web frontend.

---

## 🔍 Steps to Reproduce

1. Go to the landing page (`LandingPage.tsx`)
2. Enter a valid GitHub repository URL (e.g., `https://github.com/AOSSIE-Org/Devr.AI`)
3. Click on "Analyze Repository" button
4. See the error toast: "Failed to fetch repository stats. Please check the URL or backend server."

---

## 🎯 Expected Behavior

1. User enters a GitHub repository URL in the landing page
2. Frontend sends the URL to backend API endpoint
3. Backend calls `RepoService.index_repo()` to index the repository using FalkorDB CodeGraph
4. Repository is cloned, analyzed, and stored as a graph in FalkorDB
5. Indexing metadata (status, node count, edge count) is saved to Supabase
6. User receives success message with repository stats
7. User is navigated to the dashboard showing the indexed repository data

---

## 🚨 Actual Behavior

1. User enters a GitHub repository URL in the landing page
2. Frontend attempts to POST to `http://localhost:8000/api/repo-stats` (line 23 in `LandingPage.tsx`)
3. Request fails with 404 - endpoint does not exist in the backend
4. User sees error toast message
5. No repository indexing occurs
6. User cannot proceed to dashboard

**Technical Details:**

The frontend makes this call:
```typescript
const response = await axios.post('http://localhost:8000/api/repo-stats', { repo_url: repoUrl });
```

But `/api/repo-stats` endpoint is **not defined** in:
- ❌ `backend/app/api/router.py`
- ❌ `backend/app/api/v1/` (no repositories endpoint)

**However, the infrastructure exists:**
- ✅ `backend/app/services/codegraph/repo_service.py` - Complete `RepoService` class
- ✅ `RepoService.index_repo()` method works (tested via Discord bot)
- ✅ FalkorDB integration functional
- ✅ Supabase database with `indexed_repositories` table
- ❌ Just missing the REST API layer to expose this functionality

---

### Files to Modify:
- `backend/app/api/v1/repositories.py` (create new file)
- `backend/app/api/router.py` (add router registration)
- `frontend/src/components/landing/LandingPage.tsx` (update API endpoint)

### Record

- [x] I agree to follow this project's Code of Conduct
- [ ] I want to work on this issue

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。