Back to Projects
saas

Lead Generation Platform — B2B/B2C Marketplace for Home Improvement

Lead Generation Platform — B2B/B2C Marketplace for Home Improvement

About this project

CodeChoicez delivered this full-stack SaaS platform end-to-end — from database schema and business logic to UI design and third-party integrations — on the latest .NET 10 and Blazor Server stack.

The platform connects Belgian homeowners with verified construction companies through a credit-based lead marketplace. It serves three distinct user types, each with their own isolated portal and tailored experience.


The Three Portals

Homeowner Portal

Homeowners register, describe their renovation project (roofing, solar panels, kitchen, bathroom, electrical, plumbing, etc.), upload photos, and specify their address. The system automatically validates Belgian postal addresses via the bpost Address Proofing API. Once submitted, the project enters the marketplace where matching companies can unlock contact details.

Company (Contractor) Portal

Verified Belgian construction companies register through a multi-step onboarding wizard that validates their VAT number in real time against the European VIES (VAT Information Exchange System) API. After email confirmation, they access a dashboard where they can:

  • View new leads matched to their service categories and region

  • Purchase credit packs via Stripe (fully automated online payments)

  • Spend credits to unlock homeowner contact details

  • Track accepted, unlocked, and skipped leads

  • Monitor their credit balance and full transaction history

  • Earn referral rewards when companies they referred make purchases

  • Manage their company profile, team members, and account settings

  • Set up Two-Factor Authentication (TOTP) or passwordless Passkeys

  • Switch the interface language (English, French, Dutch)

The company sidebar stays consistent across all pages — including account-management pages like Change Password, 2FA settings, and Passkey management — ensuring a professional, unbroken experience.

Admin Panel

Administrators have full visibility and control over the entire platform:

  • Dashboard with platform-wide KPIs (companies, homeowners, projects, leads, revenue)

  • Company management: search, filter by status (Active / Suspended / Awaiting email confirmation), view VAT status, manually credit accounts, suspend/reactivate companies

  • Homeowner management: browse profiles, view submitted projects

  • Project pipeline: manage the full lifecycle from Draft → Active → Distributed → Closed with lead-distribution controls

  • Statistics page: registration trends, lead conversion rates, credit transaction volume, revenue analytics

  • Legal pages editor (Privacy Policy, Cookie Policy, T&Cs, GDPR) with a rich-text WYSIWYG editor per language

  • System settings: configure credit pricing, referral reward percentages, Stripe keys, email settings, and more — all from the UI

  • Voucher & referral management

  • Category / sector / subcategory hierarchy management (EN / FR / NL)


Key Technical Features

Authentication & Security

  • ASP.NET Core Identity v3 with full email-confirmation flow

  • TOTP Two-Factor Authentication (Google Authenticator / Authy)

  • WebAuthn Passkeys — biometric/device-PIN sign-in (passwordless)

  • 14-day "Remember MFA" cookie with configurable sliding expiry

  • Role-based authorization: Admin / Company / Homeowner

  • Forgot-password / reset flow via Microsoft Graph email

Payments — Stripe Integration

  • Stripe Checkout for credit-pack purchases

  • Idempotent webhook handler (checkout.session.completed, async_payment_succeeded, failed, expired)

  • Signature verification on every webhook call

  • Double-credit guard via ExternalReference ledger check

  • Full PaymentTransaction record per purchase

Credit Ledger System

  • Immutable double-entry ledger: every transaction records BalanceBefore and BalanceAfter

  • Transaction types: Admin Credit, Lead Unlock, Refund, Adjustment, Online Purchase, Voucher, Referral

  • Referral reward system: configurable % of a referred company's purchases, bounded by an expiry window

Multilingual Support (EN / FR / NL)

  • Resource files (.resx) for static UI strings

  • EF Core–managed UiTranslations table for dynamic strings

  • Custom ITranslationService with in-memory caching

  • Per-user language preference stored in the database

  • Custom RequestCultureProvider that reads from the authenticated user's profile before falling back to browser/cookie detection

  • All three languages applied consistently: auth pages, dashboards, account management, emails, and error messages

Third-Party Integrations

  • EU VIES API — live VAT-number validation during company onboarding

  • bpost Address Proofing API — Belgian address validation

  • Microsoft Graph API (Office 365) — transactional email delivery (confirmation, password reset, lead notifications) via OAuth 2.0

  • Stripe.net — payment processing and webhook event handling

  • onFact API — invoice creation for credit purchases

  • QR-code generation for TOTP 2FA setup

Database & Data Architecture

  • SQL Server with Entity Framework Core 10 (code-first migrations)

  • 16+ domain entities: CompanyProfile, HomeownerProfile, Project, LeadDistribution, CreditTransaction, PaymentTransaction, Referral, Voucher, SystemSetting, LegalPage, UiTranslation, Sector, Category, SubCategory, Language, LookupType/Value

  • Many-to-many company membership via a CompanyUser join table

  • Owned entities (Address) embedded in parent tables

  • CSV seeder: categories, provinces, postal codes, and translations upserted from /SeedData/ CSV files on every startup (idempotent)

  • Composite PKs, unique indexes, and cascade/no-action delete rules configured to respect SQL Server multi-path cascade limits

Blazor Server Architecture

  • Hybrid SSR + Interactive Server rendering

  • SSR for Identity/account pages (requires HttpContext)

  • Interactive Server for dashboards and real-time UI

  • IHttpContextAccessor for SSR layout components (solving the cascading-parameter boundary between layouts and page components)

  • SignalR with 10 MB max message size for file uploads

  • Streaming prerender with a ReconnectModal for connection drops

File Uploads & Media

  • Photo upload for project submissions with SixLabors.ImageSharp resizing and format normalization

  • Static file serving from the /uploads/ directory

Referral System

  • Unique referral codes per company

  • Configurable reward percentage (min/max range, randomly assigned per referral at creation time)

  • Configurable reward-duration window (default 180 days)

  • Automatic reward crediting on each referred company purchase


Technology Stack

Backend / Framework

  • .NET 10 / C# 13

  • ASP.NET Core 10 (Minimal APIs + Razor Components)

  • Blazor Server (Interactive Server rendering)

  • ASP.NET Core Identity v3 (passkeys scaffolded)

  • Entity Framework Core 10

  • SignalR

Database

  • Microsoft SQL Server

  • EF Core Code-First Migrations

Frontend / UI

  • Blazor Server components (Razor)

  • Bootstrap 5 (custom "NOW UI" theme)

  • Bootstrap Icons

  • Quill.js (rich-text WYSIWYG for legal pages)

  • Custom CSS with CSS variables and scoped component styles

Third-Party Libraries / NuGet

  • Stripe.net

  • Microsoft.Graph (MS Graph SDK)

  • SixLabors.ImageSharp (image processing)

  • QRCoder (TOTP QR codes)

  • CsvHelper (CSV seeder)

  • ExcelDataReader (Excel import support)

External APIs

  • EU VIES REST API (VAT validation)

  • bpost Address Proofing API

  • Microsoft Graph / Office 365 (email)

  • Stripe (payments + webhooks)

  • onFact (invoicing)

Security

  • HTTPS enforced, HSTS in production

  • CSRF protection (AntiForgery)

  • Stripe webhook signature verification

  • Role-based route authorization

  • WebAuthn / FIDO2 (passkeys)


Screens Delivered

  1. Landing / Home Page

  2. Sign In (with passkey option)

  3. Company Dashboard (with sidebar, FR language)

  4. Change Password — with Company sidebar

  5. Two-Factor Authentication setup — with Company sidebar

  6. Passkeys management — with Company sidebar

  7. Change Email — with Company sidebar

  8. Homeowner Registration

  9. Company Registration (VAT onboarding)

  10. Admin Dashboard

  11. Admin — Company Management

  12. Admin — Homeowner Management

  13. Admin — Projects & Lead Pipeline

  14. Admin — Platform Statistics


Why This Project Stands Out

  • ✓ End-to-end real-world SaaS — not a demo or tutorial project

  • ✓ Production-grade security: 2FA, passkeys, signed webhooks, CSRF

  • ✓ Three fully isolated role portals with consistent UX

  • ✓ Stripe payments with an idempotent webhook pipeline

  • ✓ Live third-party API integrations (VIES, bpost, MS Graph, onFact)

  • ✓ True trilingual support — database-driven, per-user preference

  • ✓ Immutable credit ledger with a referral reward engine

  • ✓ CSV-driven startup seeder — zero-downtime content updates

  • ✓ Blazor SSR/Interactive hybrid — solved the HttpContext boundary challenge for layout components (IHttpContextAccessor pattern)

  • ✓ Custom UI theme built from scratch on Bootstrap 5

  • ✓ Clean domain-driven architecture: Domain, Infrastructure, Data, and Components layers with no circular dependencies

Built with

.Net BlazorEF-Core 10Asp.net Core.NET 10SQL ServerASP.NET IdentityBootstrap 5StripeMicrosoft Graph