44 <img src =" static/images/pixelprobe-logo.png " alt =" PixelProbe Logo " width =" 200 " height =" 200 " >
55</div >
66
7- PixelProbe is a comprehensive media file corruption detection tool with a modern web interface. It helps you identify and manage corrupted video and image files across your media libraries.
7+ PixelProbe is a comprehensive media file corruption detection tool with a modern web interface. It helps you identify and manage corrupted video, image, and audio files across your media libraries.
88
9- ** Version 2.0.53 ** fixes file-changes scanning progress tracking with smooth per-file updates and proper async database writes .
9+ ** Version 2.0.55 ** introduces a major architectural refactoring with modular components, comprehensive test suite, and improved maintainability while maintaining full API compatibility .
1010
1111## ✨ Features
1212
@@ -404,36 +404,56 @@ PixelProbe uses multiple methods to detect file corruption:
404404
405405# # Architecture
406406
407+ # ## Modular Architecture (v2.0.55+)
408+
409+ PixelProbe now features a clean, modular architecture following SOLID principles :
410+
407411` ` `
408412PixelProbe/
409- ├── app.py # Flask web application
410- ├── media_checker.py # Core corruption detection logic
411- ├── models.py # SQLAlchemy database models
412- ├── version.py # Version information
413- ├── templates/
414- │ ├── index.html # Legacy web interface
415- │ ├── index_modern.html # Modern responsive UI
416- │ └── api_docs.html # API documentation
417- ├── static/
418- │ ├── css/ # Stylesheets
419- │ │ ├── desktop.css # Desktop responsive styles
420- │ │ ├── mobile.css # Mobile responsive styles
421- │ │ └── logo-styles.css # Logo styling
422- │ ├── js/ # JavaScript
423- │ │ └── app.js # Main application logic
424- │ └── images/ # Images and icons
425- ├── tools/ # Utility scripts for maintenance
426- │ ├── README.md # Documentation for tools
427- │ └── * .py # Various fix and migration scripts
428- ├── docs/ # Documentation
429- │ └── screenshots/ # UI screenshots
430- ├── scripts/ # Development and deployment scripts
431- ├── requirements.txt # Python dependencies
432- ├── Dockerfile # Docker container configuration
433- ├── docker-compose.yml # Docker Compose setup
434- └── README.md # This file
413+ ├── app.py # Application initialization (250 lines vs 2,500+)
414+ ├── pixelprobe/ # Main package
415+ │ ├── api/ # API Route Blueprints
416+ │ │ ├── scan_routes.py # Scan endpoints (/api/scan-*)
417+ │ │ ├── stats_routes.py # Statistics endpoints (/api/stats, /api/system-info)
418+ │ │ ├── admin_routes.py # Admin endpoints (configurations, schedules)
419+ │ │ ├── export_routes.py # Export endpoints (CSV, view, download)
420+ │ │ └── maintenance_routes.py # Cleanup and file-changes operations
421+ │ ├── services/ # Business Logic Layer
422+ │ │ ├── scan_service.py # Scanning operations and orchestration
423+ │ │ ├── stats_service.py # Statistics calculations
424+ │ │ ├── export_service.py # Export functionality
425+ │ │ └── maintenance_service.py # Cleanup and monitoring
426+ │ ├── repositories/ # Data Access Layer
427+ │ │ ├── base_repository.py # Generic repository pattern
428+ │ │ ├── scan_repository.py # Scan result data operations
429+ │ │ └── config_repository.py # Configuration data operations
430+ │ └── utils/ # Shared Utilities
431+ │ ├── helpers.py # Common helper functions
432+ │ ├── decorators.py # Route decorators
433+ │ └── validators.py # Input validation
434+ ├── tests/ # Comprehensive Test Suite
435+ │ ├── conftest.py # Pytest configuration and fixtures
436+ │ ├── test_media_checker.py # Core functionality tests
437+ │ ├── unit/ # Unit tests for each component
438+ │ │ ├── test_scan_service.py
439+ │ │ ├── test_stats_service.py
440+ │ │ └── test_repositories.py
441+ │ └── integration/ # API integration tests
442+ ├── media_checker.py # Core corruption detection engine
443+ ├── models.py # SQLAlchemy database models
444+ ├── static/ # Frontend assets
445+ ├── templates/ # HTML templates
446+ └── requirements.txt # Python dependencies
435447` ` `
436448
449+ # ## Key Architectural Benefits
450+
451+ - **Separation of Concerns**: Each module has a single, well-defined responsibility
452+ - **Testability**: Components can be tested in isolation with comprehensive test coverage
453+ - **Maintainability**: Changes to one feature don't affect others
454+ - **Scalability**: Easy to add new features without modifying existing code
455+ - **API Compatibility**: All endpoints remain unchanged, ensuring backward compatibility
456+
437457# # 🛠️ Utility Tools
438458
439459The `tools/` directory contains utility scripts for database maintenance and migration tasks. These are useful for :
@@ -444,6 +464,58 @@ The `tools/` directory contains utility scripts for database maintenance and mig
444464
445465See [tools/README.md](tools/README.md) for detailed documentation on each tool.
446466
467+ # # Documentation
468+
469+ # ## API Documentation
470+ - **[API Reference](docs/api/README.md)** - Complete API documentation with endpoints, request/response examples
471+ - **[OpenAPI Specification](docs/api/openapi.yaml)** - OpenAPI 3.0 specification for API integration
472+ - **[Integration Guide](docs/examples/integration-guide.md)** - Examples for integrating PixelProbe into your workflows
473+
474+ # ## Developer Documentation
475+ - **[Developer Guide](docs/developer/README.md)** - Setup, architecture, and contribution guidelines
476+ - **[Architecture Overview](docs/ARCHITECTURE.md)** - System design and component architecture
477+ - **[Project Structure](docs/PROJECT_STRUCTURE.md)** - Detailed code organization and module descriptions
478+ - **[Performance Tuning](docs/PERFORMANCE_TUNING.md)** - Optimization guide for large-scale deployments
479+
480+ # ## API Client Examples
481+ - **[Python Client](docs/examples/python-client.py)** - Full-featured Python client with CLI
482+ - **[Node.js Client](docs/examples/nodejs-client.js)** - JavaScript/Node.js client implementation
483+ - **[Bash Client](docs/examples/bash-client.sh)** - Shell script client using curl and jq
484+
485+ # ## Quick Start Examples
486+
487+ # ### Python
488+ ` ` ` python
489+ from pixelprobe_client import PixelProbeClient
490+
491+ client = PixelProbeClient("http://localhost:5000")
492+ client.scan_directory(["/media/photos"])
493+ stats = client.get_statistics()
494+ print(f"Corruption rate: {stats['corruption_rate']}%")
495+ ` ` `
496+
497+ # ### JavaScript
498+ ` ` ` javascript
499+ const PixelProbeClient = require('./pixelprobe-client');
500+
501+ const client = new PixelProbeClient('http://localhost:5000');
502+ await client.scanDirectory(['/media/photos']);
503+ const stats = await client.getStatistics();
504+ console.log(` Corruption rate: ${stats.corruption_rate}%`);
505+ ```
506+
507+ #### Bash
508+ ``` bash
509+ # Scan directories
510+ ./pixelprobe-client.sh scan /media/photos /media/videos
511+
512+ # Get statistics
513+ ./pixelprobe-client.sh stats
514+
515+ # Export results
516+ ./pixelprobe-client.sh export results.csv
517+ ```
518+
447519## Development
448520
449521### Running in Development Mode
@@ -453,6 +525,62 @@ export FLASK_ENV=development
453525python app.py
454526```
455527
528+ ### Testing
529+
530+ PixelProbe includes a comprehensive test suite covering core functionality, services, repositories, and API endpoints.
531+
532+ #### Running Tests
533+
534+ ``` bash
535+ # Install test dependencies
536+ pip install -r requirements-test.txt
537+
538+ # Run all tests
539+ pytest
540+
541+ # Run with coverage report
542+ pytest --cov=pixelprobe --cov-report=html
543+
544+ # Run specific test categories
545+ pytest tests/unit/ # Unit tests only
546+ pytest tests/integration/ # Integration tests only
547+ pytest tests/test_media_checker.py # Core functionality tests
548+
549+ # Run with verbose output
550+ pytest -v
551+
552+ # Run with benchmark tests
553+ pytest --benchmark-only
554+ ```
555+
556+ #### Test Categories
557+
558+ - ** Unit Tests** : Test individual components in isolation
559+ - Service layer tests (scan, stats, export, maintenance)
560+ - Repository layer tests (data access patterns)
561+ - Utility function tests
562+
563+ - ** Integration Tests** : Test API endpoints and full workflows
564+ - API endpoint tests with mock data
565+ - Database integration tests
566+ - File system operation tests
567+
568+ - ** Performance Tests** : Benchmark critical operations
569+ - File scanning performance
570+ - Database query optimization
571+ - Memory usage monitoring
572+
573+ #### Writing Tests
574+
575+ When contributing, please include tests for new functionality:
576+
577+ ``` python
578+ # Example test for new feature
579+ def test_new_feature (scan_service , mock_scan_result ):
580+ result = scan_service.new_feature(mock_scan_result)
581+ assert result.status == ' success'
582+ ```
583+
456584### Adding New File Formats
457585
458586To add support for new file formats:
0 commit comments