Skip to content

Commit baa3703

Browse files
authored
Merge pull request #240 from DevanshuNEU/feature/docs-overhaul
feat(docs): Complete documentation overhaul with accurate architecture
2 parents d24543a + ea2882f commit baa3703

47 files changed

Lines changed: 5743 additions & 619 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# CodeIntel Development Rules
2+
3+
## Code Style
4+
5+
### General
6+
- NO emojis anywhere - not in code, comments, docs, or commit messages
7+
- Prefer files under 200 lines. Larger files allowed when logically cohesive.
8+
- Comments explain WHY, not WHAT. Keep them brief.
9+
- No decorative headers or ASCII art
10+
- Casual tone in comments - write like a human, not a robot
11+
12+
### JSDoc Policy
13+
- JSDoc allowed for public API functions and exported hooks
14+
- Keep JSDoc minimal - document params and return types, not obvious behavior
15+
- Approved files using JSDoc: `frontend/src/services/playground-api.ts`, `frontend/src/config/api.ts`, `frontend/src/hooks/useViewTransition.ts`
16+
17+
### Large File Exceptions
18+
These files exceed 200 lines but are approved due to logical cohesion:
19+
- `backend/routes/playground.py`
20+
- `backend/services/dna_extractor.py`
21+
- `frontend/src/components/DependencyGraph/index.tsx`
22+
23+
### Frontend (TypeScript/React)
24+
- Package manager: **Bun only**. Never npm, never yarn.
25+
- Always `bun install`, `bun run dev`, `bun run build`
26+
- Never delete `bun.lock` or create `package-lock.json`
27+
- Use shadcn/ui components over custom UI
28+
- Tailwind for styling, no CSS files
29+
- Functional components with hooks, no class components
30+
31+
### Backend (Python)
32+
- Python 3.11+ required
33+
- Type hints on all function signatures
34+
- Async/await for I/O operations
35+
- PEP 8 style, max 120 char lines
36+
- Use existing patterns from `services/` directory
37+
38+
### Commits
39+
- Format: `type: description` (e.g., `fix: remove broken link`)
40+
- Types: feat, fix, docs, refactor, test, chore
41+
- No emojis in commit messages
42+
- Keep commits focused - one change per commit
43+
44+
## Architecture
45+
46+
### Project Structure
47+
```plaintext
48+
backend/ # FastAPI, Python 3.11+
49+
frontend/ # React 18, TypeScript, Vite, Bun
50+
mcp-server/ # MCP protocol server
51+
```
52+
53+
### API Versioning
54+
- All endpoints use `/api/v1/` prefix
55+
- Version config in `backend/config/api.py`
56+
57+
### Key Services
58+
- `indexer_optimized.py` - Code parsing and embedding
59+
- `dependency_analyzer.py` - Import graph extraction
60+
- `style_analyzer.py` - Convention detection
61+
- `dna_extractor.py` - Architectural pattern extraction
62+
63+
## What NOT to Do
64+
65+
- Don't use npm (use Bun)
66+
- Don't add emojis
67+
- Don't write verbose comments
68+
- Don't add "AI-looking" badges or decorations

CONTRIBUTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,18 @@ pip install -r requirements.txt
1717
cp .env.example .env
1818
# Add your API keys to .env
1919

20-
# Set up frontend
20+
# Set up frontend (MUST use Bun, not npm!)
2121
cd ../frontend
22-
npm install
22+
bun install
2323

2424
# Run tests
2525
cd ../backend
2626
pytest tests/ -v
2727
```
2828

29+
> **Important:** The frontend uses Bun exclusively. Do NOT use npm or yarn.
30+
> Install Bun: `curl -fsSL https://bun.sh/install | bash`
31+
2932
## How to Contribute
3033

3134
### Reporting Bugs
@@ -65,7 +68,7 @@ pytest tests/ -v
6568
- Use TypeScript strict mode
6669
- Prefer functional components
6770
- Use Tailwind for styling
68-
- Run: `npm run build` to check for errors
71+
- Run: `bun run build` to check for errors
6972

7073
## Testing
7174

DEFERRED.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Deferred Work
2+
3+
Items intentionally skipped for future PRs.
4+
5+
---
6+
7+
## PR: feature/docs-overhaul
8+
9+
### 1. Extract shared EndpointHeader component
10+
**Priority:** Low
11+
**Effort:** 30 min
12+
**Files affected:**
13+
- `frontend/src/pages/api/APIRepositoriesPage.tsx`
14+
- `frontend/src/pages/api/APIAnalysisPage.tsx`
15+
- `frontend/src/pages/api/APISearchPage.tsx`
16+
- `frontend/src/pages/api/APIOverviewPage.tsx`
17+
18+
**What:** All 4 API doc pages duplicate the endpoint header markup (colored method badge + path in bordered container). APIRepositoriesPage already has a local `EndpointHeader` component - extract it to `@/components/docs` and reuse.
19+
20+
**Saves:** ~40 lines of duplication
21+
22+
**When to do:** Next time any of these pages need changes, or during a cleanup sprint.
23+
24+
---
25+
26+
### 2. Consolidate navigation data source
27+
**Priority:** Medium
28+
**Effort:** 1-2 hours
29+
**Files affected:**
30+
- `frontend/src/components/docs/DocsSidebar.tsx` (navigation)
31+
- `frontend/src/components/docs/DocsSearch.tsx` (docsPages)
32+
- `frontend/src/components/docs/DocsLayout.tsx` (mobileNavigation)
33+
34+
**What:** Same page list maintained in 3 places. Adding a page requires updating all 3. Extract single `docsNavigation` data source and derive variants from it.
35+
36+
**When to do:** Before adding more doc pages, or if someone forgets to update all 3.

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
# Default target - rebuild frontend
77
f frontend:
8-
@echo "🔄 Rebuilding frontend..."
8+
@echo "Rebuilding frontend..."
99
@docker compose build frontend
1010
@docker compose up -d frontend
11-
@echo "Done"
11+
@echo "Done"
1212

1313
b backend:
14-
@echo "🔄 Rebuilding backend..."
14+
@echo "Rebuilding backend..."
1515
@docker compose build backend
1616
@docker compose up -d backend
17-
@echo "Done"
17+
@echo "Done"
1818

1919
all:
2020
@docker compose build
@@ -39,7 +39,7 @@ status ps:
3939
@docker compose ps
4040

4141
clean:
42-
@echo "⚠️ Full rebuild (slow)..."
42+
@echo "Full rebuild (slow)..."
4343
@docker compose build --no-cache
4444
@docker compose up -d
4545

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ python -m venv venv && source venv/bin/activate
123123
pip install -r requirements.txt
124124
python main.py
125125

126-
# Frontend (new terminal)
126+
# Frontend (new terminal) - MUST use Bun!
127127
cd frontend
128-
npm install && npm run dev
128+
bun install && bun run dev
129129
```
130130

131131
</details>

0 commit comments

Comments
 (0)