NestLink Technical Documentation

Last updated: 2026-01-22

  • Removed browser notifications toggle from Profile.
  • Added parent1_name to User entity to allow parents to edit their primary contact name in Profile.

This document describes the complete system architecture, front end and back end design, entity schemas, business logic, workflows, and page-by-page screen flows of the NestLink application.


Table of Contents

  • System Overview
  • Architecture Diagram (conceptual)
  • Frontend Architecture
    • Global Layout & Navigation
    • Pages (screen-by-screen)
  • Backend Architecture
    • Entities (Schemas)
    • Backend Functions
    • Integrations & Secrets
  • Domain, Auth, and Security Model
  • Business Rules & Logic
    • Role-based Access
    • Application Lifecycle & Waitlist
    • Sibling Privacy Logic
    • Reviews & Moderation
    • Notifications
    • Room Parsing Workflow
  • Data Flows
  • URL Parameters & Routing
  • Future Enhancements

System Overview

NestLink helps parents discover, apply to, and manage childcare providers, while providers manage profiles, applications, and insights. The app is built on the Base44 platform with:

  • Frontend: React + Tailwind + shadcn/ui, TypeScript-like patterns (JSX), react-router-dom
  • State/Data: Base44 SDK (pre-initialized) with @tanstack/react-query in some pages
  • Backend: Base44 Entities (BaaS) + Deno functions for custom processing and notifications
  • Integrations: Push notifications (VAPID), optional emails via functions

Architecture Diagram (conceptual)

User (Browser) → React App (Pages, Components, Layout) → Base44 SDK (auth, entities, integrations) → Entities (Provider, Application, Child, Room, Review, Message, SupportTicket, etc.) → Functions (sendApplicationEmails, sendBrowserNotification, ...) → Integrations (Push notifications via VAPID)


Frontend Architecture

Global Layout & Navigation

  • File: layout (default export)
  • Wraps all pages automatically. Sidebar navigation is dynamic based on the authenticated user's role (Parent, Provider, Admin) and verification state.
  • Uses shadcn/ui Sidebar components and lucide-react icons.
  • Public pages like Home and ProviderWelcome render without the sidebar for signed-out users.
  • Provides sign-out, unread message badge, and role badge.

Key utilities:

  • createPageUrl from utils for navigation links
  • roleCheck helpers to compute dashboard URLs

Pages (screen-by-screen)

Below are the key pages and their core purpose, inputs, and outputs. Each page follows modern responsive UI patterns with Tailwind/shadcn components.

  1. Home (pages/Home)
  • Purpose: Entry/search for parents. Collects location, radius, child's age group, program type, and advanced filters. Provides sign-in and provider CTA.
  • Inputs: Postal code/address, radius, ageGroup, programType, cwelcc flag, service types, language, spotsAvailable.
  • Output: Navigates to SearchResults with query params.
  1. SearchResults (pages/SearchResults)
  • Purpose: Shows providers filtered by user criteria with distance/rating sorting.
  • Data: Providers (filtered client-side), optional geocoding of postal code, radius filter fallback via FSA.
  • Interactions: Open ProviderDetail or Apply.
  1. ProviderDetail (pages/ProviderDetail)
  • Purpose: Public provider profile with details, rooms, reviews, and application CTA.
  • Data: Provider, Room(s), Review(s); rating aggregates computed.
  • Interactions: Submit reviews (if eligible), navigate to Apply, view inspection link, gallery.
  1. Dashboard (pages/Dashboard) — Parent
  • Purpose: Parent application hub: status cards, sortable table, actions (message provider, withdraw, accept/decline offers), archive/export.
  • Data: Application records for current parent.
  • Logic: Status color/icon mapping; CSV export; modals for actions.
  1. Profile (pages/Profile) — Parent
  • Purpose: Manage parent profile, notification preferences, and child records.
  • Data: User profile; Child list (linked by parent_email); Providers list for sibling provider selection.
  • Logic: Sibling privacy sync (updates Applications to show sibling info only to matching provider), auto-recompute child age groups; browser push management.
  • CTA: "Start Your Search Today" link back to Home.
  1. Apply (pages/Apply)
  • Purpose: Start/submit application to a provider for a selected child; prevent duplicates.
  • Data: Child, Provider, and parent contact details.
  1. ApplicationConfirmation (pages/ApplicationConfirmation)
  • Purpose: Post-application confirmation screen.
  1. AfterLogin (pages/AfterLogin)
  • Purpose: Role-aware redirect after auth using query param as=parent|provider|admin.
  1. ProviderWelcome (pages/ProviderWelcome) — Provider (public onboarding landing)
  • Purpose: Introduces providers to features and guides login/claim.
  1. ProviderAccountSettings (pages/ProviderAccountSettings) — Provider
  • Purpose: Manage user info, claim/link provider profile, save public profile basics, operational settings.
  • Logic: Provider claim flow; auto or manual verification states.
  1. ProviderProfile (pages/ProviderProfile) — Provider
  • Purpose: Edit and preview public-facing provider profile (branding, about, hours, gallery) and respond to reviews.
  • Data: Provider record + Reviews.
  • Logic: Profile completeness calculation; image uploads; respond/report reviews.
  1. ProviderApplications (pages/ProviderApplications) — Provider
  • Purpose: Manage incoming applications: filter/sort, update statuses, manage availability, message parents, archive.
  • Logic: Status transitions, availability flags, notification triggers.
  1. ProviderInsights (pages/ProviderInsights) — Provider
  • Purpose: KPIs, trends, and recommendations based on applications, reviews, and profile completeness.
  1. ProviderReviews (pages/ProviderReviews) — Provider
  • Purpose: Manage parent reviews and view decision insights from ApplicationDecisionInsights.
  1. ProviderDashboard (pages/ProviderDashboard) — Provider (if verified)
  • Purpose: Quick overview (subset of Applications + Insights).
  1. ProviderVerificationPending (pages/ProviderVerificationPending)
  • Purpose: Shows verification state for providers pending manual review.
  1. AdminDashboard (pages/AdminDashboard) — Admin
  • Purpose: Admin control center: metrics and quick links.
  1. AdminSupportDashboard (pages/AdminSupportDashboard) — Admin
  • Purpose: Support tickets triage and handling.
  1. ProviderModeration (pages/ProviderModeration) — Admin
  • Purpose: Moderate provider profiles, media, messages, reviews.
  1. BookTour (pages/BookTour)
  • Purpose: Book provider tours when available.
  1. PendingApproval (pages/PendingApproval)
  • Purpose: For users awaiting admin approval.
  1. AccessDenied (pages/AccessDenied)
  • Purpose: Shown on insufficient privileges.
  1. Onboarding, ProviderOnboarding, ProviderSignup, ProviderGeocoder, TicketDetail, ProviderDecisionInsights, ProviderProfileSettings
  • Purpose: Additional flows supporting the above (specialized configuration and utilities).
  1. RoomParser (pages/RoomParser) — Admin
  • Purpose: Parses Provider.primary_capacity to create Room records and links them back to Provider.rooms.
  • Formats accepted:
    • Block: "Room Name; Age Group; Capacity; ..." (semicolon/newline separated in triplets)
    • Line: "Room Name, Age Group, Capacity" (one per line)

Backend Architecture

Entities (Schemas)

All entities include built-in fields: id, created_date, updated_date, created_by.

  1. Child
{
  "name": "Child",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Child's full name (can be 'TBD' before birth)"
    },
    "date_of_birth": {
      "type": "string",
      "format": "date",
      "description": "Date of birth (leave empty if using expected_delivery_date)"
    },
    "expected_delivery_date": {
      "type": "string",
      "format": "date",
      "description": "Expected delivery date (use when child not yet born)"
    },
    "gender": {
      "type": "string",
      "description": "Gender"
    },
    "parent_email": {
      "type": "string",
      "description": "Parent email"
    },
    "desired_start_date": {
      "type": "string",
      "format": "date",
      "description": "Desired start date for childcare"
    },
    "age_group": {
      "type": "string",
      "description": "Computed age group (Infant, Toddler, Preschool)"
    }
  },
  "required": [
    "name",
    "parent_email",
    "gender"
  ]
}
  1. Provider (includes primary_capacity)
{
  "name": "Provider",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Provider name"
    },
    "licensee_legal_name": {
      "type": "string",
      "description": "Legal name of licensee as registered with Ministry"
    },
    "verified_provider": {
      "type": "boolean",
      "default": false,
      "description": "Whether provider is verified (has linked user account)"
    },
    "age_group": {
      "type": "string",
      "description": "Age group served"
    },
    "age_groups": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Multiple age groups served (multi-select)"
    },
    "address": {
      "type": "string",
      "description": "Full address"
    },
    "postal_code": {
      "type": "string",
      "description": "Postal code"
    },
    "latitude": {
      "type": "number",
      "description": "Latitude coordinate"
    },
    "longitude": {
      "type": "number",
      "description": "Longitude coordinate"
    },
    "phone": {
      "type": "string",
      "description": "Contact phone"
    },
    "email": {
      "type": "string",
      "description": "Contact email"
    },
    "hours": {
      "type": "string",
      "description": "Hours of operation"
    },
    "hours_operation": {
      "type": "string",
      "description": "Hours of operation"
    },
    "languages": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Languages offered (multi-select)"
    },
    "program_type": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Program types offered (multi-select)"
    },
    "website": {
      "type": "string",
      "format": "uri",
      "description": "Provider website URL"
    },
    "CWELC_flag": {
      "type": "boolean",
      "default": false,
      "description": "CWELCC participant flag"
    },
    "cwelcc_participant": {
      "type": "boolean",
      "default": false,
      "description": "CWELCC participant flag (alternate)"
    },
    "description": {
      "type": "string",
      "description": "Provider description (long text)"
    },
    "gallery": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Gallery image URLs"
    },
    "gallery_attachments": {
      "type": "string",
      "description": "Gallery image attachments (file)"
    },
    "banner_url": {
      "type": "string",
      "description": "Banner image URL"
    },
    "logo_url": {
      "type": "string",
      "description": "Logo image URL"
    },
    "inspection_link": {
      "type": "string",
      "format": "uri",
      "description": "Link to inspection record"
    },
    "inspection_url": {
      "type": "string",
      "format": "uri",
      "description": "Link to inspection record (alternate)"
    },
    "google_rating": {
      "type": "number",
      "minimum": 0,
      "maximum": 5,
      "description": "Google rating"
    },
    "rating": {
      "type": "number",
      "minimum": 0,
      "maximum": 5,
      "description": "Overall rating"
    },
    "google_review_count": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of Google reviews"
    },
    "review_count": {
      "type": "integer",
      "minimum": 0,
      "description": "Total number of reviews"
    },
    "license_number": {
      "type": "string",
      "description": "License number"
    },
    "service_types": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Service types offered"
    },
    "rooms": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Linked records from Room table (Room IDs)"
    },
    "primary_capacity": {
      "type": "string",
      "description": "Raw room capacity data for parsing (format: Room Name; Age Group; Capacity per line or comma-separated)"
    },
    "has_immediate_openings": {
      "type": "boolean",
      "default": false,
      "description": "Whether provider currently has immediate openings"
    },
    "available_age_groups": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Age groups with immediate availability"
    },
    "availability_last_updated": {
      "type": "string",
      "format": "date-time",
      "description": "When availability was last updated"
    },
    "admin_status": {
      "type": "string",
      "enum": [
        "Active",
        "Pending Review",
        "Disabled"
      ],
      "default": "Active",
      "description": "Admin-controlled status of the provider"
    },
    "admin_notes": {
      "type": "string",
      "description": "Internal admin comments about the provider"
    },
    "admin_notes_updated": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of when admin notes were last updated"
    },
    "last_reviewed_by_admin": {
      "type": "string",
      "description": "User ID of the last admin to review this provider"
    },
    "updated_by_admin": {
      "type": "boolean",
      "default": false,
      "description": "Whether the provider's profile was last updated by an admin"
    },
    "admin_updated_date": {
      "type": "string",
      "format": "date-time",
      "description": "When the provider's profile was last updated by an admin"
    },
    "logo_flagged": {
      "type": "boolean",
      "default": false,
      "description": "Whether the provider's logo is flagged for moderation"
    },
    "banner_flagged": {
      "type": "boolean",
      "default": false,
      "description": "Whether the provider's banner image is flagged for moderation"
    },
    "gallery_flagged": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Array of gallery image indices that are flagged for moderation"
    },
    "tour_required": {
      "type": "boolean",
      "default": false,
      "description": "Whether a tour is required before joining waitlist"
    },
    "scheduling_link": {
      "type": "string",
      "format": "uri",
      "description": "Link to tour scheduling system (Calendly, etc.)"
    }
  },
  "required": [
    "name",
    "address",
    "postal_code"
  ]
}
  1. Room
{
  "name": "Room",
  "type": "object",
  "properties": {
    "provider_id": {
      "type": "string",
      "description": "Link to provider"
    },
    "room_name": {
      "type": "string",
      "description": "Name of the room"
    },
    "age_group": {
      "type": "string",
      "description": "Age group served (e.g., Infant, Toddler, Preschool)"
    },
    "capacity": {
      "type": "number",
      "description": "Maximum capacity"
    }
  },
  "required": [
    "provider_id",
    "room_name",
    "age_group",
    "capacity"
  ]
}
  1. Application
{
  "name": "Application",
  "type": "object",
  "properties": {
    "parent_id": {
      "type": "string",
      "description": "Link to parent user"
    },
    "child_id": {
      "type": "string",
      "description": "Link to child"
    },
    "provider_id": {
      "type": "string",
      "description": "Link to provider"
    },
    "parent_name": {
      "type": "string",
      "description": "Parent's full name at time of application"
    },
    "parent_email": {
      "type": "string",
      "description": "Parent email"
    },
    "parent_phone": {
      "type": "string",
      "description": "Parent phone"
    },
    "provider_name": {
      "type": "string",
      "description": "Name of the provider at time of application"
    },
    "provider_email": {
      "type": "string",
      "description": "Provider email at time of application"
    },
    "child_name": {
      "type": "string",
      "description": "Name of the child at time of application"
    },
    "age_group": {
      "type": "string",
      "description": "Child's age group at time of application"
    },
    "date_of_birth": {
      "type": "string",
      "format": "date",
      "description": "Child's date of birth"
    },
    "desired_start": {
      "type": "string",
      "format": "date",
      "description": "Desired start date"
    },
    "status": {
      "type": "string",
      "enum": [
        "Received",
        "Under Review",
        "Tour Scheduled",
        "Tour Required",
        "Tour Completed",
        "Waitlisted",
        "Spot Offered",
        "Accepted",
        "Declined",
        "Withdrawn"
      ],
      "default": "Received",
      "description": "Application status"
    },
    "waitlist_number": {
      "type": "number",
      "description": "Auto-assigned position in waitlist"
    },
    "notes": {
      "type": "string",
      "description": "Additional notes from parent"
    },
    "provider_notes": {
      "type": "string",
      "description": "Internal notes from provider"
    },
    "status_change_date": {
      "type": "string",
      "format": "date-time",
      "description": "Date of last status change"
    },
    "siblings_enrolled": {
      "type": "boolean",
      "default": false,
      "description": "Whether parent has other children enrolled at a provider"
    },
    "sibling_provider_id": {
      "type": "string",
      "description": "Provider ID where sibling is enrolled"
    },
    "sibling_provider_name": {
      "type": "string",
      "description": "Name of provider where sibling is enrolled"
    },
    "tour_required": {
      "type": "boolean",
      "default": false,
      "description": "Whether provider requires a tour before enrollment"
    },
    "tour_time_booked": {
      "type": "string",
      "format": "date-time",
      "description": "Scheduled tour date and time"
    },
    "tour_completed": {
      "type": "boolean",
      "default": false,
      "description": "Whether the tour has been completed"
    },
    "tour_scheduled": {
      "type": "boolean",
      "default": false,
      "description": "Whether the parent clicked the tour booking link (for external schedulers)"
    },
    "scheduling_link": {
      "type": "string",
      "description": "External scheduling link for tours"
    },
    "archived": {
      "type": "boolean",
      "default": false,
      "description": "Whether application is archived"
    }
  },
  "required": [
    "parent_id",
    "child_id",
    "provider_id",
    "parent_email",
    "desired_start"
  ]
}
  1. Review
{
  "name": "Review",
  "type": "object",
  "properties": {
    "provider_id": {
      "type": "string",
      "description": "Link to provider"
    },
    "parent_id": {
      "type": "string",
      "description": "Link to parent user"
    },
    "parent_email": {
      "type": "string",
      "description": "Parent email for reference"
    },
    "parent_initials": {
      "type": "string",
      "description": "Parent's initials (e.g., 'U.S.')"
    },
    "rating": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5,
      "description": "Star rating (1-5)"
    },
    "review_text": {
      "type": "string",
      "description": "Review content"
    },
    "provider_response": {
      "type": "string",
      "description": "Provider's reply to the review"
    },
    "response_date": {
      "type": "string",
      "format": "date-time",
      "description": "When provider responded"
    },
    "source": {
      "type": "string",
      "enum": [
        "NestLink",
        "Google"
      ],
      "default": "NestLink",
      "description": "Where the review originated"
    },
    "verified_enrollment": {
      "type": "boolean",
      "default": false,
      "description": "Whether enrollment was verified"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "hidden",
        "flagged",
        "removed"
      ],
      "default": "active",
      "description": "Review moderation status"
    },
    "moderated_status": {
      "type": "string",
      "enum": [
        "visible",
        "hidden",
        "flagged",
        "removed"
      ],
      "default": "visible",
      "description": "Current moderation status"
    },
    "moderator_notes": {
      "type": "string",
      "description": "Admin moderation notes and actions taken"
    },
    "flag_reason": {
      "type": "string",
      "description": "Reason for flagging (auto or manual)"
    },
    "flagged_by": {
      "type": "string",
      "description": "User ID who flagged the review"
    },
    "flagged_date": {
      "type": "string",
      "format": "date-time",
      "description": "When the review was flagged"
    },
    "appeal_status": {
      "type": "string",
      "enum": [
        "none",
        "submitted",
        "resolved"
      ],
      "default": "none",
      "description": "Appeal status for removed reviews"
    },
    "appeal_reason": {
      "type": "string",
      "description": "Parent's reason for appeal"
    },
    "moderated_by": {
      "type": "string",
      "description": "Admin user ID who moderated"
    },
    "moderated_date": {
      "type": "string",
      "format": "date-time",
      "description": "When admin action was taken"
    }
  },
  "required": [
    "provider_id",
    "parent_id",
    "rating",
    "review_text"
  ]
}
  1. Message
{
  "name": "Message",
  "type": "object",
  "properties": {
    "application_id": {
      "type": "string",
      "description": "Link to the application this message belongs to"
    },
    "sender_id": {
      "type": "string",
      "description": "User ID of the sender"
    },
    "sender_role": {
      "type": "string",
      "enum": [
        "parent",
        "provider"
      ],
      "description": "Role of the sender"
    },
    "sender_name": {
      "type": "string",
      "description": "Full name of the sender for display"
    },
    "recipient_id": {
      "type": "string",
      "description": "User ID of the recipient"
    },
    "message_text": {
      "type": "string",
      "description": "Message content"
    },
    "is_read": {
      "type": "boolean",
      "default": false,
      "description": "Whether the message has been read by recipient"
    },
    "read_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the message was read"
    },
    "moderated_status": {
      "type": "string",
      "enum": [
        "visible",
        "flagged",
        "removed",
        "auto_flagged"
      ],
      "default": "visible",
      "description": "Current moderation status"
    },
    "flag_reason": {
      "type": "string",
      "description": "Reason for flagging"
    },
    "flagged_by": {
      "type": "string",
      "description": "User ID who flagged the message"
    },
    "flagged_date": {
      "type": "string",
      "format": "date-time",
      "description": "When the message was flagged"
    },
    "moderator_notes": {
      "type": "string",
      "description": "Admin moderation notes and actions taken"
    },
    "moderated_by": {
      "type": "string",
      "description": "Admin user ID who moderated"
    },
    "moderated_date": {
      "type": "string",
      "format": "date-time",
      "description": "When admin action was taken"
    },
    "auto_flagged": {
      "type": "boolean",
      "default": false,
      "description": "Whether message was automatically flagged by content filters"
    }
  },
  "required": [
    "application_id",
    "sender_id",
    "sender_role",
    "sender_name",
    "recipient_id",
    "message_text"
  ]
}
  1. SupportTicket
{
  "name": "SupportTicket",
  "type": "object",
  "properties": {
    "ticket_id": {
      "type": "string",
      "description": "Auto-generated ticket ID (e.g., ST-00123)"
    },
    "parent_name": {
      "type": "string",
      "description": "Name of the user submitting the ticket"
    },
    "parent_email": {
      "type": "string",
      "description": "Email of the user"
    },
    "user_id": {
      "type": "string",
      "description": "User ID if logged in"
    },
    "issue_category": {
      "type": "string",
      "enum": [
        "Technical Issue",
        "Application Question",
        "Payment",
        "Provider Communication",
        "Other"
      ],
      "description": "Category of the issue"
    },
    "message": {
      "type": "string",
      "description": "User's message/issue description"
    },
    "status": {
      "type": "string",
      "enum": [
        "Open",
        "In Progress",
        "Closed"
      ],
      "default": "Open",
      "description": "Ticket status"
    },
    "chat_transcript": {
      "type": "string",
      "description": "Full chat transcript before escalation"
    },
    "attachment_url": {
      "type": "string",
      "description": "URL to uploaded file/screenshot"
    },
    "admin_response": {
      "type": "string",
      "description": "Admin's response to the ticket"
    },
    "admin_responder": {
      "type": "string",
      "description": "Admin who responded"
    },
    "response_date": {
      "type": "string",
      "format": "date-time",
      "description": "When admin responded"
    },
    "priority": {
      "type": "string",
      "enum": [
        "Low",
        "Medium",
        "High"
      ],
      "default": "Medium",
      "description": "Ticket priority"
    }
  },
  "required": [
    "parent_email",
    "issue_category",
    "message"
  ]
}
  1. NotificationLog
{
  "name": "NotificationLog",
  "type": "object",
  "properties": {
    "to": {
      "type": "string",
      "description": "Recipient email or phone"
    },
    "type": {
      "type": "string",
      "description": "Notification type (e.g., application_received, status_update)"
    },
    "channel": {
      "type": "string",
      "enum": [
        "email",
        "sms",
        "in_app"
      ],
      "description": "Communication channel"
    },
    "payload": {
      "type": "object",
      "additionalProperties": true,
      "description": "Notification content and metadata"
    },
    "sent_at": {
      "type": "string",
      "format": "date-time",
      "description": "When notification was sent"
    }
  },
  "required": [
    "to",
    "type",
    "channel"
  ]
}
  1. ApplicationDecisionInsights
{
  "name": "ApplicationDecisionInsights",
  "type": "object",
  "properties": {
    "application_id": {
      "type": "string",
      "description": "Link to application"
    },
    "parent_id": {
      "type": "string",
      "description": "Link to parent user"
    },
    "provider_id": {
      "type": "string",
      "description": "Link to provider"
    },
    "decision_type": {
      "type": "string",
      "enum": [
        "Accepted",
        "Declined",
        "Withdrawn"
      ],
      "description": "Type of decision made by parent"
    },
    "reason_list": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List of reasons selected by parent"
    },
    "comments": {
      "type": "string",
      "description": "Optional additional comments from parent"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "When the decision was made"
    }
  },
  "required": [
    "application_id",
    "parent_id",
    "provider_id",
    "decision_type"
  ]
}

Note: User entity is built-in with id, full_name, email, role (admin|user) and app-specific fields (e.g., app_role) saved via base44.auth.updateMe.

Backend Functions

  • sendApplicationEmails (functions/sendApplicationEmails): Dispatches emails and browser notifications on key application events. Validates auth and logs failures gracefully.
  • sendBrowserNotification (functions/sendBrowserNotification): Helper endpoint for push.
  • determineApplicationStatus, calculateWaitlist, calculateWaitlistNumber, recalculateAllWaitlists, getRecipientInfo, getProviderUserId, backfillParentNames, fixHistoricMessages: Administrative/maintenance and business-logic helpers.

Integrations & Secrets

  • Push Notifications: Uses VAPID keys (VAPID_PRIVATE_KEY is set; frontend stores public key and subscription on user).
  • App Connectors: None authorized yet.

Domain, Auth, and Security Model

  • Auth: base44.auth.me / isAuthenticated from SDK. Redirects handled in pages like AfterLogin and Profile.
  • Roles: Parent, Provider, Admin. Additional flags (provider_verification_status, admin_approved) refine access.
  • Sidebar items and protected pages rely on role checks (components/roleCheck).
  • Data access: Frontend calls are user-scoped; functions can use service role cautiously when needed.

Business Rules & Logic

  1. Role-based Access
  • Admin-only: RoomParser, moderation pages, some dashboards.
  • Provider-only: ProviderApplications, ProviderProfile, ProviderInsights, reviews management; some require provider_verification_status === "verified".
  • Parent-only: Dashboard, Profile, application actions.
  1. Application Lifecycle
  • Status flow: Received → Under Review → (Tour Required → Tour Scheduled → Tour Completed) → Waitlisted / Spot Offered → Accepted/Declined → Withdrawn (terminal).
  • Waitlist Logic:
    • "Received": Assigned if provider has immediate openings for the child's age group (and tour is completed/not required).
    • "Waitlisted": Assigned if no immediate openings exist for the child's age group.
    • Note: Previous restriction requiring desired start date to be within 60 days has been removed.
  • Waitlist numbers computed via functions; status_change_date tracked.
  1. Sibling Privacy Logic (Profile)
  • User-level siblings_enrolled + sibling_provider_id maintained.
  • On profile save, all Applications for the parent are updated so that sibling info is visible only to the matching provider; others get sibling fields cleared.
  1. Reviews & Moderation
  • Providers can respond; admins can moderate (status/masked/removed), reasons logged.
  • Decision insights derived from ApplicationDecisionInsights.
  1. Notifications
  • Email and browser push for: application submitted, status changes, offers, messages.
  • Browser push: subscription saved on user, send via function with VAPID.
  1. Room Parsing Workflow
  • Source field: Provider.primary_capacity (string).
  • Parser (Admin page) reads all Providers:
    • Parses into triplets (room_name, age_group, capacity) either by semicolon/newline blocks or per-line CSV.
    • Creates Room records: { provider_id, room_name, age_group, capacity }.
    • Updates Provider.rooms with created Room IDs.
  • Validation: Skips providers without primary_capacity; records per-provider results.

Data Flows

  • Search Flow: Home → SearchResults (query params) → ProviderDetail → Apply → ApplicationConfirmation.
  • Parent Profile Flow: Profile (user + child) → Application sync on sibling info changes.
  • Provider Flow: ProviderAccountSettings (claim) → ProviderVerificationPending (until verified) → ProviderDashboard → ProviderApplications/ProviderProfile/ProviderInsights.
  • Admin Flow: AdminDashboard → ProviderModeration / AdminSupportDashboard → RoomParser (when needed).

URL Parameters & Routing

  • AfterLogin: ?as=parent|provider|admin for role-intent routing.
  • SearchResults: postal_code, radius, age_group, program_type, cwelcc, service_type (multi), language, spots_available.
  • ProviderDetail / Apply: commonly accept provider id via URLSearchParams (implementation may vary per page).

Future Enhancements

  • Add direct links to TechnicalDocs in sidebar (role-agnostic).
  • Expand analytics and A/B experiments for search and conversion.
  • Add import tools for providers (CSV → primary_capacity prefill).

End of Document.