|
| 1 | +import { |
| 2 | + DocsLayout, |
| 3 | + DocsCodeBlock, |
| 4 | + DocsCallout, |
| 5 | + DocsPrerequisites, |
| 6 | + DocsLearningObjectives, |
| 7 | + DocsPagination, |
| 8 | + TimeEstimate, |
| 9 | + Step, |
| 10 | + StepList, |
| 11 | + TOCItem |
| 12 | +} from '@/components/docs' |
| 13 | +import { Zap } from 'lucide-react' |
| 14 | + |
| 15 | +const tocItems: TOCItem[] = [ |
| 16 | + { id: 'hosted', title: 'Option 1: Hosted (Fastest)', level: 2 }, |
| 17 | + { id: 'docker', title: 'Option 2: Docker', level: 2 }, |
| 18 | + { id: 'manual', title: 'Option 3: Manual Setup', level: 2 }, |
| 19 | + { id: 'next-steps', title: 'Next Steps', level: 2 }, |
| 20 | +] |
| 21 | + |
| 22 | +export function QuickStartPage() { |
| 23 | + return ( |
| 24 | + <DocsLayout toc={tocItems}> |
| 25 | + {/* Header */} |
| 26 | + <div className="mb-8 pb-8 border-b border-white/10"> |
| 27 | + <div className="flex items-center gap-3 mb-4"> |
| 28 | + <TimeEstimate minutes={5} /> |
| 29 | + </div> |
| 30 | + <h1 className="text-4xl font-bold text-white mb-4">Quick Start</h1> |
| 31 | + <p className="text-xl text-gray-400"> |
| 32 | + Get OpenCodeIntel running and search your first codebase in under 5 minutes. |
| 33 | + </p> |
| 34 | + </div> |
| 35 | + |
| 36 | + <DocsLearningObjectives items={[ |
| 37 | + { text: 'Set up OpenCodeIntel (hosted or self-hosted)' }, |
| 38 | + { text: 'Index your first repository' }, |
| 39 | + { text: 'Run your first semantic search' }, |
| 40 | + ]} /> |
| 41 | + |
| 42 | + <p className="text-gray-300 text-lg leading-relaxed mb-8"> |
| 43 | + Pick the setup that works for you. Hosted is fastest if you just want to try it out. |
| 44 | + Docker is great for local development. Manual gives you the most control. |
| 45 | + </p> |
| 46 | + |
| 47 | + {/* Option 1: Hosted */} |
| 48 | + <h2 id="hosted" className="text-2xl font-semibold text-white mt-12 mb-4"> |
| 49 | + Option 1: Hosted (Fastest) |
| 50 | + </h2> |
| 51 | + <p className="text-gray-300 mb-6"> |
| 52 | + Zero setup. Just sign in and start searching. |
| 53 | + </p> |
| 54 | + |
| 55 | + <StepList> |
| 56 | + <Step number={1} title="Go to opencodeintel.com"> |
| 57 | + <p> |
| 58 | + Head to <a href="https://opencodeintel.com" target="_blank" rel="noopener noreferrer" className="text-blue-400 hover:underline">opencodeintel.com</a> and |
| 59 | + sign in with GitHub. |
| 60 | + </p> |
| 61 | + </Step> |
| 62 | + |
| 63 | + <Step number={2} title="Add a Repository"> |
| 64 | + <p> |
| 65 | + Click "Add Repository" and paste a GitHub URL. Public repos work immediately. |
| 66 | + For private repos, you will need to connect your GitHub account. |
| 67 | + </p> |
| 68 | + </Step> |
| 69 | + |
| 70 | + <Step number={3} title="Wait for Indexing"> |
| 71 | + <p> |
| 72 | + Indexing takes 30 seconds to a few minutes depending on repo size. |
| 73 | + You will see a progress bar. Grab a coffee if it is a big one. |
| 74 | + </p> |
| 75 | + </Step> |
| 76 | + |
| 77 | + <Step number={4} title="Search"> |
| 78 | + <p> |
| 79 | + Once indexed, type a query like "authentication logic" or "error handling" |
| 80 | + and see the magic happen. |
| 81 | + </p> |
| 82 | + <DocsCallout type="success" title="You are done!"> |
| 83 | + That is it. You can now search your codebase by meaning, not keywords. |
| 84 | + </DocsCallout> |
| 85 | + </Step> |
| 86 | + </StepList> |
| 87 | + |
| 88 | + {/* Option 2: Docker */} |
| 89 | + <h2 id="docker" className="text-2xl font-semibold text-white mt-12 mb-4"> |
| 90 | + Option 2: Docker |
| 91 | + </h2> |
| 92 | + <p className="text-gray-300 mb-6"> |
| 93 | + Run everything locally with one command. Great for development or keeping data on your machine. |
| 94 | + </p> |
| 95 | + |
| 96 | + <DocsPrerequisites |
| 97 | + defaultOpen={true} |
| 98 | + items={[ |
| 99 | + { text: 'Docker Desktop installed', href: 'https://www.docker.com/products/docker-desktop/' }, |
| 100 | + { text: 'OpenAI API key (for embeddings)' }, |
| 101 | + { text: 'Pinecone account (free tier works)', href: 'https://www.pinecone.io/' }, |
| 102 | + ]} |
| 103 | + /> |
| 104 | + |
| 105 | + <StepList> |
| 106 | + <Step number={1} title="Clone the Repository"> |
| 107 | + <DocsCodeBlock language="bash"> |
| 108 | +{`git clone https://github.com/OpenCodeIntel/opencodeintel.git |
| 109 | +cd opencodeintel`} |
| 110 | + </DocsCodeBlock> |
| 111 | + </Step> |
| 112 | + |
| 113 | + <Step number={2} title="Configure Environment"> |
| 114 | + <DocsCodeBlock language="bash"> |
| 115 | +{`cp .env.example .env`} |
| 116 | + </DocsCodeBlock> |
| 117 | + <p>Edit <code className="px-1.5 py-0.5 bg-white/10 rounded text-sm">.env</code> and add your API keys:</p> |
| 118 | + <DocsCodeBlock language="bash" filename=".env"> |
| 119 | +{`OPENAI_API_KEY=sk-... |
| 120 | +PINECONE_API_KEY=... |
| 121 | +PINECONE_INDEX_NAME=codeintel`} |
| 122 | + </DocsCodeBlock> |
| 123 | + </Step> |
| 124 | + |
| 125 | + <Step number={3} title="Start the Stack"> |
| 126 | + <DocsCodeBlock language="bash"> |
| 127 | +{`docker compose up -d`} |
| 128 | + </DocsCodeBlock> |
| 129 | + <p>This starts the backend, frontend, and Redis. First run takes a few minutes to build.</p> |
| 130 | + </Step> |
| 131 | + |
| 132 | + <Step number={4} title="Open the Dashboard"> |
| 133 | + <p> |
| 134 | + Go to <a href="http://localhost:3000" target="_blank" rel="noopener noreferrer" className="text-blue-400 hover:underline">localhost:3000</a> and |
| 135 | + you will see the OpenCodeIntel dashboard. |
| 136 | + </p> |
| 137 | + <DocsCallout type="info"> |
| 138 | + Backend API runs on <code>localhost:8000</code>. API docs at <code>localhost:8000/docs</code>. |
| 139 | + </DocsCallout> |
| 140 | + </Step> |
| 141 | + </StepList> |
| 142 | + |
| 143 | + {/* Option 3: Manual */} |
| 144 | + <h2 id="manual" className="text-2xl font-semibold text-white mt-12 mb-4"> |
| 145 | + Option 3: Manual Setup |
| 146 | + </h2> |
| 147 | + <p className="text-gray-300 mb-6"> |
| 148 | + Run backend and frontend separately. Best for active development. |
| 149 | + </p> |
| 150 | + |
| 151 | + <DocsPrerequisites |
| 152 | + items={[ |
| 153 | + { text: 'Python 3.11+' }, |
| 154 | + { text: 'Node.js 20+ (or Bun)' }, |
| 155 | + { text: 'Redis running locally' }, |
| 156 | + { text: 'OpenAI and Pinecone API keys' }, |
| 157 | + ]} |
| 158 | + /> |
| 159 | + |
| 160 | + <StepList> |
| 161 | + <Step number={1} title="Start Redis"> |
| 162 | + <DocsCodeBlock language="bash"> |
| 163 | +{`# macOS with Homebrew |
| 164 | +brew install redis |
| 165 | +brew services start redis |
| 166 | +
|
| 167 | +# Or with Docker |
| 168 | +docker run -d -p 6379:6379 redis:7-alpine`} |
| 169 | + </DocsCodeBlock> |
| 170 | + </Step> |
| 171 | + |
| 172 | + <Step number={2} title="Backend Setup"> |
| 173 | + <DocsCodeBlock language="bash"> |
| 174 | +{`cd backend |
| 175 | +python -m venv venv |
| 176 | +source venv/bin/activate # Windows: venv\\Scripts\\activate |
| 177 | +pip install -r requirements.txt |
| 178 | +
|
| 179 | +# Copy and configure environment |
| 180 | +cp .env.example .env |
| 181 | +# Edit .env with your API keys |
| 182 | +
|
| 183 | +# Run the server |
| 184 | +uvicorn main:app --reload`} |
| 185 | + </DocsCodeBlock> |
| 186 | + <p>Backend will be running on <code className="px-1.5 py-0.5 bg-white/10 rounded text-sm">localhost:8000</code>.</p> |
| 187 | + </Step> |
| 188 | + |
| 189 | + <Step number={3} title="Frontend Setup"> |
| 190 | + <DocsCodeBlock language="bash"> |
| 191 | +{`cd frontend |
| 192 | +bun install |
| 193 | +bun run dev`} |
| 194 | + </DocsCodeBlock> |
| 195 | + <p>Frontend will be running on <code className="px-1.5 py-0.5 bg-white/10 rounded text-sm">localhost:5173</code>.</p> |
| 196 | + </Step> |
| 197 | + </StepList> |
| 198 | + |
| 199 | + {/* Next Steps */} |
| 200 | + <h2 id="next-steps" className="text-2xl font-semibold text-white mt-12 mb-4"> |
| 201 | + Next Steps |
| 202 | + </h2> |
| 203 | + <p className="text-gray-300 mb-4"> |
| 204 | + Now that you have OpenCodeIntel running, here is what to do next: |
| 205 | + </p> |
| 206 | + <ul className="space-y-2 text-gray-300 mb-8"> |
| 207 | + <li className="flex items-start gap-2"> |
| 208 | + <span className="text-blue-400 mt-1">→</span> |
| 209 | + <span><strong className="text-white">Connect to Claude:</strong> Set up MCP to give Claude access to your codebase. <a href="/docs/mcp-setup" className="text-blue-400 hover:underline">MCP Setup Guide</a></span> |
| 210 | + </li> |
| 211 | + <li className="flex items-start gap-2"> |
| 212 | + <span className="text-blue-400 mt-1">→</span> |
| 213 | + <span><strong className="text-white">Explore features:</strong> Learn about dependency graphs, impact analysis, and code style detection. <a href="/docs/features/search" className="text-blue-400 hover:underline">Features</a></span> |
| 214 | + </li> |
| 215 | + <li className="flex items-start gap-2"> |
| 216 | + <span className="text-blue-400 mt-1">→</span> |
| 217 | + <span><strong className="text-white">Use the API:</strong> Build integrations with the REST API. <a href="/docs/api" className="text-blue-400 hover:underline">API Reference</a></span> |
| 218 | + </li> |
| 219 | + </ul> |
| 220 | + |
| 221 | + {/* Pagination */} |
| 222 | + <DocsPagination |
| 223 | + prev={{ title: 'Introduction', href: '/docs' }} |
| 224 | + next={{ title: 'MCP Setup', href: '/docs/mcp-setup' }} |
| 225 | + /> |
| 226 | + </DocsLayout> |
| 227 | + ) |
| 228 | +} |
0 commit comments