A lightweight, database-free search engine designed to provide quick and efficient search capabilities for static content (HTML, TXT, MD files) and dynamic notes. This project enhances user experience with a client-side caching system that speeds up search retrieval, reduces server load, and offers offline functionality through service workers.
Client-Side Cache-Based Search Engine
1. Home Screen
2. Search Results
3. Offline Access
4. Note-Taking Feature
Cache Directory Settings
Cache Expiration
Table of Contents
Overview
Features
How It Works
System Architecture
Installation
Usage
Configuration
Screenshots
Future Enhancements
License
The Client-Side Cache-Based Search Engine aims to solve the problem of slow retrieval times in traditional database-driven systems, especially for small-scale applications. By leveraging client-side caching techniques, this project allows for quick access to static content and user-generated notes without the need for repeated server queries or a complex database setup. It also features offline search capabilities, enabling users to access frequently used files and notes even without a network connection.
Fast Search: Quickly indexes and retrieves content from local static files (HTML, TXT, MD) and user-generated notes.
Client-Side Caching: Frequently accessed files are cached locally, reducing load times and minimizing server requests.
Offline Access: Integrated service worker allows users to search and access files and notes while offline.
Note Management: Includes a simple note-taking application, allowing users to create, edit, and save notes, which are also cached for fast retrieval.
File Indexing: Files in designated directories are indexed upon first search and cached to enable faster access.
Client-Side Caching: Indexed content is stored in a cache, allowing the search engine to skip file reads for frequently accessed files.
Service Worker: A service worker caches essential files and provides offline support, making notes and static content available without internet connectivity.
Real-Time Retrieval: Dynamic notes are cached immediately after creation, enabling instant access both online and offline.
The system is designed around a client-side caching and service worker model, eliminating the need for a database. Here’s a simplified architecture:
graph TD
UI[User Interface] -->|Search Request| SearchEngine
SearchEngine -->|Cache Hit?| Cache
Cache -->|Yes| RetrieveFromCache[Retrieve from Cache]
RetrieveFromCache --> DisplayResults
SearchEngine -->|No| ReadFile[Read File from Directory]
ReadFile --> IndexContent[Index and Cache Content]
IndexContent --> Cache
IndexContent --> DisplayResults[Display Results]
ServiceWorker[Service Worker] --> OfflineSupport
Notes[Notes Storage] --> Cache
Notes --> ServiceWorker
Loading
Follow these steps to set up the project locally:
Clone the Repository
git clone https://github.com/vansh-codes/Client-Side-Cache-Based-Search-Engine.git
Navigate to the Directory
cd Client-Side-Cache-Based-Search-Engine
Set Up XAMPP or Local PHP Server
Place the project in the appropriate XAMPP directory (e.g., C:/xampp/htdocs/
).
Start the Apache server.
Access the ProjectOpen your browser and go to http://localhost/Client-Side-Cache-Based-Search-Engine
.
Search Content: Use the search bar to look for keywords within indexed files and notes.
Note-Taking: Create and save notes, which will be cached for quick access and offline availability.
Offline Access: After the first access, files and notes can be accessed offline using the service worker.
Set the directory paths for content and note storage in the configuration file:
CACHE_DIR
: Path to store cached files.
Content Folder: Modify the path for static files under the content/
directory.
Notes Folder: Modify the path for dynamic notes under the notes/
directory.
Adjust cache expiration settings to clear outdated files and refresh content as needed.
Advanced Search Capabilities: Implement fuzzy search and keyword highlighting for more intuitive searches.
Enhanced Cache Management: Introduce cache expiration policies for better storage management.
Multi-Format Note-Taking: Support additional note formats (TXT, MD, HTML) and automatically cache them for faster retrieval.
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy fast, efficient, and offline-capable searches!