All Systems Operational
v1.0

Overview

Di Gusto is a luxury Italian lifestyle platform delivering AI-powered culinary storytelling. It provides subscribers with interactive stories, curated recipes, wine guides, and rich cultural content — all infused with cutting-edge generative AI for imagery, video, and music.

The platform spans iOS, Android, and Web, built on a modern serverless stack that prioritises performance, scalability, and a premium user experience.

Internal documentation This wiki is intended for Di Gusto engineers and contributors. It covers architecture decisions, development setup, API contracts, and deployment runbooks.

Platform Highlights

AI-Powered Content
Imagen, Veo, and Lyria generate bespoke visuals, video, and music via Vertex AI.
Google Cloud
Multi-Platform
Single Expo codebase runs natively on iOS, Android, and Web.
Expo 52
Flexible Payments
Stripe powers web subscriptions; StoreKit handles native iOS billing.
Stripe + StoreKit
Headless CMS
Sanity CMS manages editorial content with real-time previews.
Sanity
Realtime Database
Supabase provides Postgres with RLS, realtime subscriptions, and Auth.
Supabase
Edge Performance
Cloudflare CDN with Vercel edge hosting for sub-100ms TTFB globally.
Cloudflare + Vercel

Architecture

Di Gusto follows a multi-tier architecture with clear separation between client, API, data, and AI layers. All services communicate over HTTPS; sensitive operations are gated behind Supabase RLS policies and Edge Function authorization.

Layer Technology Notes
Frontend React Native Expo ~52 TypeScript Universal app — iOS, Android, Web. Web build deployed to Vercel.
Backend / DB Supabase PostgreSQL 15 RLS Project ID: hvzvoihvmvbcagtspmwu. Edge Functions for server-side logic.
AI / Media Vertex AI Imagen 3 Veo 2 Lyria All AI calls proxied through Supabase Edge Functions to protect GCP credentials.
CMS Sanity v3 Project ID: kuho1qzi. Hosted at cms.digusto.ai.
Payments Stripe StoreKit 2 Stripe for web subscriptions + token purchases. StoreKit for native iOS IAP.
CDN / DNS Cloudflare Proxies all subdomains under digusto.ai. SSL managed by Cloudflare.
Hosting Vercel Expo EAS Vercel for web; Expo EAS Build + Submit for native app stores.
CI / CD GitHub Actions Automated deploy on push to main, dev, staging branches.

Data Flow

Client requests flow through Cloudflare's CDN to either the Vercel edge (web) or directly to Supabase (API). AI generation requests are always server-side via Edge Functions — never client-direct — to protect GCP credentials and enforce rate limiting.

Client
Expo App
Cloudflare
CDN + WAF
Supabase
Auth + API
Edge Fn
Deno Runtime
Vertex AI
GCP
Security principle GCP service account credentials are stored exclusively in Supabase Vault. The client SDK never has direct access to Vertex AI endpoints.

Setup

Prerequisites

ToolVersionInstall
Node.js 20+ nodejs.org or nvm install 20
Expo CLI latest npm install -g expo-cli
Supabase CLI latest brew install supabase/tap/supabase
Git 2.x+ System package manager
Xcode (iOS) 15+ Mac App Store — required for iOS simulator

Local Development

1
Clone the repository
git clone https://github.com/digusto/digusto-app.git
cd digusto-app
2
Install dependencies
npm install --legacy-peer-deps
The --legacy-peer-deps flag is required due to React Native peer dependency constraints in Expo 52.
3
Configure environment variables
cp .env.example .env.local
Populate all required values (see Environment Variables below).
4
Start the development server
npx expo start
Press w for web, i for iOS simulator, a for Android emulator.

Environment Variables

Variable Description Required
SUPABASE_URL Supabase project URL (e.g. https://hvzvoihvmvbcagtspmwu.supabase.co) Required
SUPABASE_ANON_KEY Public anon key — safe to expose to clients Required
SANITY_PROJECT_ID Sanity project ID: kuho1qzi Required
SANITY_DATASET Usually production Required
STRIPE_PK Stripe publishable key (starts with pk_) Required
EXPO_PUBLIC_APP_ENV development | staging | production Optional
SENTRY_DSN Sentry error tracking DSN Optional
Never commit secrets The .env.local file is gitignored. Never commit SUPABASE_SERVICE_ROLE_KEY, GCP credentials, or Stripe secret keys to version control.

API & Edge Functions

Server-side business logic is implemented as Supabase Edge Functions (Deno runtime). They are deployed to https://hvzvoihvmvbcagtspmwu.supabase.co/functions/v1/.

Core Edge Functions

generate-image
Calls Vertex AI Imagen 3 to generate recipe or story imagery. Accepts a text prompt and style parameters.
POST
generate-video
Invokes Veo 2 for short-form video clips. Async — returns a job ID to poll.
POST
stripe-webhook
Handles Stripe webhook events (subscription created/cancelled, payment intent).
POST
verify-receipt
Verifies StoreKit 2 App Store receipts and provisions subscription entitlements.
POST
referral-process
Credits token bonuses when a referred user completes their first subscription.
POST
content-fetch
Server-side Sanity query with personalisation applied (user preferences + subscription tier).
GET

Authentication

All Edge Functions validate the Supabase JWT from the Authorization: Bearer <token> header. Unauthenticated requests receive 401. Admin-only functions additionally check the user role claim.

// Client-side call example
const { data, error } = await supabase.functions.invoke('generate-image', {
  body: {
    prompt: 'Rustic Sicilian arancini on marble, golden hour',
    style: 'editorial',
    aspectRatio: '16:9',
  },
});

Rate Limiting

AI generation endpoints are rate-limited per user tier: Free (5/day), Subscriber (50/day), Premium (unlimited). Limits are enforced in the Edge Function using a Redis-backed counter in Supabase.

Components

The component library is documented and previewed at sb.digusto.ai (Storybook). Below is an overview of the major component categories.

StoryCard
Full-bleed card for interactive stories. Supports video background, AI-generated imagery, and deep-link navigation.
content
RecipeBlock
Rich recipe display with ingredient list, steps, nutrition info, and AI image gallery.
content
WineGuide
Interactive wine pairing guide with sommelier notes and region maps.
content
SubscribeSheet
Bottom sheet for subscription upsell. Conditionally renders Stripe Elements or StoreKit paywall.
payments
TokenBalance
Displays user's AI generation token balance with animated deduction on use.
ui
AuthGate
HOC that wraps protected screens. Redirects to login and returns to original route post-auth.
auth
MediaPlayer
Expo AV-based player for AI-generated video and Lyria music tracks.
media
SanityPortableText
Renders Sanity Portable Text blocks with custom serialisers for Di Gusto content types.
cms

Design System

Di Gusto uses a custom design system with IBM Plex Sans as the primary typeface. The palette centres on warm gold (#e4d5b7) on deep zinc (#09090b) for a premium feel. Component tokens are defined in constants/theme.ts.

export const theme = {
  colors: {
    bg: '#09090b',
    gold: '#e4d5b7',
    goldDim: '#b8a88a',
    text: '#fafafa',
    textMuted: '#71717a',
  },
  radii: { sm: 6, md: 12, lg: 20, full: 9999 },
  spacing: { xs: 4, sm: 8, md: 16, lg: 24, xl: 40 },
};

Database

Supabase project ID: hvzvoihvmvbcagtspmwu — hosted on ap-southeast-1. PostgreSQL 15 with Row Level Security enforced on all user-scoped tables.

Schema Overview

user_profiles
Extended user data — display name, avatar, tier, token balance, referral code.
store_products
Catalogue of subscription plans and token packs with Stripe + StoreKit IDs.
subscriptions
Active subscriptions linked to user and product. Includes renewal date, status, platform.
token_transactions
Immutable ledger of all token credits and debits. References source event.
referral_codes
Unique referral codes per user with usage count and reward rules.
referrals
Tracks referral conversions between referrer and referred user.
user_preferences
Content personalisation settings — cuisine preferences, dietary requirements, notification opt-ins.
section_config
CMS-driven home feed section ordering and display rules per user tier.
section_media
Media assets (AI-generated or uploaded) associated with feed sections.

RLS Policies

All tables use auth.uid()-based policies. Users can only read and write their own rows. Service role is used exclusively from Edge Functions for cross-user operations (e.g. referral crediting).

-- Example: users can only read their own profile
CREATE POLICY "user_profiles_select"
  ON user_profiles
  FOR SELECT USING (auth.uid() = id);

CREATE POLICY "user_profiles_update"
  ON user_profiles
  FOR UPDATE USING (auth.uid() = id);

Migrations

# Apply pending migrations to remote Supabase
supabase db push

# Generate migration from local schema diff
supabase db diff --use-migra -f my_migration_name

# Run migrations locally (requires Docker)
supabase start
supabase db reset

Deployment

Web (Vercel)

1
Build the web bundle
npm run build:web
Outputs to dist/. Expo uses Metro bundler with web target.
2
Deploy to Vercel
vercel --prod
CI deploys automatically on push to maindigusto.ai. Feature branches get preview URLs.

Mobile (Expo EAS)

# Build for iOS (App Store distribution)
eas build --platform ios --profile production

# Build for Android
eas build --platform android --profile production

# Submit to App Store
eas submit --platform ios

GitHub Actions CI

Pushes to main, dev, and staging trigger the following pipeline:

Push
git push
Lint & Test
eslint + jest
Build Web
expo build
Deploy
vercel --prod
Live
digusto.ai
Branch → environment mapping main deploys to digusto.ai (production)  ·  staging deploys to staging.digusto.ai  ·  dev deploys to dev.digusto.ai

Supabase Edge Functions

# Deploy all edge functions
supabase functions deploy

# Deploy single function
supabase functions deploy generate-image

# Tail function logs
supabase functions logs generate-image --scroll

Subdomains

All subdomains are served under digusto.ai, managed via Cloudflare DNS. Web properties are hosted on Vercel; non-web services use CNAME or A records to their respective providers.

digusto.ai Production web app — Expo Web build via Vercel Production
dev.digusto.ai Development preview — tracks dev branch Dev
staging.digusto.ai Staging preview — tracks staging branch Staging
cms.digusto.ai Sanity Studio — editorial content management Live
creator.digusto.ai Creator portal — content partner dashboard Live
sb.digusto.ai Storybook — component library and design system Live
wiki.digusto.ai Developer wiki — you are here This site

DNS Configuration

All subdomains point to Vercel via CNAME records with Cloudflare proxy disabled (dns_only) so Vercel can manage TLS certificates.

# All web subdomains
*.digusto.ai  CNAME  cname.vercel-dns.com  (dns_only)

# Sanity (hosted by Sanity.io)
cms.digusto.ai  CNAME  cms.sanity.io