Salesforce • 5 min read

Building the Salesforce Appointment Scheduler: Architecture & Series Index

A complete architectural breakdown of the Salesforce Appointment Scheduler and the master index for our hands-on engineering series powered by the Hob CLI.

Series Overview: Welcome to the central hub for the Salesforce Appointment Scheduler development series. This article outlines the system architecture, foundational engineering principles, and serves as the living master index for every installment in the project.


Project Overview: The Real-World Challenge

When multi-location service organizations handle incoming customer requests, coordinating appointments across regional branches is notoriously difficult. Front-desk teams, contact centers, and service managers must balance several moving pieces simultaneously:

  • Proximity: Identifying the nearest physical branch to the customer’s home address without third-party geocoding latency.
  • Skill Alignment: Ensuring that branch staff possess the specific qualification required for the requested service.
  • Schedule Availability: Checking weekly shift hours, lunch breaks, and existing appointments in real time to avoid double-bookings.
  • Operational Follow-Through: Creating follow-up reminders and notifying staff immediately upon confirmation.

Salesforce Appointment Scheduler — Multi-Location Booking Platform

To solve this, we are building the Salesforce Appointment Scheduler—a multi-location appointment booking platform designed for headquarters coordination teams to manage customer service inquiries and schedule regional appointments seamlessly.

Beyond delivering functional business value, this project serves a second, equally important purpose: demonstrating modern, developer-first Salesforce DX engineering. Throughout development, we put Hob: The Salesforce House-Elf (hob) to work, eliminating repetitive boilerplate chores across schema scaffolding, permission set authoring, Apex test factories, service classes, and Lightning Web Components.


Core Architectural Principles

Too often, Salesforce applications fall into common architectural traps: reinventing standard CRM objects with custom fields, assigning System Administrator profiles during development, bundling monolithic test utilities that burn governor limits, or writing hundreds of lines of boilerplate XML by hand.

The Appointment Scheduler follows four core engineering principles:

1. Maximize Native Platform Capabilities

Before creating custom fields or code, we ask what standard Salesforce already provides:

  • Account.ShippingAddress (ShippingStreet, ShippingCity, ShippingPostalCode): Represents the branch location address. Because it is a native compound address field, Salesforce provides built-in platform geocoding (ShippingLatitude, ShippingLongitude). This enables direct SOQL DISTANCE() calculations without external mapping APIs or custom mathematical Apex loops.
  • Contact.MailingAddress: Captures customer location using standard CRM address fields.
  • Contact.AccountId: Directly associates qualified staff members with their primary branch location.
  • Task: Generates native Salesforce activities for staff follow-up (WhatId → Appointment, WhoId → Contact).

2. Least-Privilege Security from Day 1

We never build features assuming “System Administrator” rights. Every custom object, field, and controller is scoped into dedicated permission sets (Appointment_Scheduler_Operator), catching Field-Level Security (FLS) bugs in scratch orgs long before reaching production.

3. Governor-Limit-Conscious Test Hygiene

Rather than bloating execution times and burning governor limits with redundant database writes, we enforce a strict separation between in-memory unit test fixtures (build) and persisted database records (create). Pure business logic and slot calculation tests run in milliseconds without consuming DML or SOQL limits.

4. Developer Velocity with CLI Scaffolding

By pairing the official Salesforce CLI (sf) with Hob (hob), we eliminate setup click fatigue and manual XML authoring. Schema creation, permission sets, test data factories, and LWC bundles are scaffolded in seconds with deterministic metadata.


Domain Architecture & Data Model

The Appointment Scheduler domain model combines lightweight custom entities with standard CRM objects:

EntityTypePurposeKey Attributes
AccountStandard ObjectBranch Locations (RecordType: Location)ShippingAddress (native geocoding), Active__c
ContactStandard ObjectCustomers & Staff (RecordType: Customer / Location_Staff)MailingAddress, AccountId (Branch link for staff)
Service_Type__cCustom ObjectCatalog of available service offeringsName, Duration_Minutes__c, Description__c, Active__c
Staff_Service_Type__cCustom ObjectJunction mapping staff qualifications to service typesStaff__c (Lookup), Service_Type__c (Lookup), Active__c
Staff_Working_Hours__cCustom ObjectWeekly recurring shift schedules for staff membersStaff__c (Lookup), Day_of_Week__c, Start_Time__c, End_Time__c
Appointment__cCustom ObjectCore booking transaction (APT-{0000})Lookups to Customer, Location, Staff, Service Type, Start_Time__c, End_Time__c, Status__c
TaskStandard ObjectAutomated staff follow-up activityWhatId → Appointment, WhoId → Staff Contact

Entity Relationship Diagram (ERD)

  +------------------+         has staff (AccountId)         +----------------------+
  |     ACCOUNT      |------------------------------------->|       CONTACT        |
  | (Location Branch)|                                      | (Staff / Customer)   |
  +------------------+                                      +----------------------+
           |                                                           |
           | held at branch (Location__c)                              | staff skills / weekly shift
           v                                                           v
  +------------------+       service booked                 +----------------------+
  |   APPOINTMENT    |<-------------------------------------|     SERVICE_TYPE     |
  |   APT-{0000}     |                                      |   Duration_Minutes   |
  +------------------+                                      +----------------------+
           |                                                           ^
           | generates follow-up (WhatId)                              | qualified for
           v                                                           |
  +------------------+                                      +----------------------+
  |       TASK       |                                      |  STAFF_SERVICE_TYPE  |
  | (Standard CRM)   |                                      |   (Junction Skill)   |
  +------------------+                                      +----------------------+

The Master Series Index

This series walks step-by-step through every phase of building the Appointment Scheduler, sharing practical architecture patterns, real-world CLI workflows, and open-source tooling feedback.

PartTitleFocus & Key Hob WorkflowsStatus
Part 1Eliminating Salesforce XML Fatigue — CLI Schema Scaffolding with HobFoundational data model, native compound geocoding, and instant CLI schema generation (hob create object, hob create field).Published
Part 2Instant Least-Privilege Access — Generating Permission Sets with HobLeast-privilege access, multi-object security scaffolding, and universally required field FLS rules (hob create permset).Published
Part 3Standardizing Test Hygiene — In-Memory vs DML Factories with HobTaming governor limits, in-memory (build) vs database (create) test factories, and demo seeding (hob create factory, hob seed init).Published
Part 4High-Velocity TDD — Companion Test Scaffolding with HobCore domain services (CustomerService, LocationService, AvailabilityService, AppointmentService), row-locking concurrency, and proximity ranking (hob create apex --with-test).Published
Part 5Architecture by Default — Separation of Concerns with Hob TriggersLogic-less triggers, automated standard Task generation, email notifications, and cancellation lifecycle (hob create trigger).Published
Part 6Building Modern Lightning UIs Fast — Scaffolded LWCs with HobMulti-step booking wizard state machine (appointmentWizard), child component composition, and Lightning App packaging (hob create lwc).Published
Part 7One Command to Rule Them All — The Complete Dev Org Setup with HobEnd-to-end developer experience: automated scratch org provisioning, deployments, demo data seeding, and smoke testing (hob scratch new, hob hearth, hob scratch purge).Published

Quick Start & Developer Setup

If you want to explore the repository locally or deploy it to a scratch org, follow these quick steps:

With Hob, spin up a complete scratch org, deploy all metadata, assign permissions, seed realistic data, and launch your browser in a single step (see Part 7):

hob scratch new appointment-dev \
  -p Appointment_Scheduler_Operator \
  -s scripts/apex/seed.apex

Manual Step-by-Step Setup

Alternatively, you can run each step manually:

1. Deploy the Metadata

Deploy the source format metadata to your active scratch org or sandbox:

hob deploy devhub
# or using the Salesforce CLI:
sf project deploy start

2. Assign the Operator Permission Set

Grant least-privilege operator access to your testing user:

sf org assign permset -n Appointment_Scheduler_Operator

3. Seed Realistic Demo Data

Populate 4 nationwide branch locations (London Flagship, Birmingham Colmore, Manchester Deansgate, Leeds Park Row), 8 full-time and part-time staff members with varied shift patterns, regional customer contacts, service catalog offerings, and starter appointments:

sf apex run --file scripts/apex/seed.apex
# or using Hob's seed command:
hob seed --apex scripts/apex/seed.apex

4. Open the Scratch Org

hob open
# or:
sf org open

Complete Engineering Series

All seven parts of this series are now published above. Every architectural layer—from geolocation schema modeling to LWC state machines and zero-touch scratch org orchestration—is fully documented with reproducible CLI workflows and open-source code in the Salesforce Appointment Scheduler repository.

Written by Koster CX

Independent technical consultancy offering web hosting, modern web design, and custom software and Salesforce solutions.

Get in touch

Continue Reading

Related Articles

View all articles →