A modern, cross-platform desktop application for quickly searching files by name or content. Built with Electron, TypeScript, and Clean Architecture principles using dependency injection (InversifyJS) for maintainable and scalable code.
- 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
- Clean Architecture: Domain-driven design with dependency injection using InversifyJS
- TypeScript: Full type safety and modern JavaScript features
- 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 with context isolation
- Dependency Injection: InversifyJS with reflect-metadata for loose coupling
- TailwindCSS: Modern utility-first CSS framework for styling
- Testing: Jest with ts-jest for TypeScript testing support
- Node.js 18 or higher
- npm or yarn package manager
-
Install dependencies:
npm install
-
Run the application in development mode:
npm start
For faster development with hot CSS reload:
npm run dev
-
Build TypeScript (optional):
npm run build
-
Run tests (optional):
npm test -
Lint code (optional):
npm run lint
-
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
Enterin search field: Start searchEscape: Stop current search (when available)
file-search/
├── src/
│ ├── core/
│ │ └── domain/
│ │ ├── entities/ # Domain entities
│ │ ├── repositories/ # Repository interfaces
│ │ └── services/ # Domain services
│ ├── infrastructure/
│ │ ├── di/ # Dependency injection container
│ │ ├── electron/ # Electron-specific implementations
│ │ └── file-system/ # File system implementations
│ ├── presentation/
│ │ └── electron-ui/ # UI layer (renderer process)
│ ├── styles/
│ │ ├── input.css # TailwindCSS source
│ │ └── output.css # Compiled styles
│ ├── index.html # Main UI structure
│ └── index.css # Legacy styles (being migrated)
├── dist/ # Compiled TypeScript output
├── package.json # Dependencies and scripts
├── forge.config.js # Electron Forge configuration
├── tsconfig.json # TypeScript configuration
├── tailwind.config.js # TailwindCSS configuration
├── CLAUDE.md # Project instructions
└── README.md # This file
npm run devRuns CSS watch mode and Electron in parallel for the fastest development experience.
npm startOptimized startup that only rebuilds CSS if needed.
| Script | Purpose | Performance |
|---|---|---|
npm run dev |
Development with hot CSS reload | ⚡ Fastest |
npm start |
Quick start (rebuilds CSS only if missing) | 🚀 Fast |
npm run dev:css |
CSS watch mode only | 🔄 Continuous |
npm run build:css:dev |
One-time CSS build for development | ⏱️ ~600ms |
npm run build:css:prod |
Minified CSS for production | 📦 Optimized |
npm run build |
Compile TypeScript | 🔨 Build |
npm test |
Run Jest tests | 🧪 Test |
npm run lint |
ESLint TypeScript code | 📝 Lint |
npm start- Start the application in development modenpm 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
Domain Layer (src/core/domain/)
entities/: Core business entities (SearchResults)repositories/: Repository interfaces for data accessservices/: Domain services with business logic
Infrastructure Layer (src/infrastructure/)
di/: Dependency injection container (InversifyJS)electron/: Electron-specific implementationsmain-process.ts: Main process with IPC handlerspreload.ts: Secure API bridgeservices/: Electron service implementations
file-system/: File system repository implementations
Presentation Layer (src/presentation/)
electron-ui/renderer.ts: UI logic and user interactions- Communicates with main process via preload script
- Handles UI state and user input validation
Core Framework
electron(37.3.1): Desktop application frameworktypescript(^5.9.2): Type-safe JavaScript superset
Architecture & DI
inversify(^7.9.0): Dependency injection containerreflect-metadata(^0.2.2): Metadata reflection for decorators
File Operations
fs-extra(^11.2.0): Enhanced file system operationschokidar(^3.6.0): Efficient file system watching
Electron Ecosystem
@electron-forge/*(^7.8.3): Development and packaging toolingelectron-store(^10.1.0): Simple data persistenceelectron-squirrel-startup(^1.0.1): Handle Squirrel events
Styling
tailwindcss(^3.4.17): Utility-first CSS framework@tailwindcss/forms(^0.5.10): Form styling utilities
Development Tools
jest(^30.0.5) +ts-jest(^29.4.1): Testing frameworkeslint+@typescript-eslint/*: Code lintingconcurrently(^9.2.1): Run multiple commands
-
Setting up the development environment:
git clone https://github.com/jhenbertgit/file-search-tool.git cd file-search-tool npm install -
Recommended Workflow:
-
Daily Development: Use
npm run devfor the best experience- Automatic CSS rebuilding on file changes
- Electron restarts automatically on main process changes
- Fastest iteration cycle
-
Quick Testing: Use
npm startfor one-off testing- Fast startup without watch overhead
- Good for testing builds or quick checks
-
Production Building: Use production scripts for final builds
npm run makefor distribution packagesnpm run packagefor platform-specific builds
-
-
Development with TypeScript:
# Compile TypeScript npm run build # Run tests npm test # Lint code npm run lint
-
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
- TypeScript source maps enabled for debugging
-
Adding new features (Clean Architecture):
- Domain: Add entities/services in
src/core/domain/ - Infrastructure: Implement repositories in
src/infrastructure/ - DI: Register services in
src/infrastructure/di/container.ts - UI: Update renderer in
src/presentation/electron-ui/ - Styling: Modify TailwindCSS in
src/styles/input.css - Main Process: Update
src/infrastructure/electron/main-process.ts - API Bridge: Expose APIs through
src/infrastructure/electron/preload.ts
- Domain: Add entities/services in
-
Package the application:
npm run package
Creates platform-specific packages in the
outdirectory. -
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
-
Slow Startup:
If startup is still slow:
- Check if
src/styles/output.cssexists - Run
npm run build:css:devmanually if needed - Use
npm run devfor development instead
- Check if
-
CSS Not Updating:
If CSS changes aren't reflected:
- Use
npm run devto enable watch mode - Or manually run
npm run build:css:devafter changes - Check Tailwind config for content path issues
- Use
-
Build Errors:
If builds fail:
- Run
npm run lintto check for code issues - Run
npm run buildto check TypeScript compilation - Check that all dependencies are installed with
npm install
- Run
-
TypeScript Errors:
- Ensure
reflect-metadatais imported in main files - Check InversifyJS container bindings
- Verify interface implementations match
- Ensure
-
Application won't start:
- Ensure Node.js version 18+ is installed
- Delete
node_modulesfolder and runnpm installagain - Check if TypeScript compilation succeeded with
npm run build
-
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
- First-time setup: ~3 seconds (includes CSS generation)
- Subsequent starts: ~1 second (CSS exists, skips rebuild)
- Development mode: Instant CSS updates with watch mode
- Production build: ~800ms (includes minification)
- TypeScript compilation: ~2-3 seconds for full build
- 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.0-beta.7 (Current)
- Clean Architecture implementation with dependency injection
- TypeScript migration for type safety
- TailwindCSS integration for modern styling
- InversifyJS dependency injection container
- Enhanced development workflow with hot CSS reload
- File name and content search modes
- File type filtering with custom extensions
- Real-time file system monitoring
- File opening and location revealing
- Search history persistence with electron-store
- Comprehensive testing setup with Jest and ts-jest
- ESLint configuration for TypeScript
- 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.
