6.0 KiB
6.0 KiB
Tilbudgivern - Project Memory
Use this file to keep AI assistants (Copilot, Claude, Cursor) aligned on project context. Reference this file explicitly in chat sessions.
Project Summary
Tilbudgivern is an AI-powered quote calculator for Danish carpenters, focused on roofing work. It uses OpenAI GPT-4 to generate professional quotes with auto-calculated materials and labor.
Mission Memory
This is the core mission and should guide product, UX, AI, and data decisions:
- Tilbudgivern must make it possible for a carpenter to stand with the customer, note a few roof measurements and short project notes, and get to a usable quote draft as fast as possible.
- The primary use case is mobile phone on site or laptop in the van, so speed, low friction, and strong defaults matter more than long forms.
- The system should reuse as much historical data as possible from both local Tilbudgivern projects and Ordrestyring history.
- Smart Packages are the operational backbone: they should be easy to choose, easy to edit, and contain realistic carpenter tasks, hours, materials, and pricing structure.
- AI should act as a carpenter-friendly writing and cleanup assistant: fix spelling and structure, turn rough notes into sharp customer-facing offer text, but never silently invent or change factual numbers.
- Every quote flow should create reusable historical learning signals, so the system gets better the more it is used.
Short version:
Fast field quote creation for carpenters, powered by reusable history, editable Smart Packages, and AI-assisted customer text.
Active Focus
- 2-minute quick quote flow for field use
- Reuse historical data from local projects + Ordrestyring in Smart Package selection
- Keep Smart Packages editable but prefilled from history
- Generate structured AI quote drafts from project/package/material/labor data
- Capture learning data from each completed quote flow
- Persist project workflow status in DB:
geometry_complete -> smart_package_complete -> review_pending -> ready_for_ordrestyring -> sent_to_ordrestyring - Show latest material pricelist freshness from persisted import logs/API in carpenter flow
Tech Stack Quick Reference
| Component | Technology | Location |
|---|---|---|
| Frontend | React 18 + Material-UI | frontend/ |
| Backend | Node.js/Express | backend/unified-server.js |
| Database | MariaDB | localhost:3306, db: tilbudgivern |
| AI | OpenAI GPT-4 | backend/src/services/openaiService.js |
| Process | PM2 | process: tilbudgivern-unified |
| Tests | Playwright, Jest | tests/, backend/__tests__/ |
Key Features
Smart Packages (15 packages)
Pre-configured roofing packages with auto-calculation:
- Tagdækning (B7, undertag, rygning)
- Tagrende & Nedløb (Lindab system)
- Tagvinduer (Velux montering)
- Brædder (vindskeder, sternbrædder)
- Specialarbejde (nedrivning, skortrende)
Roof Types (7 types)
- Sadeltag (pitched) - default
- Valmtag (hip)
- Københavnertag
- Fladtag (flat)
- Pulttag (shed)
- Tag med Kviste (dormers)
- Mansardtag
Key Context Links
Architecture & Setup
- CLAUDE.md - Claude Code instructions
- docs/README.md - Documentation index
- docs/deployment/PM2_GUIDE.md - PM2 management
- docs/MISSION.md - Product mission and North Star
Features
- docs/features/SMART_PACKAGES_COMPLETE_CATALOG.md - All 15 packages
- docs/ROOF_TYPES_IMPLEMENTATION.md - 7 roof types with SVG
- docs/CARPENTER_UX_IMPROVEMENTS.md - Recent UX work
Integrations
- docs/api/ORDRESTYRING_API_INVENTORY.md - GraphQL API status
- docs/STARK_IMPORT_IMPLEMENTATION.md - Stark material import
- docs/features/BYGMA_IMPORT_FEATURE.md - Bygma price book
Testing
- docs/UI_TESTING_SETUP.md - Playwright & Selenium
- docs/CARPENTER_AGENT_GUIDE.md - Test data generation
System
- docs/LOGGING_SYSTEM.md - Structured logging
- docs/DATABASE_BACKUP_SETUP.md - Backup configuration
Danish Terminology
| Danish | English |
|---|---|
| Tilbud | Quote/Offer |
| Tømrer | Carpenter |
| Tag | Roof |
| Materiale | Material |
| Pakke | Package |
| Pris | Price |
| Tagareal | Roof area |
| Rygning | Ridge |
| Tagrende | Rain gutter |
| Nedløb | Downspout |
| Spær | Rafters |
Common Commands
npm run dev # Dev with hot reload
npm run build # Build frontend
pm2 restart tilbudgivern-unified # Restart server
pm2 logs tilbudgivern-unified # View logs
npm run test:pw # Playwright tests
cd backend && npm test # Jest tests
Environment
Required in backend/.env:
OPENAI_API_KEY,DB_HOST,DB_USER,DB_PASSWORD,DB_NAME
Optional:
ORDRESTYRING_API_TOKEN,OPENAI_ADMIN_KEY
Business-owned OpenAI setup:
- All OpenAI usage must use the shared business account configuration, not ad hoc personal/project credentials.
- Prefer the centralized backend config helpers over direct client initialization.
Workflow state memory:
- Final Review must not force sending. A carpenter must be able to leave a quote in
ready_for_ordrestyringand return later. - Frontend status displays should prefer persisted DB/API state over hardcoded assumptions.
- Material price freshness should come from persisted import logs such as Bygma/Stark import history, not from frontend-only state.
How to Use with AI Assistants
VS Code Copilot:
@workspace use COPILOT_MEMORY.md for context. Help me with [task].
Claude Code:
Reference CLAUDE.md and COPILOT_MEMORY.md for project context.
Cursor:
See .cursorrules and COPILOT_MEMORY.md for project context.
Last updated: 2026-03-29