Features: - Complete Next.js 16 app with TypeScript and Tailwind CSS - Customer-facing price calculator form with validation - Admin mode showing detailed price breakdowns - Accurate price calculations matching business requirements - Responsive design with custom shadcn/ui theme - API endpoint for quote requests - Danish postal code distance calculations - Complete test coverage against documentation examples 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
4.2 KiB
4.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
FoamKing is a Danish flooring price calculator web application for Foam King Gulve. The calculator will be hosted at beregner.foamking.dk and provides instant price estimates for floor solutions including insulation, floor heating, synthetic mesh, and self-leveling compound.
Technology Stack
Planned stack: Next.js + shadcn/ui + Tailwind CSS
- Next.js: For server-side rendering and API routes
- shadcn/ui: For accessible, customizable components
- Tailwind CSS: For styling
- Custom theme: Already defined in
docs/shadcn theme.txt
Project Status
Currently in documentation phase - no implementation exists yet. Key documentation files:
docs/projektplan.md- Complete project plan and requirementsdocs/prisbeskrivelse.md- Detailed pricing logic and formulasdocs/shadcn theme.txt- Custom shadcn theme (blue/orange color scheme)docs/foam king logo.png- Company logo
Core Requirements
Input Form Fields
- Name (required, min 2 chars)
- Email (required, valid format)
- Phone (required, 8 digits)
- Postal code (required, 4 digits Danish)
- Address (optional)
- Floor area: 25-300 m²
- Floor height: 0-100 cm
- Remarks (optional)
Price Calculation Components
- Insulation: 3,730 kr/m³ (subtract 5cm from height for concrete)
- Floor heating: 205 kr/m² (always included)
- Synthetic mesh: 49 kr/m² (always included)
- Self-leveling compound: 450 kr/m² (90 kg/m²)
- Pump truck fee: Based on compound weight (0-8,100 kr)
- Start fee: 3,500 kr fixed
- Transport: 18.75 kr/km round-trip from 4550 Asnæs
- Percentage fees: 0.95% for covering/waste
- VAT: 25%
Output
- Price estimate with ±10,000 kr variation
- Option to request binding quote (sends email to
info@foamking.dk)
Implementation Guidelines
Distance Calculation
Three options for calculating transport distance:
- Postal code table (recommended for MVP)
- OpenRouteService API (free up to 2,000 requests/day)
- Google Maps API (paid)
Coverage Areas
- 4000-4999: West Zealand
- 2000-2999: Copenhagen
- 3000-3999: North Zealand
- 4800-4899: Lolland-Falster
- 5000-5999: Funen (+500 kr Great Belt bridge fee)
Development Commands
Since this is a new project, typical Next.js commands will apply once initialized:
# Initialize project
npx create-next-app@latest . --typescript --tailwind --app
# Install shadcn/ui
npx shadcn@latest init
# Development
npm run dev
# Build
npm run build
# Start production
npm start
# Lint
npm run lint
# Type check
npm run typecheck
Key Implementation Tasks
- Create responsive form with validation
- Implement price calculation logic from
prisbeskrivelse.md - Apply custom shadcn theme from
shadcn theme.txt - Add distance calculation (start with postal code table)
- Create email functionality for quote requests
- Add error handling and loading states
- Ensure mobile-responsive design
Testing Scenarios
Test with examples from prisbeskrivelse.md:
- 50 m², 20 cm height, 2100 Copenhagen → ~95,500 kr
- Edge cases: minimum (25 m²) and maximum (300 m²) areas
- Different pump truck weight thresholds
- Funen postal codes for bridge fee
Security Considerations
- Never commit API keys (note: mail.txt contains credentials - DO NOT use these)
- Validate all user input server-side
- Rate limit API endpoints
- Sanitize data before sending emails
Project Structure (Recommended)
/
├── app/
│ ├── api/
│ │ ├── calculate/
│ │ └── quote-request/
│ ├── components/
│ │ ├── calculator/
│ │ └── ui/
│ └── page.tsx
├── lib/
│ ├── calculations.ts
│ ├── constants.ts
│ └── distance.ts
└── public/
└── foam-king-logo.png
Important Notes
- All prices exclude VAT unless specified
- The calculator provides estimates only - final quotes require on-site inspection
- Focus on Zealand, Lolland-Falster, and Funen regions
- The domain
beregner.foamking.dkpoints to185.158.133.1