Skip to content

About

Tenant site for 180 Beatrice St, Toronto: parking booking, showings and applications, tenant guide, heating dashboard (Next.js on Fly.io)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Parking Booking (Next.js, Vercel)

Calendar-only booking for two spots (Northern, Southern) using Google Calendar. No DB.

Setup

  1. Enable Google Calendar API in a Google Cloud project.
  2. Create a Service Account; generate a JSON key.
  3. Share both calendars with the service account email with "Make changes to events".
  4. In Vercel Project Settings → Environment Variables, add:

API

  • POST /api/book { spot, startIso, endIso, plate } → { ref, eventId, priceCents }
  • PATCH /api/booking/[ref] { spot, startIso, endIso } → { ok }
  • DELETE /api/booking/[ref]?spot=... → { ok }
  • GET /api/availability?spot=...&start=...&end=... → { available, conflicts }

All times are in America/Toronto.

Pricing

  • $15 per 24 hours, $50 per week, $125 per month. UI shows the cheapest combination.

Notes

Showings

  • /showings: lists every unit (bookable ones first; rented ones shown with their ListingAI status).
  • /showings/<unit> (e.g. /showings/unit-3): booking page for one unit. Units, windows, listing links and the "good to know" cards live in src/lib/showingUnits.ts.
  • Visitors see only which times are open, never who booked them. One booking per email per unit.
  • After booking, visitors get a ticket with a reference code. It is remembered in their browser (localStorage) so they can come back to move or cancel; on another device they use "Manage my booking" with reference + email.
  • /showings/admin?key=...: every unit's bookings with full details and cancel.
  • Listing details (photos, price, beds/baths, highlights, contact phone/email) are pulled live from the ListingAI public API (src/lib/listingai.ts, cached 5 minutes), so edits on ListingAI show up automatically.
  • Set bookable: false on a unit to show it without bookable times (e.g. while it's rented).
  • Shared site header (src/components/SiteHeader.tsx) and the parking page theme (src/app/parking-theme.css) keep parking and showings visually consistent at one content width (960px).
  • Env: CALENDAR_ID_SHOWINGS (one calendar for all units, shared with the service account), SHOWINGS_ADMIN_KEY.
  • Double-booking is prevented by giving each unit + slot a deterministic event id (u<code>d<yyyymmdd>t<hhmm>); a second insert returns 409.

Deploying

The Vercel project is connected to this repo: pushing to main deploys to production automatically. vercel --prod from a linked checkout also works. Production env vars are managed in Vercel (Project → Settings → Environment Variables).

Hosting (since 2026-10-19)

Runs on Fly.io as app beatrice-180 (always on). Deploy with fly deploy --remote-only from this folder; the Dockerfile builds the Next.js standalone output. Secrets live in Fly (fly secrets list -a beatrice-180). /heating is a page in this app that reads its data from the camera server (cameras.andrewmcgrath.info/heating/stills/..., proxied by a rewrite in next.config.ts).

About

Tenant site for 180 Beatrice St, Toronto: parking booking, showings and applications, tenant guide, heating dashboard (Next.js on Fly.io)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages