A modern, cross-platform desktop application for quickly searching files by name or content, built with Electron Forge for streamlined development and distribution.
- Dual Search Modes: Search by file name or file content
- File Type Filtering: Filter results by specific file types (PDF, Word, Excel, images, etc.)
- Real-time Search: Live updates as files are added, modified, or deleted
- File Operations: Double-click to open files or use the folder icon to reveal file location
- Progress Tracking: See real-time progress with file counts and matches
- Modern UI: Clean, intuitive interface with visual feedback
- Cross-Platform: Works on Windows, macOS, and Linux
- Electron Forge: Simplified development workflow and packaging
- File System Access: Efficient recursive directory scanning with
fs-extra
- Real-time Monitoring: File system watching with
chokidar
- IPC Communication: Secure inter-process communication
- Modern JavaScript: ES6+ features and async/await patterns
- Custom Preload Script: Secure exposure of Node.js APIs
- Node.js 18 or higher
- npm or yarn package manager
-
Install dependencies:
npm install
-
Run the application in development mode:
npm start
-
Package the application (optional):
npm run package
-
Create distributable installers (optional):
npm run make
- Select Directory: Click the folder icon to choose where to search
- Enter Search Term: Type what you're looking for in the search field
- Choose Search Type: Select whether to search by file name or file content
- Filter by File Type (optional): Use the dropdown to limit results to specific file types
- Click Search: Start the search process
- Custom File Types: Select "Custom Extension" and enter extensions separated by commas (e.g.,
pdf,docx,txt
) - Real-time Updates: The search automatically updates when files are added, modified, or deleted
- File Operations:
- Double-click any result to open the file with its default application
- Click the folder icon next to any result to reveal the file in Explorer/Finder
- Progress Tracking: Watch the progress counter during large searches
Enter
in search field: Start searchEscape
: Stop current search (when available)
file-search-app/
├── src/
│ ├── index.html # Main UI structure
│ ├── index.css # Application styles
│ ├── index.js # Main process (Electron)
│ ├── preload.js # Secure bridge between main and renderer
│ └── renderer.js # Renderer process (UI logic)
├── package.json # Dependencies and scripts
├── forge.config.js # Electron Forge configuration
└── README.md # This file
npm start
- Start the application in development mode with hot reloadingnpm run package
- Package the application without creating installersnpm run make
- Create distributable installers for all platformsnpm run publish
- Publish the application to GitHub or other providers
- Handles file system operations
- Manages window creation and lifecycle
- Implements IPC handlers for file operations
- Manages UI interactions and validation
- Updates UI based on search results
- Communicates with main process via preload script
- Securely exposes specific Node.js APIs to the renderer process
- Prevents direct Node.js access from the UI for security
electron
: Desktop application framework@electron-forge/*
: Electron Forge tooling for development and packagingfs-extra
: Enhanced file system operationschokidar
: Efficient file system watching
-
Setting up the development environment:
git clone https://github.com/jhenbertgit/file-search-tool.git cd file-search-tool npm install
-
Running in development mode:
npm start
-
Debugging:
- The application opens DevTools automatically in development mode
- Use
console.log()
statements in both main and renderer processes - Main process logs appear in the terminal
- Renderer process logs appear in DevTools
-
Adding new features:
- Update UI in
index.html
andindex.css
- Add UI logic in
renderer.js
- Implement backend functionality in
index.js
- Expose new APIs through
preload.js
- Update UI in
-
Package the application:
npm run package
Creates platform-specific packages in the
out
directory. -
Create installers:
npm run make
Generates distributable installers for Windows, macOS, and Linux.
-
Publish (if configured):
npm run publish
Publishes the application to configured providers like GitHub.
open-directory-dialog
: Opens native directory pickersearch-files
: Initiates file search with parametersopen-file
: Opens file with default applicationopen-file-location
: Reveals file in file explorerstop-search
: Terminates current search operation
search-results
: Emitted when search results are availablesearch-error
: Emitted when an error occurs during searchsearch-progress
: Emitted with progress updates during search
The application uses Electron Forge with the following makers configured:
- Windows: Squirrel installer (
.exe
) - macOS: ZIP archive and DMG installer
- Linux: DEB and RPM packages
Edit forge.config.js
to modify:
- Application metadata
- Installer options
- Publishing targets
- Build preferences
-
Application won't start:
- Ensure Node.js version 18+ is installed
- Delete
node_modules
folder and runnpm install
again
-
Build failures:
- On Windows, ensure Windows Build Tools are installed
- On macOS, ensure Xcode Command Line Tools are installed
- On Linux, ensure required build dependencies are installed
-
Search is slow:
- Avoid searching very large directories with many small files
- Use file type filters to narrow search scope
-
No results found:
- Check that the search directory contains relevant files
- Verify search term spelling
- Try a less specific search term
- Use file type filters to significantly improve search speed
- For content searches, avoid searching binary files by filtering by type
- The application processes files in batches to prevent UI freezing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Check the troubleshooting section above
- Search existing GitHub issues
- Create a new issue with detailed information about your problem
- v1.0 (Current)
- Initial release with basic search functionality
- File name and content search modes
- File type filtering
- File opening and location revealing
- Electron Forge integration for streamlined development
Note: This application accesses your file system to perform searches. It only reads file contents when performing content searches and does not modify or transmit your files.