The Automated Quantity Takeoff & BOQ Generation System is a dual-component application:
| Component | Technology | Default Port |
|---|---|---|
| Flask Backend | Python 3.11+ · Flask · ezdxf · openpyxl · reportlab | :5000 |
| React Dashboard | Node 20+ · Vite · React 18 · TailwindCSS | :5173 (dev) |
The two components run concurrently. In desktop mode, they are bundled into a single standalone .exe using PyInstaller + PyWebView.
| Dependency | Version | Purpose |
|---|---|---|
| Python | 3.11 or 3.12 | Backend engine and Flask API |
| Node.js | 20 LTS or later | Vite build toolchain for the dashboard |
| npm | 10+ (bundled with Node) | Package manager for the dashboard |
| Dependency | Version | Purpose |
|---|---|---|
| ODA File Converter | 27.1.0+ | Converts proprietary .dwg files to open .dxf format |
Download ODA File Converter free from: https://www.opendesign.com/guestfiles/oda_file_converter
Install to the default path: C:\Program Files\ODA\ODAFileConverter 27.1.0\
Note:
.dxfand.dwgfiles require it.
# Navigate to the project directory
cd E:\Users\Louis\Documents\boq_systempip install flask werkzeug ezdxf pdfplumber pypdf openpyxl reportlab pywebviewOr use the requirements file:
pip install -r dwg_import_pipeline/requirements.txtcd boq-dashboard
npm install
cd ..# Copy the example env file
copy boq-dashboard\.env.example boq-dashboard\.envEdit boq-dashboard/.env and fill in your Supabase credentials:
VITE_SUPABASE_URL=https://<your-project-ref>.supabase.co
VITE_SUPABASE_ANON_KEY=<your-anon-key>Important: Use the
anon(public) key, never theservice_rolekey in client-side code.
If Supabase is not configured, the dashboard will automatically fall back to built-in mock data.
python dwg_import_pipeline/app.pyThe API will be available at http://127.0.0.1:5000.
In a separate terminal:
cd boq-dashboard
npm run devThe dashboard will be available at http://localhost:5173.
The Vite dev server automatically proxies all
/api/*requests to Flask:5000, so no CORS configuration is needed.
- Open
http://localhost:5173in your browser. - Click ⬆ Import Drawing in the top header.
- Drag-and-drop or browse for a
.dwg,.dxf, or.pdfstructural drawing. - Click Process Drawing and watch the real-time progress bar.
- After processing completes, the BOQ table refreshes automatically.
- Click 📊 Excel to download the multi-sheet BOQ workbook.
- Click 📋 PDF to download the executive summary PDF report.
You can also generate exports without uploading a drawing — the buttons use the engine's built-in demo data if no job is active.
# Generate Excel workbook
cd E:\Users\Louis\Documents\boq_system
python parser_pipeline/boq_excel_generator.py
# Output: outputs/takeoff_boq_schedule.xlsx
# Generate PDF report
python parser_pipeline/pdf_report_generator.py
# Output: outputs/executive_boq_report.pdfpython parser_pipeline/run_full_qa_audit.py
# Output: outputs/qa/project_audit_report.mdThe audit checks:
- Script file existence for all modules
- Excel formula integrity (no
#REF!,#VALUE!, etc.) - Flask API endpoint responses (XLSX blob, PDF blob, 404 for bad IDs)
- React dashboard production bundle existence
- Log and roadmap consistency
pip install pyinstaller pywebviewpython build_desktop_app.py --vitepython build_desktop_app.py --buildThe standalone executable will be created at:
dist_desktop\BOQ_System\BOQ_System.exe
Double-click BOQ_System.exe — it will:
- Start Flask on a free local port
- Open a native Windows window (using Microsoft Edge WebView2) with the dashboard
- Close both Flask and the window cleanly on exit
WebView2 requirement: The app uses Edge WebView2, which is bundled with Windows 10 (1803+) and Windows 11. If not present, download from: https://developer.microsoft.com/microsoft-edge/webview2/
To persist BOQ data across sessions using Supabase:
- Open your Supabase Dashboard.
- Go to SQL Editor and run the contents of
boq_schema.sql. - Run the RLS policies script:
boq-dashboard/supabase/rls_policies.sql. - Seed initial data:
python seed_supabase_boq.py
boq_system/
├── boq-dashboard/ React dashboard (Vite + TailwindCSS)
│ └── src/
│ ├── App.jsx Main app (Import button, Export buttons)
│ ├── components/
│ │ ├── ImportModal.jsx Drag-drop upload with progress polling
│ │ ├── BoqTable.jsx Costed BOQ checklist with divergence flags
│ │ ├── DrawingViewer.jsx SVG CAD viewer with pan/zoom
│ │ └── ElementInspector.jsx Manual override panel
│ └── hooks/
│ ├── useProjectData.js Supabase / mock data fetching
│ └── useExport.js Flask export endpoint caller
├── dwg_import_pipeline/ Flask backend API (port 5000)
│ ├── app.py Main Flask app + CORS + export endpoints
│ ├── pipeline.py Background worker: DWG/DXF/PDF → DOM → Takeoff
│ ├── oda_converter.py ODA File Converter wrapper
│ └── pdf_processor.py PDF drawing element extractor
├── parser_pipeline/ Core engine modules
│ ├── fajardo_takeoff_engine.py Quantity computation engine
│ ├── boq_excel_generator.py Multi-sheet Excel workbook generator
│ ├── pdf_report_generator.py Executive PDF report generator
│ ├── dom_mapper.py DXF → Drawing Object Model mapper
│ └── run_full_qa_audit.py Full QA audit suite
├── boq_desktop.py Desktop launcher (Flask + PyWebView)
├── build_desktop_app.py Build orchestration script
├── boq_system.spec PyInstaller bundle specification
├── boq_schema.sql Supabase database schema
├── tech_spec.md Technical specifications
├── INSTALL.md This file
└── outputs/ Generated BOQ files
├── takeoff_boq_schedule.xlsx
├── executive_boq_report.pdf
└── qa/project_audit_report.md
| Problem | Solution |
|---|---|
ConverterNotFoundError on .dwg upload |
Install ODA File Converter to the default path |
| Dashboard shows "Setup needed" | Fill in boq-dashboard/.env with Supabase credentials |
| Export returns "Export failed" | Ensure Flask is running on port 5000 |
PyInstaller .exe crashes on launch |
Check dist_desktop/BOQ_System/ for _internal/ — do not move the .exe outside its folder |
| WebView2 missing on Windows | Download from https://developer.microsoft.com/microsoft-edge/webview2/ |
npm install fails |
Ensure Node 20+ is installed: node --version |