Version: 1.0.0
Repository: https://github.com/vam876/FastWinLog
FastWinLog is built with a clean separation between frontend and backend:
- Frontend: Pre-built React application (HTML/CSS/JS)
- Backend: Python-based API server using pywebview
- Communication: pywebview JS API bridge
┌─────────────────────────────────────┐
│ API Layer (main_api.py) │ ← Exposes methods to frontend
├─────────────────────────────────────┤
│ Service Layer │ ← Business logic
│ - LogService │
│ - EventService │
│ - SearchService │
│ - AlertService │
│ - StatisticsService │
│ - CacheService │
├─────────────────────────────────────┤
│ Repository Layer │ ← Data access
│ - SqliteRepository (cache) │
│ - MemoryRepository (runtime) │
│ - EvtxRepository (file parsing) │
├─────────────────────────────────────┤
│ Core Layer │ ← Core functionality
│ - evtx_parser (pyevtx) │
│ - alert_store │
│ - windows_events_database │
└─────────────────────────────────────┘
- main_api.py: Main API class that aggregates all services
- Exposes methods to frontend via pywebview
- log_service.py: File management and selection
- event_service.py: Event loading and pagination
- search_service.py: Search functionality
- alert_service.py: Alert rules and scanning
- statistics_service.py: Event statistics
- cache_service.py: Cache management
- sqlite_repository.py: SQLite persistent cache
- memory_repository.py: In-memory event storage
- evtx_repository.py: EVTX file parsing
- evtx_parser.py: High-performance EVTX parsing using pyevtx
- alert_store.py: Alert rule storage and management
- alert_baselines.py: Built-in security alert rules
- windows_events_database.py: Windows event descriptions
- security_presets.py: Security analysis presets
- event.py: Event data model
- log_file.py: Log file metadata
- pagination.py: Pagination parameters
- search_result.py: Search result wrapper
- progress_tracker.py: Loading progress tracking
- memory_manager.py: Memory optimization
- xml_parser.py: XML parsing utilities
The frontend is a pre-built React + TypeScript application that communicates with the backend via pywebview's JS API bridge.
Key Features:
- Modern responsive UI
- Real-time event viewing
- Advanced search and filtering
- Alert management
- Statistics visualization
- Dark theme support
Communication:
// Frontend calls Python backend
window.pywebview.api.load_events_paginated(filePath, page, pageSize)
.then(result => {
// Handle result
});User selects file
↓
Frontend calls load_events_paginated()
↓
API Layer → EventService
↓
EventService checks cache (SqliteRepository)
↓
If not cached: EvtxRepository parses file
↓
Events stored in MemoryRepository
↓
Results returned to frontend
User enters search keyword
↓
Frontend calls search_events()
↓
API Layer → SearchService
↓
SearchService queries MemoryRepository
↓
Results filtered and paginated
↓
Results returned to frontend
User triggers alert scan
↓
Frontend calls scan_alerts_from_db()
↓
API Layer → AlertService
↓
AlertService loads rules from AlertStore
↓
Events evaluated against rules
↓
Matching alerts returned to frontend
- Uses pyevtx library (59x faster than python-evtx)
- Parsing speed: ~14,767 events/second
- SQLite persistent cache for parsed events
- Instant reload on application restart
- Automatic cache invalidation on file changes
- Keeps max 2 files in memory
- Automatic cleanup of old files
- Efficient pagination to reduce memory usage
- Events loaded on-demand
- Progressive loading with progress tracking
- Background parsing doesn't block UI
- File path validation
- Search keyword sanitization
- Alert rule validation
- Maximum file size checks
- Memory usage monitoring
- Scan limit enforcement
- All processing done locally
- No external network calls
- Cache stored locally
- Create service in
services/directory - Implement business logic
- Add to
main_api.py - Expose methods to frontend
- Add rule to
core/alert_baselines.py - Define conditions and severity
- Rules automatically available in UI
- Add method to
statistics_service.py - Query events from repository
- Return aggregated data
- Frontend can display new stats
- Test individual services
- Mock repositories
- Validate business logic
- Test API layer
- Verify data flow
- Check cache behavior
- Measure parsing speed
- Monitor memory usage
- Validate search performance
Use PyInstaller to create standalone executable:
pyinstaller build-windows.specThe spec file includes:
- Python backend
- Pre-built frontend
- All dependencies
- Application icon
The compiled executable is self-contained and requires no installation:
- No Python installation needed
- No npm/Node.js needed
- All dependencies bundled
- Ready to run on any Windows system