Skip to content

Commit 39834eb

Browse files
committed
feat(docs): Phase 3 - Complete API Reference pages
New pages: - APIOverviewPage: Base URL, authentication, error handling, rate limits - APIRepositoriesPage: List, get, create, delete, reindex endpoints - APISearchPage: Semantic search with parameters and examples - APIAnalysisPage: Dependencies, impact, style, insights endpoints All major documentation sections now complete: - Getting Started (intro, quickstart) - MCP Integration (setup, tools, examples) - Features (search, dependencies, impact, style) - Deployment (docker, self-hosting) - API Reference (overview, repos, search, analysis) Only placeholders remaining: Architecture, Contributing
1 parent 2be9c70 commit 39834eb

6 files changed

Lines changed: 899 additions & 2 deletions

File tree

frontend/src/App.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { MCPExamplesPage } from './pages/MCPExamplesPage';
1313
import { QuickStartPage } from './pages/QuickStartPage';
1414
import { SemanticSearchPage, DependencyAnalysisPage, ImpactPredictionPage, CodeStyleAnalysisPage } from './pages/features';
1515
import { DockerSetupPage, SelfHostingPage } from './pages/deployment';
16+
import { APIOverviewPage, APIRepositoriesPage, APISearchPage, APIAnalysisPage } from './pages/api';
1617
import { GitHubCallbackPage } from './pages/GitHubCallbackPage';
1718

1819
function ProtectedRoute({ children }: { children: React.ReactNode }) {
@@ -86,9 +87,13 @@ function AppRoutes() {
8687
<Route path="/docs/deployment/docker" element={<DockerSetupPage />} />
8788
<Route path="/docs/deployment/self-host" element={<SelfHostingPage />} />
8889

90+
{/* API Reference pages */}
91+
<Route path="/docs/api" element={<APIOverviewPage />} />
92+
<Route path="/docs/api/repositories" element={<APIRepositoriesPage />} />
93+
<Route path="/docs/api/search" element={<APISearchPage />} />
94+
<Route path="/docs/api/analysis" element={<APIAnalysisPage />} />
95+
8996
{/* Placeholder routes for future docs pages */}
90-
<Route path="/docs/api" element={<DocsHomePage />} />
91-
<Route path="/docs/api/*" element={<DocsHomePage />} />
9297
<Route path="/docs/architecture" element={<DocsHomePage />} />
9398
<Route path="/docs/contributing/*" element={<DocsHomePage />} />
9499
<Route
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
import {
2+
DocsLayout,
3+
DocsCodeBlock,
4+
DocsPagination,
5+
TimeEstimate,
6+
TOCItem
7+
} from '@/components/docs'
8+
9+
const tocItems: TOCItem[] = [
10+
{ id: 'dependencies', title: 'Dependency Graph', level: 2 },
11+
{ id: 'impact', title: 'Impact Analysis', level: 2 },
12+
{ id: 'style', title: 'Code Style', level: 2 },
13+
{ id: 'insights', title: 'Repository Insights', level: 2 },
14+
]
15+
16+
export function APIAnalysisPage() {
17+
return (
18+
<DocsLayout toc={tocItems}>
19+
<div className="mb-8 pb-8 border-b border-white/10">
20+
<div className="flex items-center gap-3 mb-4">
21+
<TimeEstimate minutes={6} />
22+
</div>
23+
<h1 className="text-4xl font-bold text-white mb-4">Analysis API</h1>
24+
<p className="text-xl text-gray-400">
25+
Dependency graphs, impact analysis, code style, and repository insights.
26+
</p>
27+
</div>
28+
29+
{/* Dependency Graph */}
30+
<h2 id="dependencies" className="text-2xl font-semibold text-white mt-12 mb-4">Dependency Graph</h2>
31+
32+
<div className="flex items-center gap-3 p-3 bg-white/[0.02] border border-white/10 rounded-lg mb-4">
33+
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-green-400 bg-green-500/10">
34+
GET
35+
</span>
36+
<code className="text-sm text-gray-300">/api/repos/{'{repo_id}'}/dependencies</code>
37+
</div>
38+
39+
<p className="text-gray-300 mb-4">
40+
Get the complete import/dependency graph for a repository.
41+
</p>
42+
43+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Response</h4>
44+
<DocsCodeBlock language="json">
45+
{`{
46+
"nodes": [
47+
{
48+
"id": "src/auth/middleware.py",
49+
"label": "middleware.py",
50+
"directory": "src/auth",
51+
"in_degree": 12,
52+
"out_degree": 3,
53+
"is_hub": true
54+
}
55+
],
56+
"edges": [
57+
{
58+
"source": "src/api/routes.py",
59+
"target": "src/auth/middleware.py",
60+
"type": "import"
61+
}
62+
],
63+
"stats": {
64+
"total_files": 47,
65+
"total_edges": 89,
66+
"hub_files": ["src/utils/index.ts"],
67+
"leaf_files": ["src/config.py"],
68+
"circular_dependencies": []
69+
}
70+
}`}
71+
</DocsCodeBlock>
72+
73+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Example</h4>
74+
<DocsCodeBlock language="bash">
75+
{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
76+
http://localhost:8000/api/repos/repo_abc123/dependencies`}
77+
</DocsCodeBlock>
78+
79+
{/* Impact Analysis */}
80+
<h2 id="impact" className="text-2xl font-semibold text-white mt-12 mb-4">Impact Analysis</h2>
81+
82+
<div className="flex items-center gap-3 p-3 bg-white/[0.02] border border-white/10 rounded-lg mb-4">
83+
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-green-400 bg-green-500/10">
84+
GET
85+
</span>
86+
<code className="text-sm text-gray-300">/api/repos/{'{repo_id}'}/impact</code>
87+
</div>
88+
89+
<p className="text-gray-300 mb-4">
90+
Analyze the impact of changing a specific file.
91+
</p>
92+
93+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Query Parameters</h4>
94+
<div className="overflow-x-auto mb-4">
95+
<table className="w-full text-sm">
96+
<thead>
97+
<tr className="border-b border-white/10">
98+
<th className="text-left py-2 text-gray-400 font-medium">Parameter</th>
99+
<th className="text-left py-2 text-gray-400 font-medium">Type</th>
100+
<th className="text-left py-2 text-gray-400 font-medium">Required</th>
101+
<th className="text-left py-2 text-gray-400 font-medium">Description</th>
102+
</tr>
103+
</thead>
104+
<tbody className="text-gray-300">
105+
<tr>
106+
<td className="py-2 font-mono text-blue-400">file</td>
107+
<td className="py-2 font-mono text-xs">string</td>
108+
<td className="py-2"><span className="text-amber-400">Yes</span></td>
109+
<td className="py-2">Path to the file to analyze</td>
110+
</tr>
111+
</tbody>
112+
</table>
113+
</div>
114+
115+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Response</h4>
116+
<DocsCodeBlock language="json">
117+
{`{
118+
"file": "src/auth/middleware.py",
119+
"risk_level": "high",
120+
"risk_score": 0.85,
121+
"direct_dependents": [
122+
"src/api/routes.py",
123+
"src/api/admin.py"
124+
],
125+
"indirect_dependents": [
126+
"src/main.py"
127+
],
128+
"related_tests": [
129+
"tests/test_auth.py"
130+
],
131+
"test_coverage": {
132+
"has_tests": true,
133+
"test_count": 2
134+
},
135+
"recommendations": [
136+
"High-impact file with 5 dependents",
137+
"Run tests before deploying changes"
138+
]
139+
}`}
140+
</DocsCodeBlock>
141+
142+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Example</h4>
143+
<DocsCodeBlock language="bash">
144+
{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
145+
"http://localhost:8000/api/repos/repo_abc123/impact?file=src/auth/middleware.py"`}
146+
</DocsCodeBlock>
147+
148+
{/* Code Style */}
149+
<h2 id="style" className="text-2xl font-semibold text-white mt-12 mb-4">Code Style</h2>
150+
151+
<div className="flex items-center gap-3 p-3 bg-white/[0.02] border border-white/10 rounded-lg mb-4">
152+
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-green-400 bg-green-500/10">
153+
GET
154+
</span>
155+
<code className="text-sm text-gray-300">/api/repos/{'{repo_id}'}/style</code>
156+
</div>
157+
158+
<p className="text-gray-300 mb-4">
159+
Analyze coding conventions and patterns in the repository.
160+
</p>
161+
162+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Response</h4>
163+
<DocsCodeBlock language="json">
164+
{`{
165+
"naming": {
166+
"variables": "snake_case",
167+
"functions": "snake_case",
168+
"classes": "PascalCase",
169+
"confidence": 0.92
170+
},
171+
"patterns": {
172+
"async_style": "async/await",
173+
"error_handling": "try/except",
174+
"imports": "absolute"
175+
},
176+
"type_system": {
177+
"type_hint_usage": 0.78,
178+
"common_types": ["Optional", "List", "Dict"]
179+
},
180+
"common_imports": [
181+
{ "module": "fastapi", "count": 34 },
182+
{ "module": "pydantic", "count": 28 }
183+
]
184+
}`}
185+
</DocsCodeBlock>
186+
187+
{/* Repository Insights */}
188+
<h2 id="insights" className="text-2xl font-semibold text-white mt-12 mb-4">Repository Insights</h2>
189+
190+
<div className="flex items-center gap-3 p-3 bg-white/[0.02] border border-white/10 rounded-lg mb-4">
191+
<span className="text-xs font-mono font-bold px-2 py-1 rounded text-green-400 bg-green-500/10">
192+
GET
193+
</span>
194+
<code className="text-sm text-gray-300">/api/repos/{'{repo_id}'}/insights</code>
195+
</div>
196+
197+
<p className="text-gray-300 mb-4">
198+
Get high-level insights and metrics about a repository.
199+
</p>
200+
201+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Response</h4>
202+
<DocsCodeBlock language="json">
203+
{`{
204+
"overview": {
205+
"total_files": 142,
206+
"total_lines": 28500,
207+
"languages": {
208+
"TypeScript": 65,
209+
"Python": 42,
210+
"JavaScript": 35
211+
}
212+
},
213+
"architecture": {
214+
"pattern": "monolith with service layer",
215+
"entry_points": ["src/main.py", "src/cli.py"],
216+
"critical_files": [
217+
"src/core/engine.py",
218+
"src/api/routes.py"
219+
]
220+
},
221+
"health": {
222+
"test_coverage_estimate": "partial",
223+
"documentation_coverage": 0.45,
224+
"circular_dependencies": 0
225+
}
226+
}`}
227+
</DocsCodeBlock>
228+
229+
<h4 className="text-sm font-semibold text-gray-400 uppercase tracking-wider mt-6 mb-2">Example</h4>
230+
<DocsCodeBlock language="bash">
231+
{`curl -H "Authorization: Bearer YOUR_API_KEY" \\
232+
http://localhost:8000/api/repos/repo_abc123/insights`}
233+
</DocsCodeBlock>
234+
235+
<DocsPagination
236+
prev={{ title: 'Search API', href: '/docs/api/search' }}
237+
next={{ title: 'Architecture', href: '/docs/architecture' }}
238+
/>
239+
</DocsLayout>
240+
)
241+
}

0 commit comments

Comments
 (0)