A lightweight web search engine built with Go (backend) and Vue.js (frontend). The system can crawl websites, index content, and provide search functionality.
- Web crawler with configurable depth and page limits
- In-memory indexing with persistence
- Full-text search
- RESTful API
- Modern Vue.js frontend with Tailwind CSS
- Go 1.25.1 or higher
- Node.js 20.19.0+ or 22.12.0+
- npm or yarn
git clone <repository-url>
cd mini_search_engineNavigate to the backend directory:
cd backendInstall dependencies:
go mod downloadStart the server with crawling:
go run cmd/titan/main.go -crawl "https://example.com" -max-pages 100 -max-depth 3 -workers 5 -port 8080Or start without crawling (uses existing index):
go run cmd/titan/main.go -port 8080Available flags:
-crawl: URL to start crawling from-max-pages: Maximum number of pages to crawl (default: 100)-max-depth: Maximum crawl depth (default: 3)-workers: Number of concurrent workers (default: 5)-port: HTTP server port (default: 8080)
The backend will be available at http://localhost:8080
Open a new terminal and navigate to the frontend directory:
cd frontendInstall dependencies:
npm installStart the development server:
npm run devThe frontend will be available at http://localhost:5173 (or another port if 5173 is busy)
Backend:
cd backend
go build -o titan cmd/titan/main.go
./titan -crawl "https://example.com" -port 8080Frontend:
cd frontend
npm run build
npm run previewTo inspect the index contents:
cd backend
go run cmd/debug/main.goThis will display index statistics and test searches.
.
├── backend/
│ ├── cmd/
│ │ ├── titan/ # Main server
│ │ └── debug/ # Debug tool
│ └── internal/
│ ├── analysis/ # Text tokenization
│ ├── api/ # HTTP handlers
│ ├── crawler/ # Web crawler
│ ├── index/ # Search indexing
│ └── utils/ # Utilities
├── frontend/
│ ├── src/
│ │ ├── App.vue # Main app component
│ │ └── main.js # Entry point
│ └── public/
└── README.md
- Start the backend server with a URL to crawl
- Wait for the crawler to finish indexing pages
- Open the frontend in your browser
- Enter search queries to find indexed content
- The index is persisted to
index_data.binafter crawling - Subsequent runs will load the existing index unless you delete the file
- The crawler respects robots.txt and implements rate limiting