A high-performance hybrid search engine with a C core, Python compatibility layer, and Next.js UI.
- C Core (
c_engine/src/Code): In-memory inverted index + Trie. Handles persistentinteractivesession for indexing and searching. - Middleware (
c_engine/api.py): FastAPI backend. Wraps the C engine process, handles file uploads/extraction (PDF, DOCX, etc.), and exposes clean JSON endpoints. - Frontend (
src/): Next.js + Tailwind CSS UI. Provides file management, autocomplete, and sentence-level search results.
Simply double-click start.bat or run:
.\start.batWhat it does:
- Creates Python virtual environment (if needed)
- Installs all dependencies automatically
- Compiles C engine (if needed)
- Starts both FastAPI backend and Next.js frontend
Two terminal windows will open. Keep them running while using the app.
Requires GCC (MinGW or similar).
cd c_engine/src
gcc main.c trie.c index.c -o ../engine.exeRequires Python 3.8+.
cd c_engine
pip install fastapi uvicorn python-multipart pypdf python-docx
python api.pyAPI runs at http://127.0.0.1:8000
Requires Node.js 18+.
# In the root 'mini-search-engine' folder
npm install
npm run devUI runs at http://localhost:3000
- Fast: C-based indexing and search.
- Smart: Sentence-level granularity.
- Flexible: Drag-and-drop support for .pdf, .docx, .csv, .txt.
- Interactive: Real-time autocomplete.
c_engine/src/: C source code.api.py: FastAPI application.extractor.py: Text extraction logic.
src/app/: Next.js pages.components/: React UI components.lib/api.ts: API client.
The API is designed to be client-agnostic. It can be consumed by:
- Desktop Apps (Electron/Tauri)
- Browser Extensions
- Mobile Apps