Getting StartedIntroduction

Introduction

Staccato Coffee is a native iOS application for Staccato Coffee House — a books, coffee, and vinyls shop in McAllen, Texas. The app enables customers to order ahead, earn loyalty rewards, and pay with Apple Pay.

What Staccato Does

  • Order Ahead — Browse the full menu, customize drinks with modifiers, and place orders for pickup
  • Loyalty Program — Earn 2 stars per $1 spent across three tiers: Green, Gold, and Platinum
  • Apple Pay — Seamless contactless payment integrated with Square
  • Staff Dashboard — Real-time order queue for employees to claim and fulfill orders
  • Admin Analytics — Revenue tracking, peak hours, top items, and employee performance

Tech Stack Overview

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   iOS App       │────▶│    Supabase      │◀────│   KDS Web       │
│   (SwiftUI)     │     │  (PostgreSQL)    │     │   (Staff)       │
└────────┬────────┘     └────────┬─────────┘     └─────────────────┘
         │                       │
         │                       │ Edge Functions
         │                       ▼
         │              ┌──────────────────┐
         └─────────────▶│   Square POS     │
                        │   (Payments)     │
                        └──────────────────┘
ComponentTechnologyPurpose
iOS AppSwift 5.9, SwiftUI, iOS 17+Customer-facing mobile app
DatabaseSupabase (PostgreSQL)Data storage, RLS, Realtime
AuthSupabase AuthApple Sign In, Google OAuth, Email
PaymentsSquare APIPayment processing
Mobile PaymentsApple Pay + PassKitContactless payments
Edge FunctionsDeno (TypeScript)process-payment, sync-square-order
ArchitectureMVVMViewModels, Services, Models

Repository Structure

staccato-ios/
├── StaccatoCoffee/
│   └── StaccatoCoffee/
│       ├── App/                    # App entry point
│       ├── Core/                   # Environment config, extensions
│       ├── Models/                 # Data models (6 files)
│       ├── Services/               # API services (9 files)
│       ├── ViewModels/             # View models (7 files)
│       └── Views/                  # SwiftUI views
│           ├── Auth/               # Login, Apple Sign In
│           ├── Home/               # Home tab, location picker
│           ├── Menu/               # Menu browsing, item detail
│           ├── Cart/               # Cart slide-over
│           ├── Checkout/           # Checkout, Apple Pay
│           ├── Rewards/            # Rewards tab
│           ├── Account/            # Profile, settings
│           └── Staff/              # Order queue, admin dashboard
├── supabase/
│   ├── schema.sql                  # Full database schema (14 tables)
│   ├── migrations/                 # 19 sequential migrations
│   └── functions/                  # Edge functions
│       ├── process-payment/        # Square payment processing
│       ├── sync-square-order/      # Order sync to Square POS
│       └── _shared/               # Shared utilities
├── docs-site/                      # This documentation site
├── README.md
└── SETUP.md

Key Numbers

  • 14 database tables with Row Level Security
  • 6 data models — Profile, MenuItem, Order, CartItem, LoyaltyAccount, Reward
  • 9 services — Auth, Menu, Order, Loyalty, Square Payment, Apple Pay, Cart Storage, Order Queue, Analytics
  • 7 view models — Auth, Menu, Cart, Checkout, Rewards, OrderQueue, Analytics
  • 3 loyalty tiers — Green (0), Gold (300), Platinum (600 lifetime stars)
  • 5 order statuses — pending, in_progress, ready, completed, cancelled