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) │
└──────────────────┘| Component | Technology | Purpose |
|---|---|---|
| iOS App | Swift 5.9, SwiftUI, iOS 17+ | Customer-facing mobile app |
| Database | Supabase (PostgreSQL) | Data storage, RLS, Realtime |
| Auth | Supabase Auth | Apple Sign In, Google OAuth, Email |
| Payments | Square API | Payment processing |
| Mobile Payments | Apple Pay + PassKit | Contactless payments |
| Edge Functions | Deno (TypeScript) | process-payment, sync-square-order |
| Architecture | MVVM | ViewModels, 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.mdKey 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