SPB Git forge

spb/house-ka

Public
18commits 1branches 0releases
1.9 MBsize
maindefault branch
19 days agolast push
Python 67% TypeScript 18.2% CSS 14.4%
14.6 KB · 311 lines markdown
Rendered Raw Blame History
1# House-Ka234> ⚠️ **Application archivée le 2026-09-04** — l'URL live (https://www.house-ka.com) est hors fonction ; l'app a été retirée du cluster MacLustr (registre mld, admin-ka, gardiens, site groupe-ka). Ce dépôt spbgit reste la source de vérité pour une remise en service.5**[www.house-ka.com](https://www.house-ka.com)** — *Every home for sale. One place.*67Homes-for-sale aggregator for Canada **outside Québec**, Ontario first — a8**Groupe KA** service and the English-language sister site of9[Immo-Ka](https://www.immo-ka.com) (Québec). House-Ka continuously aggregates10homes publicly listed by Canadian real-estate brokerages, teams and national11networks, with photos, details, maps, live mortgage rates and a direct link12back to each source's original listing.1314> House-Ka is an independent aggregator: it is not a brokerage, does not15> represent buyers or sellers, and is not affiliated with the sources it16> indexes. Prices and availability are those displayed by each source.1718## At a glance (live, 2026-08-28)1920| Metric | Value |21|---|---|22| Homes published (deduplicated) | **~258,000** |23| Cities & towns | **5,991** |24| Active sources | **28** CREA DDF brokerage feeds (247 offices) |25| Average asking price | ~$913,000 (from $360 to $79M) |26| Average data completeness | 77.6 / 100 |27| Coverage | 9 provinces + 2 territories (all of Canada except Québec & Nunavut) |28| Launched | 2026-08-27 |2930---3132## Guided tour3334Ten screenshots of the live site (in `docs/screenshots/`).3536### 1 — Home: search every home in one place37[`https://www.house-ka.com/`](https://www.house-ka.com/)3839![Home page](docs/screenshots/01-accueil.jpg)4041The landing page states the mission — *"Every home for sale. One place."* —42above the live counters (homes indexed, cities & towns, average and highest43price). A scrolling ticker streams per-source volumes in real time44(Century 21 Ontario, The Cody Group, Century 21 BC…). Below, the search bar45("Where do you want to live?") combines city, property type and price-range46filters with one-tap type chips (House, Land, Condo, Townhouse, Multi-family,47Mobile home, Farm), and the result header offers sorting plus a List / Map48toggle. The pine-green / cream / serif skin is deliberately distinct from49Immo-Ka's cherry theme.5051### 2 — Property page: full listing detail52[`https://www.house-ka.com/property/c21_ab%3Ac21123293118/2-amp-72-highways-rural-rocky-view-county`](https://www.house-ka.com/property/c21_ab%3Ac21123293118/2-amp-72-highways-rural-rocky-view-county)5354![Property page](docs/screenshots/02-property-c21_ab-3Ac21123293118-2-amp-72-highways-rural-rocky.jpg)5556A listing detail page (`/property/{uid}/{slug}`) — here a $2,900,000 land57parcel in Rural Rocky View County, Alberta from the Century 21 Canada —58Alberta feed. Photo gallery on top, then asking price with the canonical type59badge, address with province, a favorites heart (KA ID accounts), breadcrumb60navigation, and a **Location** card rendered by Ka Maps with the price marker61and the listing's building/lot highlighted. The DOM order follows the Groupe62KA detail-page standard (gallery → price → description → details → analyses →63map), identical on mobile and desktop.6465### 3 — Live mortgage rates66[`https://www.house-ka.com/rates`](https://www.house-ka.com/rates)6768![Mortgage rates](docs/screenshots/03-rates.jpg)6970The `/rates` page publishes the rates **actually posted** by the big Canadian71institutions (banks, virtual lenders, monolines), collected continuously by72the shared Groupe KA mortgage engine. The market overview shows the best rate73per term (fixed 1/3/4/5/10 years, 5-year variable) with the median and 30-day74trend, plus every institution's prime rate. The comparison table lists each75product with its **kind** (posted or special offer), **freshness** and a link76to the **official source** — never an invented rate, never a stale one77without a warning.7879### 4 — Platform statistics & data quality80[`https://www.house-ka.com/stats`](https://www.house-ka.com/stats)8182![Platform statistics](docs/screenshots/04-stats.jpg)8384The `/stats` dashboard exposes the platform's own numbers live: homes for85sale, cities, average price, source count — and, unusually for a listings86site, its full **data-quality layer**: active vs published listings,87quarantine size, average completeness score, and a per-source table with88listing counts, completeness and anomaly flags. Every listing gets a89completeness score (photos, description, specs, coordinates); listings90without a plausible price or a known city are quarantined until the next91enrichment pass completes them.9293### 5 — Sources by brokerage94[`https://www.house-ka.com/agencies`](https://www.house-ka.com/agencies)9596![Brokerages](docs/screenshots/05-agencies.jpg)9798The `/agencies` registry lists every covered brokerage and team — 28 banners,99247 offices — with expandable per-banner listing counts (Century 21 Canada by100province, The Cody Group, Revel Realty, Grapevine…). Each source publishes101its board's full inventory through the CREA DDF feed; the same property102published on several sites is only counted once (deduplication by DDF103number). Clicking a source filters the search to its homes.104105### 6 — Contact106[`https://www.house-ka.com/contact`](https://www.house-ka.com/contact)107108![Contact](docs/screenshots/06-contact.jpg)109110The contact page, with the House-Ka identity and the Groupe KA footer linking111to the sister services.112113### 7 — Map view: the whole country on one map114[`https://www.house-ka.com/?view=map`](https://www.house-ka.com/?view=map)115116![Map view](docs/screenshots/07-accueil.jpg)117118The split list/map view powered by **Ka Maps** (`@groupe-ka/ka-maps`, the119shared Groupe KA Mapbox framework). Clusters show the listing count with the120approximate median price underneath; "search this area" re-queries the121viewport, and the list panel stays in sync with the markers by construction122(single `/api/listings` search backend). 2D/3D toggle, drawing tool and123geolocation included.124125### 8 — Account: KA ID single sign-on126[`https://www.house-ka.com/account`](https://www.house-ka.com/account)127128![Account](docs/screenshots/08-account.jpg)129130The `/account` page plugs into **KA ID**, the central Groupe KA identity131(groupe-ka.com): one member identifier valid across the whole ecosystem.132Signed-in users get cross-site favorites ("My Ka universe"). The footer133presents the ecosystem: Groupe-Ka portal, Immo-Ka (homes for sale in Québec),134Lou-Ka (rentals in Québec), Vrai-Prix (Québec market-value estimates).135136### 9 — Terms of use137[`https://www.house-ka.com/terms`](https://www.house-ka.com/terms)138139![Terms](docs/screenshots/09-terms.jpg)140141Terms of use — including the independent-aggregator disclaimer and the rules142for source attribution and linking back to original listings.143144### 10 — Privacy policy145[`https://www.house-ka.com/privacy`](https://www.house-ka.com/privacy)146147![Privacy](docs/screenshots/10-privacy.jpg)148149Privacy policy: what is collected (KA ID account data, favorites), what is150not, and how the analytics distinguish human traffic.151152---153154## Features155156- **Nationwide search** — by city/town (5,991 of them), property type, price157  range and free-text query; quick type chips; newest-first and price158  sorting; list or map view.159- **Programmatic SEO pages** — `/for-sale/{city}` and160  `/for-sale/{city}/{type}` city pages plus `/type/{type}` pages, all161  server-rendered with meta, JSON-LD and sitemaps (in English, `en_CA`).162- **Listing pages** — gallery, price, canonical type, specs, description,163  nearby commerce banners adapted to each province, Ka Maps location card,164  link to the original listing.165- **Live mortgage rates** — national Canadian rates with kind, freshness and166  official source per product (shared `immoka/mortgage/` engine, see167  `docs/mortgage-engine.md`).168- **Transparent statistics** — public `/stats` dashboard including the169  quality layer (quarantine, completeness, anomaly flags per source).170- **KA ID accounts & favorites** — Groupe KA single sign-on, cross-site171  favorites hub.172- **Data quality pipeline** — completeness scoring, quarantine, image audit,173  coordinate guard covering all of Canada, cross-site dedup.174175## Data & sources176177All 28 active sources are Canadian brokerage / team / network sites whose178inventories come from the **CREA DDF** feed:179180- **RealtyPress connector** (`immoka/connectors/realtypress.py`) — one181  generic connector covers every brokerage or team site running the182  RealtyPress WordPress plugin (Revel Realty, The Cody Group, Grapevine,183  Sutton Ottawa, Hanlon Realty…). Each site exposes its board's full184  inventory; cross-site duplicates are masked by DDF number185  (`external_id = ddf<id>`, dedup by `MIN(uid)`).186- **Century 21 Canada connector** (`immoka/connectors/c21_canada.py`) — one187  provincial source per region: BC, AB, SK, MB, ON, NB, NS, PE, NL, YT, NT.188  (Saskatchewan has no polygon API and is searched via ~30 cities; the189  Alberta watcher uses adaptive sleep for cycles longer than 24 h.)190191DDF list cards carry no property type: most listings get their type when192their detail page is fetched (`IMMOKA_RP_DETAIL_LIMIT` per source per sync).193Sources are declared in `data/sources.json` and the site census lives in194`data/canada_agencies.json`; the checked-in `sources.json` documents the195initial registry.196197### Canonical property types (English)198199`House, Condo, Townhouse, Semi-detached, Duplex, Triplex, Multi-family,200Cottage, Mobile home, Land, Farm, Commercial, Parking` —201see `immoka/normalize.py`.202203## Architecture204205Forked from **Immo-Ka** on 2026-08-27 (the Ontario expansion paused there206moved here — see the immo-ka repo's `docs/ONTARIO-PAUSE.md`). The Python207package keeps its historical name `immoka`.208209- **Backend** — FastAPI + SQLite (`data/immoka.db`), same pipeline as210  Immo-Ka: connectors → `ingest` → dedup → `quality` (relaxed publication211  rule: price + city; type/description enrich over time via detail passes) →212  API. Sync loop runs every 240 minutes under PM2.213- **Frontend** — React/Vite, **English**, pine/cream/serif skin (deliberately214  different from Immo-Ka's cherry). SPA routes: `/`, `/property/{uid}[/{slug}]`,215  `/rates`, `/agencies`, `/stats`, `/account`, `/contact`, `/terms`,216  `/privacy`; SEO routes `/for-sale/{city}[/{type}]` and `/type/{type}` are217  resolved server-side. Map = Ka Maps (`@groupe-ka/ka-maps`, expected at218  `../../ka-maps`).219- **SEO** — `immoka/seo.py` renders server-side HTML (meta, JSON-LD,220  sitemaps, `robots.txt`) in English.221- **Mortgage engine** — shared with Immo-Ka (`immoka/mortgage/`), national222  Canadian rates. See `docs/mortgage-engine.md`.223- **Removed vs Immo-Ka** — everything Québec-only: Hydro-Québec estimates,224  BDZI flood, RSQAQ air, gazquebec, rental registry, quartier (census),225  Vrai-Prix, movers/inspectors directories, PDF listing sheets, all QC226  connectors.227228### Repository layout229230```231run.py                  CLI entry point (sync / watch / serve / list / geocode / mortgage-sync)232immoka/                 Python package (historical name kept from the Immo-Ka fork)233  web.py                FastAPI app: API + SEO HTML + SPA fallback234  ingest.py, quality.py, normalize.py, schema.py, db.py235  seo.py                English server-side SEO (meta, JSON-LD, sitemaps)236  geocode.py, imgaudit.py, stats.py, commerces.py, poi.py237  auth.py, kaid.py, favorites.py, hubfav.py, hubprofile.py   (KA ID SSO + favorites)238  mortgage/             shared Groupe KA mortgage-rate engine (+ /api/mortgage)239  connectors/           realtypress.py, c21_canada.py, base.py, jsonld.py, _detailutil.py, _resilient.py240frontend/               React/Vite SPA (src/pages: Home, Listing, Rates, Stats, Agencies, Account, Contact, Legal)241scripts/                scouting & maintenance (scout_canada_rp*.py, gen_connector_docs.py, …)242docs/                   mortgage-engine.md, ontario-agencies.md, screenshots/243data/                   SQLite DB + live registries (not committed)244```245246## API247248| Route | Description |249|---|---|250| `GET /api/listings` | search (city, type, price, text, bbox/polygon, sort, pagination) |251| `GET /api/listings/{uid}` | full listing detail |252| `GET /api/listings.geojson` | map markers/clusters feed |253| `GET /api/facets` | cities, property types, sources facets |254| `GET /api/agencies` | brokerage/office registry with counts |255| `GET /api/stats` | live platform + quality statistics |256| `GET /api/stats/catalog`, `/dashboard`, `/report` | stats module (kacharts/kapdf, custom reports via `POST /api/stats/report/custom`) |257| `GET /api/mortgage` | live mortgage rates |258| `GET /api/commerces` | nearby commerce banners per province |259| `/api/auth`, `/api/favorites` | KA ID session + favorites |260| `GET /api/sources`, `POST /api/sync` | connector registry & manual sync |261| `GET /api/seo/resolve`, `/sitemap.xml`, `/sitemaps/{name}`, `/robots.txt` | SEO plumbing |262263## Run264265```bash266python run.py sync [source ...]   # sync listings267python run.py watch [minutes]     # sync loop (default 60 min; prod uses 240)268python run.py serve [port]        # API + frontend (default 8098)269python run.py list                # registered connectors270python run.py geocode [n]         # geocode listings missing coordinates271python run.py mortgage-sync       # collect mortgage rates272```273274`.env` (see `.env.example`, never committed): `IMMOKA_BASE_URL=https://www.house-ka.com`,275`IMMOKA_RP_DETAIL_LIMIT=<n>` (detail pages fetched per source per sync),276plus optional scraping/SSO/mortgage-engine settings.277278## Deployment279280Node **M4M64b**, `~/apps/house-ka`, PM2:281282| Process | Role |283|---|---|284| `house-ka-web` | `run.py serve` on port **8098** |285| `house-ka-sync` | `run.py watch 240` (sync loop every 4 h) |286| `house-ka-ngrok` | tunnel → **www.house-ka.com** |287288Remote-first: the repo **on the node** is the source of truth (never the289laptop copies); `origin` = spbgit, the personal git server290(`gitsrv:srv/git/house-ka.git`, bare repos on M3U96a). Edit over SSH, build,291`pm2 restart`, then commit & push from the node (agent forwarding).292293## Adding sources (rest of Canada)294295RealtyPress sites exist across Canada. Census & instructions:296`docs/ontario-agencies.md` (method transposes to any province). Add the site297to `data/canada_agencies.json` + an entry in `data/sources.json`, then298`python run.py sync <id>`. The coordinate guard covers all of Canada.299300## Groupe KA ecosystem301302House-Ka is one of the Groupe KA platforms ([groupe-ka.com](https://www.groupe-ka.com)):303Immo-Ka (homes for sale, Québec), Lou-Ka (rentals, Québec), Rent-Ka (rentals,304Canada outside Québec), Vrai-Prix (market-value estimates), Auto-Ka, Food-Ka,305Resto-Ka, Sorti-Ka, Job-Ka, Trouve-Ka, Crea-Ka, Fabri-Ka — all sharing KA ID,306the ka-ui design system, Ka Maps and the stats/PDF modules.307308## Contact309310Simon-Pierre Boucher — contact@spboucher.ai — © 2026 Groupe-Ka311