Final refactor from thickness/CML extraction to isometric drawing to Material Take-Off (MTO) generator.
- Replaced thickness/CML domain models with MTO domain models.
- Added
DrawingMeta,MTOItem,MTOSummary, and MTO-focusedExtractionResult. - Added strict category/unit enums:
PIPE,FITTING,FLANGE,VALVE,GASKET,BOLT,SUPPORTM,EA,NO,SET
- Updated mock pipeline to return a realistic sample MTO.
- Updated Gemini prompt to extract Material Take-Off from piping isometric drawings.
- Added JSON schema-style response contract in
gemini_vision.py. - Kept automatic mock fallback when
GEMINI_API_KEYis missing or live extraction fails. - Updated post-processing to:
- normalize pipe rows;
- compute pipe length totals;
- count fittings/flanges/valves/supports;
- derive gasket rows;
- derive bolt-set rows;
- compute summary cards.
- Updated CSV export to output MTO fields.
- Updated storage history metadata from point count/job details to line number/drawing number/item count.
- Updated frontend types to match backend MTO schema.
- Updated upload flow with client-side validation and local preview URL.
- Updated results UI to show:
- drawing preview;
- drawing metadata;
- MTO summary cards;
- MTO table;
- assumptions/notes/warnings;
- CSV download.
- Updated history UI to show MTO status and row counts.
- Updated README with architecture, setup, AI pipeline, assumptions, limitations and trade-offs.
- Removed generated frontend TypeScript build cache from final ZIP preparation.
- Backend test suite passes locally:
18 passed.
- Run frontend
npm installandnpm run typecheckon a machine with npm dependencies available. - Test live Gemini extraction using a real
GEMINI_API_KEY. - Take screenshots of the running app if required by the evaluator.
- Optionally deploy frontend/backend and add hosted URLs to README if submitting a hosted demo.
project/
├── frontend/
│ ├── app/
│ ├── components/
│ ├── lib/
│ └── types/
├── backend/
│ ├── app/
│ │ ├── core/
│ │ ├── models/
│ │ ├── routers/
│ │ ├── services/
│ │ └── utils/
│ ├── sample_assets/
│ └── tests/
├── README.md
├── PROJECT_PROGRESS.md
├── .env.example
└── .gitignore
| Method | Endpoint | Status |
|---|---|---|
| GET | /api/health |
Implemented |
| POST | /api/upload |
Implemented |
| POST | /api/extract |
Implemented |
| GET | /api/export/{file_id}.csv |
Implemented |
| GET | /api/history |
Implemented |
| GET | /api/results/{file_id} |
Implemented |
- Next.js App Router frontend.
- FastAPI backend.
- PDF/image upload.
- Server-side validation.
- PDF/image preprocessing.
- Gemini Vision extraction path.
- Mock pipeline fallback.
- Pydantic validation.
- MTO post-processing.
- Gasket/bolt derivation.
- Summary cards.
- CSV export.
- SQLite or in-memory storage.
- Swagger docs.
- Backend tests.
- Docker Compose.
- Excel export.
- Bounding-box overlay.
- Async job queue.
- Multi-sheet rollup.
- OCR/BOM table extraction.
- Manual correction workflow.
- Live Gemini accuracy is unverified in this environment because no real API key was used.
- Frontend typecheck was not executed here because dependencies may not be installed in the runtime.
- Cached results produced by the old thickness/CML schema are incompatible with the new MTO schema. Delete
backend/data/if reusing an old local run.
- Kept existing
upload -> extract -> exportendpoint pattern to minimize risk and preserve the working project shell. - Used synchronous extraction because the assessment scope is one drawing per upload.
- Used SQLite as default storage so local history persists across restarts.
- Used mock fallback as a first-class feature for evaluator reproducibility.
- Derived gaskets and bolt sets in post-processing because they are often not explicitly drawn but are required MTO consumables.
Run the application locally, test with the sample drawing, optionally test with a real Gemini key, capture screenshots, and prepare final submission ZIP.