Skip to content

Latest commit

Β 

History

History
137 lines (95 loc) Β· 3.09 KB

File metadata and controls

137 lines (95 loc) Β· 3.09 KB

πŸ” Code Search Engine

A powerful, lightning-fast code search engine built for developers who need to quickly find and navigate through their codebase. Built with React, Node.js, Express, and MongoDB, optimized for performance and ease of use.


πŸš€ Live Demo


✨ Features

  • ⚑ Lightning Fast Search – Search through your entire codebase with instant results using advanced indexing algorithms.
  • πŸ“ Multi-Language Support – Supports C++, JavaScript, Python, HTML, and more.
  • 🎯 Precise Results – Get exact matches with highlighted keywords and context-aware snippets.
  • πŸ“Š Search History – Keep track of your previous searches with detailed result history and timestamps.
  • ⚑ Real-time Indexing – Automatically indexes uploaded code for faster and more accurate search.
  • πŸ”’ Secure & Private – Your code remains stored locally on the backend.

πŸ› οΈ Tech Stack

Frontend

  • React + Vite
  • Tailwind CSS
  • React Router

Backend

  • Node.js & Express
  • Multer (for file uploads)
  • MongoDB (for storage & metadata)

Deployment

  • Frontend β†’ Netlify
  • Backend β†’ Render

πŸ“‚ Project Structure

Code-Search-Engine/
│── backend/          # Express backend APIs
β”‚   └── server.js     # Entry point
β”‚
│── frontend/         # React + Vite frontend
β”‚   β”œβ”€β”€ src/          # Components, pages, utils
β”‚   └── public/       # Static assets
β”‚
│── codebase/         # Uploaded code files (server-side storage)
│── README.md
│── package.json

βš™οΈ Installation & Setup

1. Clone the repo

git clone https://github.com/your-username/Code-Search-Engine.git
cd Code-Search-Engine

2. Setup Backend

cd backend
npm install

Create a .env file in /backend:

PORT=5000
MONGODB_URI=mongodb://localhost:27017/codesearchengine
JWT_SECRET=your-secret-key
NODE_ENV=development

Run backend:

npm start

3. Setup Frontend

cd frontend
npm install
npm run dev

For production build:

npm run build

πŸ“– API Endpoints

  • POST /api/upload β†’ Upload code files
  • GET /search?q=keyword β†’ Search keyword across codebase
  • GET /api/codebase β†’ Get all uploaded files
  • DELETE /api/delete/:filename β†’ Delete a file
  • DELETE /api/codebase β†’ Clear entire codebase
  • GET /api/health β†’ Health check

πŸš€ Deployment

  • Frontend: Deployed on Netlify (set base directory = frontend, build command = npm run build, publish directory = frontend/dist).
  • Backend: Deployed on Render (set root directory = backend, build command = npm install, start command = node server.js).

πŸ“Œ Future Improvements

  • User authentication & per-user storage
  • Cloud storage integration (AWS S3 / GCP)
  • Advanced filters (by file type, repo, etc.)
  • UI enhancements