← back to Wholivedthere
INTEGRATION.md
87 lines
# Integration with stayclaim / pastdoor
The 3 new domains (`wholivedthere.com`, `claimmyaddress.com`, `bubbesblock.com`) are **surfaces of the stayclaim app**, not separate codebases.
Stayclaim has already shipped most of what the original PLAN.md sketched:
| Capability | stayclaim status |
|---|---|
| Address detail with year-stack | ✅ `/address/[slug]` |
| Map with toggleable layers (archive + filming pins) | ✅ `/map` |
| Per-film page with Wikidata+Wikipedia enrichment | ✅ `/film/[slug]` |
| Films index with filters | ✅ `/films` (kind / decade chips) |
| Locations by year chronology | ✅ `/locations-by-year` |
| Architect / person / neighborhood directory | ✅ `/architects`, `/people`, `/neighborhoods` |
| Generated SVG posters (deterministic, kind-aware) | ✅ `PosterPlaceholder.tsx` |
| LA City film permits ingest | ✅ `ingest-la-film-permits.ts` |
| BH nightly permits ingest | ✅ `ingest-bh-permits.ts` |
| LA 1978-84 FRED price data | ✅ `ingest-la-price-series.ts` |
| Wikidata + Wikipedia enrichment for entities + productions | ✅ verified live |
| Submit / Promote flows | ✅ `/submit`, `/promote` |
| 17 PG tables, 28+ components, 8 ingest scripts, sitemap, RSS | ✅ |
So my original PLAN.md 6-week build estimate is **mostly already done.**
## What the 3 new domains do
Each domain becomes a host-routed surface onto the **same** stayclaim Next.js app:
| Domain | Surface intent | Implementation |
|---|---|---|
| **wholivedthere.com** | Flagship / discovery | Default brand. Next.js detects the host header and renders the full archive shell. |
| **claimmyaddress.com** | Onboarding / CTA-led entry | Same app, but the home page redirects to `/submit` or `/claim/[slug]`. Marketing path: "Claim your address" → flows directly into stayclaim's existing claim flow. |
| **bubbesblock.com** | Community / hyperlocal | Same app, but home page redirects to `/neighborhoods` or a new `/block` route. Adds a new section for community posts when built. |
All three resolve to the same nginx + same Next.js process + same Postgres `stayclaim` DB. **One app, three doors.**
## Tech changes needed in stayclaim
Minimal — Next.js handles host-based routing trivially. Add:
1. **Middleware** in `src/middleware.ts` to detect host and rewrite the home route accordingly:
```ts
if (host === 'claimmyaddress.com') return NextResponse.rewrite('/submit');
if (host === 'bubbesblock.com') return NextResponse.rewrite('/neighborhoods');
// wholivedthere.com → no rewrite, root index page
```
2. **Per-host meta** — `<title>`, OG, canonical URLs adjust based on `host` header so each surface has its own SEO presence.
3. **Cross-promo CTAs** — the existing pastdoor app gets contextual links to sister domains:
- On `wholivedthere.com` address pages → "Claim this home on claimmyaddress.com"
- On `claimmyaddress.com` post-claim → "See history on wholivedthere.com"
- On `bubbesblock.com` neighborhood pages → both other CTAs
## Deployment plan (Kamatera)
**Deploy target:** `/root/public-projects/pastdoor/` on Kamatera (rename from `stayclaim` for prod since "pastdoor" is the brand direction).
**Stack on Kamatera:**
- `pm2 start npm --name pastdoor -- start` on port `9821`
- nginx vhost per domain (3 files, all `proxy_pass 127.0.0.1:9821`)
- Postgres `stayclaim` DB migrated from local Mac via `pg_dump | ssh root@my-server psql`
- Cloudflare proxy + LE SSL (per `/domain-setup` skill, same flow as philipperomano.com)
## Manual gates still on Steve
Same two as before, can't be automated:
1. **Cloudflare zone create** for each of the 3 domains (token scope blocks API path)
2. **Mapbox API token** for the map layer (browser auth)
Everything else is scripted below.
## Auto-execution status (this turn)
| Step | Status |
|---|---|
| Drop redundant `homedb` | ✅ done |
| Survey stayclaim project | ✅ done |
| Document integration plan | ✅ this file |
| Write deploy script | ✅ `~/Projects/wholivedthere/scripts/deploy-pastdoor.sh` |
| Write nginx vhost stubs | ✅ `~/Projects/wholivedthere/scripts/nginx/{wholivedthere,claimmyaddress,bubbesblock}.com` |
| Update CNCP entries to reflect integration | ✅ done |
| CF zone create on 3 new domains | ⛔ blocked (token scope) |
| pg_dump + scp to Kamatera | ⏸ awaits domain DNS first |
| Run deploy-pastdoor.sh | ⏸ awaits CF zones |
The infrastructure pieces below are written and ready; one `bash deploy-pastdoor.sh` call lights it all up after the manual gates clear.