Skip to main content

MVP.0 - Foundation + One-Way Distribution

Timeline: Weeks 1-10 Status: In Design Business Value: Single source of truth for properties, automated Hostaway distribution


Overview

MVP.0 establishes the foundational platform where property managers can manage their villa portfolio centrally and automatically distribute listings to Hostaway. This is a one-way sync (TVL → Hostaway) with manual retry capabilities.


Core Capabilities

1. Authentication & Access

  • Google SSO (OIDC with PKCE)
  • Server-side sessions with secure cookies
  • Role-based access control (RBAC)
  • 4 roles: Owner, ChannelPublisher, ContentManager, Viewer

2. Multi-Tenancy

  • Organization management
  • Account (sub-tenant) management
  • User membership system
  • Org-level data isolation

3. Supply Management

  • Space CRUD (physical properties)
  • Unit CRUD (bookable inventory)
  • Basic amenity management
  • Media URLs (no upload pipeline)
  • Unit versioning and snapshots

4. Channel Distribution

  • Hostaway channel target configuration
  • Unit → Hostaway listing mapping
  • One-way sync (TVL → Hostaway)
  • Idempotent sync with payload hashing
  • Manual retry mechanism
  • Per-target rate limiting

5. Observability

  • Structured JSON logging
  • Basic metrics (sync success rate, latency)
  • Audit trail for sync operations
  • Sync status dashboard

Domains Implemented

DomainScopePriority
Identity & TenancyFullCRITICAL
Authorization & AccessRBAC onlyCRITICAL
SupplyBasic CRUDCRITICAL
Channels & DistributionOne-way syncCRITICAL
Analytics & AuditBasic loggingHIGH

Database Schema (14 Tables)

Identity & Tenancy (5 tables)

  1. organizations - Top-level tenant boundary
  2. accounts - Sub-tenants within org
  3. users - Person identity (email-based)
  4. memberships - User → Org/Account + Role
  5. sessions - Server-side session storage

Authorization (2 tables)

  1. roles - Permission bundles (admin, ops, etc.)
  2. permissions - Action registry

Supply (3 tables)

  1. spaces - Physical properties (villas)
  2. units - Bookable inventory
  3. unit_snapshots - Version history

Channels (3 tables)

  1. channel_targets - Hostaway site connections
  2. channel_listings - Unit → Listing mappings
  3. outbound_audit - Sync operation logs

Analytics (1 table)

  1. audit_events - System-wide audit trail

Functional Requirements

FR-1: Google SSO Authentication

  • Given: User visits TVL admin console
  • When: User clicks "Sign in with Google"
  • Then: OIDC auth code + PKCE flow initiated
  • And: Session created with secure cookies
  • And: User auto-provisioned as Viewer on first login

FR-2: Organization & Account Management

  • Given: User with Owner role
  • When: Creates new organization
  • Then: Default account auto-created
  • And: Creator assigned admin membership
  • And: All subsequent resources scoped to org_id + account_id

FR-3: Space and Unit Management

  • Given: User with ContentManager role
  • When: Creates or updates Unit
  • Then: Unit record persisted with version increment
  • And: Unit snapshot created with diff hash
  • And: Change logged to audit trail

FR-4: Channel Target Setup

  • Given: User with Owner role
  • When: Adds Hostaway channel target
  • Then: API token stored in Secrets Manager
  • And: Reference saved in channel_targets table
  • And: Health check scheduled

FR-5: Unit → Hostaway Linking

  • Given: User with ChannelPublisher role
  • When: Links Unit to Hostaway target
  • Then: channel_listing record created
  • And: Sync job enqueued
  • And: Status shown as "pending"

FR-6: One-Way Sync Execution

  • Given: Sync job for (unit, target) pair
  • When: Worker processes job
  • Then: Payload built from current Unit state
  • And: Idempotency key computed (sha256 of version + target)
  • And: HTTP PUT to Hostaway API (if payload hash changed)
  • And: Response logged to outbound_audit
  • And: channel_listing status updated
  • And: Retry scheduled on failure (max 3 attempts)

FR-7: Rate Limiting

  • Given: Multiple sync jobs for same target
  • When: Worker attempts requests
  • Then: Per-target limiter enforces ≤12 req/10s
  • And: 429 responses trigger fixed delay (5s)
  • And: Failed jobs retried up to max attempts

FR-8: Manual Retry

  • Given: Failed sync visible in dashboard
  • When: Operator clicks "Retry"
  • Then: New sync job enqueued
  • And: Retry count incremented
  • And: Status updated to "pending"

FR-9: Sync Status Dashboard

  • Given: User with any role
  • When: Views sync status page
  • Then: List of all channel_listings shown
  • And: Status, last_synced_at, error_message displayed
  • And: Retry button for failed syncs
  • And: Audit log accessible

Non-Functional Requirements

NFR-1: Performance

  • Sync latency: <1 minute for single Unit
  • API response time: <500ms (p95)
  • Database queries: <100ms (p95)

NFR-2: Reliability

  • Sync success rate: 99%+
  • Zero data loss on sync failures
  • Idempotent operations (safe retries)

NFR-3: Security

  • Cookies: HttpOnly, Secure, SameSite=Lax
  • API tokens: Secrets Manager only
  • Session rotation on role changes
  • Audit all sensitive operations

NFR-4: Scalability

  • Support 10+ properties in MVP.0
  • Support 1 Hostaway target
  • Prepare for 100+ properties in MVP.1

Technical Architecture

Stack

  • Backend: Node.js 20+ with TypeScript
  • Framework: Express.js
  • Database: PostgreSQL 15+
  • Queue: BullMQ + Redis
  • Auth: Google OIDC (Passport.js)
  • Secrets: AWS Secrets Manager or GCP Secret Manager
  • Deployment: Docker + Kubernetes

Key Design Decisions

DecisionChoiceRationale
AuthGoogle SSO onlySimplest MVP, deferred email/password
SessionsServer-sideBetter security, session revocation
SyncOne-way (TVL → Hostaway)Defer booking ingestion to MVP.1
IdempotencyPayload hashPrevent duplicate API calls
Rate LimitingPer-target limiterAvoid 429s, continue other targets
RetryFixed delay (5s)Simple, defer jitter to MVP.1
SnapshotsSimple audit logDefer diff UI to MVP.1

Success Metrics

MetricTargetMeasurement
Properties managed10+Count in spaces table
Sync success rate99%+outbound_audit success %
Sync latency<1 minTime from update to Hostaway
Zero data loss100%No failed syncs without retry
User adoption3+ active userssessions table

Out of Scope (Deferred)

Deferred to MVP.1

  • Two-way sync (Hostaway → TVL)
  • Booking ingestion
  • Availability calendar
  • Pricing display

Deferred to MVP.2

  • Multi-channel (Airbnb, VRBO)
  • Conflict detection
  • Advanced retry logic (jitter)

Deferred to V1.0

  • Direct bookings
  • Payment processing
  • Dynamic pricing
  • Guest portal

Dependencies

External Dependencies

  • Google OIDC (cloud.google.com/identity)
  • Hostaway API (docs.hostaway.com)
  • Secrets Manager (AWS or GCP)

Internal Dependencies

  • None (greenfield)

Risks & Mitigation

RiskImpactProbabilityMitigation
Hostaway API rate limitsHIGHMEDIUMPer-target limiters, monitoring
Google SSO downtimeHIGHLOWClear error messages, retry logic
Database schema changesMEDIUMMEDIUMVersioned migrations, no breaking changes
Security vulnerabilitiesHIGHLOWOWASP checklist, security review

Acceptance Criteria

  • User can sign in with Google
  • User can create Organization and Accounts
  • User can create Spaces and Units
  • User can add Hostaway channel target
  • User can link Unit to Hostaway
  • Sync job automatically triggers on Unit update
  • Sync completes successfully to Hostaway
  • Sync status visible in dashboard
  • Failed sync can be manually retried
  • All operations logged to audit trail
  • 10+ test properties syncing successfully

Delivery Plan

Week 1-2: Foundation

  • Database schema creation
  • Migrations
  • Google SSO integration
  • Session management

Week 3-4: Supply Management

  • Space/Unit CRUD APIs
  • Unit snapshots
  • Basic admin UI

Week 5-6: Supply UI

  • Space/Unit forms
  • Media URL management
  • Amenity selection

Week 7-8: Channel Integration

  • Hostaway connector
  • Channel target management
  • Listing mapping
  • Sync job queue

Week 9: Testing & Hardening

  • Integration tests
  • Load testing
  • Security review
  • Bug fixes

Week 10: Launch Prep

  • Documentation
  • Runbooks
  • Staging validation
  • Production deployment