No description
Find a file
mikl0s 3a54ba40d3 fix: update quotes route to use checkAuth, fix zod type errors
Replace getCurrentUser import with checkAuth in quotes API route.
Fix z.coerce.number() type mismatch with zodResolver in calculator
forms by using z.number() directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:01:36 +00:00
app fix: update quotes route to use checkAuth, fix zod type errors 2026-02-22 22:01:36 +00:00
components fix: update quotes route to use checkAuth, fix zod type errors 2026-02-22 22:01:36 +00:00
docs Add delivery cleanup implementation plan 2026-02-22 21:35:06 +00:00
lib feat: add rate limiting to login and quote-request endpoints 2026-02-22 21:55:40 +00:00
public Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
scripts feat: add release build script for zip delivery 2026-02-22 21:59:34 +00:00
.env.example docs: update .env.example with Office 365 SMTP and admin config 2026-02-22 21:57:11 +00:00
.gitignore Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
.prettierignore Initial implementation of Foam King Gulve price calculator 2026-01-10 14:27:28 +00:00
.prettierrc.json Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
CLAUDE.md Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
eslint.config.mjs Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
middleware.ts refactor: consolidate protected routes under /intern/* 2026-02-22 21:53:20 +00:00
next.config.ts Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
OPSÆTNING.md docs: add setup guides in English and Danish 2026-02-22 21:58:44 +00:00
package-lock.json chore: remove bcrypt dependency (auth is now env-based) 2026-02-22 21:57:24 +00:00
package.json chore: remove bcrypt dependency (auth is now env-based) 2026-02-22 21:57:24 +00:00
postcss.config.mjs Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
README.md Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
SETUP.md docs: add setup guides in English and Danish 2026-02-22 21:58:44 +00:00
tailwind.config.ts Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00
tsconfig.json Add admin dashboard, authentication, step wizard, and quote management 2026-02-22 20:59:11 +00:00

Foam King Gulve - Prisberegner

En moderne price calculator/overslagsberegner til Foam King Gulve, bygget med Next.js, TypeScript, Tailwind CSS og shadcn/ui.

🚀 Features

  • Brugervenlig prisberegner - Enkel formular hvor kunder kan indtaste gulvareal, højde og kontaktoplysninger
  • Øjeblikkelig prisberegning - Automatisk beregning af pris baseret på komplekse forretningsregler
  • Admin mode - Detaljeret visning af alle priselementer og beregninger for Foam King medarbejdere
  • Responsivt design - Virker perfekt på desktop, tablet og mobil
  • Email integration - Sender tilbudsanmodninger til Foam King
  • Dansk lokalisering - Komplette danske tekster og valuta-formatering

🏗️ Teknologi

  • Next.js 16 - React framework med App Router
  • TypeScript - Type safety
  • Tailwind CSS - Utility-first CSS framework
  • shadcn/ui - Moderne, accessible komponentbibliotek
  • React Hook Form + Zod - Formular håndtering og validering
  • Lucide React - Ikoner

🧮 Priskalkulation

Kalkulatoren beregner priser baseret på:

  • Isolering: 3.730 kr/m³ (eller 75 kr/m² simpel arbejdsløn)
  • Gulvvarme: 205 kr/m² (altid inkluderet)
  • Syntetisk net: 49 kr/m² (altid inkluderet)
  • Flydespartel: 450 kr/m² (90 kg/m²)
  • Pumpebil-tillæg: 0-8.100 kr baseret på spartelvægt
  • Startgebyr: 3.500 kr fast
  • Transport: 18,75 kr/km (tur-retur fra Asnæs)
  • Storebælt-tillæg: 500 kr (kun Fyn)
  • Procenttillæg: 0,95% (afdækning + affald)
  • Moms: 25%

🗂️ Projektstruktur

├── app/                    # Next.js App Router
│   ├── api/               # API routes
│   ├── globals.css        # Global styles + custom theme
│   ├── layout.tsx         # Root layout
│   └── page.tsx          # Homepage
├── components/
│   ├── calculator/        # Calculator-specific components
│   └── ui/               # shadcn/ui components
├── lib/
│   ├── calculations.ts    # Price calculation logic
│   ├── constants.ts       # Pricing constants
│   ├── distance.ts        # Postal code distance lookup
│   └── utils.ts          # Utilities
├── docs/                  # Project documentation
└── public/               # Static assets

🚀 Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Lint code
npm run lint

# Type check
npm run typecheck

# Format code
npm run format

🔧 Configuration

Environment Variables

Ingen environment variables er nødvendige for MVP version. I produktion:

# Email service configuration
SMTP_HOST=smtp.example.com
SMTP_USER=user@example.com
SMTP_PASS=password

# Or use a service like SendGrid, AWS SES, etc.
SENDGRID_API_KEY=your_api_key

Distance Calculation

Projektet bruger en forudberegnet tabel over afstande fra 4550 Asnæs til danske postnumre. For øget præcision kan der implementeres:

  • Google Maps Distance Matrix API
  • OpenRouteService API (gratis op til 2.000 requests/dag)

🎯 Dækningsområde

  • Sjælland: Postnummer 2000-4999
  • Lolland-Falster: Postnummer 4800-4899
  • Fyn: Postnummer 5000-5999 (+500 kr Storebælt)

📱 Admin Mode

Klik på "Vis detaljer" for at se den fulde prissopgørelse med:

  • Alle priskomponenter
  • Beregningslogik step-by-step
  • Isolerings- og transportdetaljer
  • Procenttillæg og momsberegning

🧪 Testing

Test med eksempel fra dokumentationen:

  • Areal: 50 m²
  • Højde: 20 cm
  • Postnummer: 2100 (København)
  • Forventet resultat: Ca. 95.500 kr inkl. moms

📄 Licens

Proprietary - Foam King Gulve