A desktop application built with PyQt6 that replaces the Django + React web frontend with a native desktop GUI. Features dual functionality: cost estimation calculator and AI-powered test generation.
- Interactive Canvas: Drag-and-drop block placement with real-time visual feedback
- Cost Estimation: Automatic cost calculation based on area and price per sqft
- Project Management: Save, load, and manage multiple projects
- Block Types: Customizable block types with pricing
- Real-time Updates: Instant cost and area calculations
- AI-Powered: Generate automated tests using multiple LLM providers (OpenAI, Anthropic, Google, Ollama)
- Multiple Frameworks: Support for Playwright and Selenium
- Multiple Languages: Python, JavaScript, TypeScript, Java, C#
- Project Organization: Manage test projects and generated tests
- Code Export: Copy generated tests to clipboard or save to files
- Python 3.12+
- Django 5.2.4
- PyQt6 6.6.1+
-
Clone the repository:
git clone https://github.com/ramanjansnaik/test-generator.git cd test-generator -
Install dependencies:
pip install -r pyqt6_requirements.txt
-
Run the application:
python desktop_app/main.py
# Using the build script
build_desktop.bat# Using the build script
chmod +x build_desktop.sh
./build_desktop.sh# Install dependencies
pip install -r pyqt6_requirements.txt
# Build with PyInstaller
pyinstaller precostcalc_desktop.spec --clean --noconfirmThe executable will be created in dist/PreCostCalcDesktop (Linux/macOS) or dist/PreCostCalcDesktop.exe (Windows).
desktop_app/
βββ main.py # Application entry point
βββ main_window.py # Main application window with tabs
βββ database.py # Django ORM integration
βββ calculator_tab.py # Cost calculator functionality
βββ testgen_tab.py # Test generator functionality
βββ block_types_panel.py # Block type management
βββ projects_panel.py # Project management panel
-
MainWindow: Primary interface with tabbed layout
- Cost Calculator tab
- Test Generator tab
- Side panels for quick access
-
Database Layer: Direct Django ORM access
- No REST API overhead
- Direct model manipulation
- SQLite database
-
Calculator Tab:
- Interactive canvas for block placement
- Real-time cost calculation
- Project save/load functionality
-
TestGen Tab:
- LLM provider configuration
- Test project management
- AI-powered test generation
- BlockType: Predefined block types with pricing
- Project: User projects containing blocks
- BlockInstance: Individual block placements
- LLMProvider: AI provider configurations
- TestProject: Test generation projects
- GeneratedTest: Saved generated tests
The desktop app uses Django ORM directly, bypassing the REST API:
from desktop_app.database import get_all_block_types, create_project
# Get block types
block_types = get_all_block_types()
# Create a new project
project = create_project("My Project", blocks_data)- Standard Room: $50.00/sqft
- Premium Room: $75.00/sqft
- Bathroom: $100.00/sqft
- Kitchen: $120.00/sqft
- Garage: $35.00/sqft
SQLite database: db.sqlite3
Modify precostcalc/settings.py for production deployment.
- Select block types from the left panel
- Click "Add Selected Block" to place on canvas
- Drag blocks to position them
- Adjust block dimensions in properties panel
- View real-time cost calculations
- Save projects for later use
- Configure LLM providers in the left panel
- Create a test project with website URL
- Select framework (Playwright/Selenium) and language
- Click "Generate Tests" to create tests
- Save generated tests or copy to clipboard
.
βββ desktop_app/ # PyQt6 desktop application
βββ precostcalc/ # Django settings (for database)
βββ calculator/ # Original Django models
βββ testgen/ # Test generation models
βββ build_desktop.sh # Linux/macOS build script
βββ build_desktop.bat # Windows build script
βββ precostcalc_desktop.spec # PyInstaller configuration
βββ pyqt6_requirements.txt # Python dependencies
- New Tab: Create widget in
main_window.py - Database Operations: Add functions to
database.py - UI Components: Create panels in appropriate files
# Test the application
python desktop_app/main.py
# Run database tests
python manage.py test calculatorThe application is packaged as a single executable using PyInstaller:
- No Python installation required for end users
- All dependencies included
- SQLite database bundled
- Windows:
dist/PreCostCalcDesktop.exe - Linux:
dist/PreCostCalcDesktop - macOS:
dist/PreCostCalcDesktop
- Approximately 70MB including all dependencies
- Compressed database storage
- No external Python runtime needed
The desktop app replaces:
- β Django web server
- β React frontend
- β REST API endpoints
- β Web authentication
With:
- β PyQt6 desktop interface
- β Direct Django ORM access
- β Native file system operations
- β Local data storage
- No Network Overhead: Direct database access
- Fast Startup: No web server initialization
- Native UI: Better performance and user experience
- Offline Operation: No internet connection required
- Application startup: < 5 seconds
- Canvas rendering: 60 FPS
- Cost calculation: Real-time
- Database operations: < 100ms
- SQLite database stored locally
- No network transmission of data
- User authentication via Django admin
- Stored locally in database
- Encrypted at rest
- No cloud storage
See LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues and questions:
- GitHub Issues: Repository Issues
- Documentation: This README
- Architecture: See code comments
- Dark mode theme
- Export projects to PDF
- Cloud synchronization
- Additional test frameworks
- Batch test generation
- Project templates
- PyQt6 desktop interface
- Interactive cost calculator
- AI-powered test generation
- Project management
- Single-executable packaging
- Direct ORM integration
Built with β€οΈ using PyQt6 and Django ORM