Skip to content
vivienkPublic

About

Preci is a relationship-memory assistant that remembers the little things people mention and turn them into thoughtful gifts at the right time.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Preci

Preci is a relationship-memory assistant that remembers the little things people mention and turns them into thoughtful gifts at the right time.

Current prototype

The first interactive build contains the core product loop:

  1. See upcoming people and occasions.
  2. Open a recipient profile and review accumulated memories.
  3. Capture a signal as something they mentioned, liked, needed, or wanted to avoid.
  4. Review explainable gift recommendations.
  5. Choose a gift and track its preparation.

The app uses typed local fixtures for recommendations as a fallback. The people layer can import one selected contact at a time, or scan birthdays from contacts, calendars, and Google Calendar during onboarding.

Run locally

npm install
npm start

Then scan the QR code with a compatible development build or run an iOS/Android simulator.

Gift research (live)

Copy .env.local.example to .env.local and add an OpenRouter API key to enable live gift search (via Perplexity Sonar):

cp .env.local.example .env.local

Without a key, the app falls back to the fixture gift ideas for the demo profile. The key is bundled into the client at build time (EXPO_PUBLIC_...), so treat it as visible to anyone who inspects the shipped app — set a spend limit on it, and move gift search behind a backend before a public release.

Onboarding: bringing in birthdays

On first launch (and any time from People → Find birthdays) Preci offers three sources. Each is optional, all reading happens on the device, and nothing is added until the user reviews the list and confirms:

  • Contacts — Contact.getAllDetails for name + birthday only.
  • Calendars — the iOS Birthdays calendar (and any calendar whose title contains "birthday"), read with expo-calendar.
  • Google Calendar — Google sign-in with the read-only calendar.events.readonly scope, then events.list?eventTypes=birthday on the primary and contacts calendars. Preci signs out right after the import and stores no token.

These need a development or production build; Expo Go and the web preview can't run them. In dev builds, "Load sample birthdays" on the sources screen exercises the review flow without any permissions.

Google setup

  1. In Google Cloud Console, create a project and enable the Google Calendar API.
  2. Configure the OAuth consent screen (External) and add the calendar.events.readonly scope. Until Google verifies the app, only listed test users can sign in and they see an "unverified app" warning.
  3. Create an iOS OAuth client with bundle ID com.vivienkong.preci, and (for Android) a Web OAuth client.
  4. Put the client IDs in .env.local as EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID / EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID, and add the same variables as EAS environment variables so production builds get them. app.config.js derives the iOS URL scheme from the iOS client ID and only adds the Google Sign-In plugin when it is set, so builds without it still succeed.

Accounts (optional)

Sign-in is optional and lives behind Supabase. If EXPO_PUBLIC_SUPABASE_URL / EXPO_PUBLIC_SUPABASE_ANON_KEY aren't set, the app hides every account screen and works exactly as before. Apple requires the login to be optional (guideline 5.1.1(v)).

v1 ships email + Apple only, so this exists mainly to tie an Occasion Pass purchase to an account and let it follow the user to a new phone. Google and Facebook sign-in are built in src/services/auth.ts (signInWithProvider) but not surfaced in the UI — AuthPanel in App.tsx only renders email and Apple. Re-enabling either provider in the UI means offering Sign in with Apple too (guideline 4.8), which is already the case here.

Method How it works
Email + password supabase.auth.signUp / signInWithPassword. Email confirmation and password reset use a one-time code typed into the app, so no deep links are needed.
Apple Native expo-apple-authentication, then signInWithIdToken. iOS only.
Google, Facebook (built, not enabled in v1) System-browser OAuth through Supabase (signInWithOAuth + PKCE), redirecting to preci://auth-callback. No native Google/Facebook SDK is involved.

Signed-in users get their purchases tied to their account (Purchases.logIn), and Account → Delete account removes the sign-in record.

Supabase setup

  1. Create a Supabase project. Note that free projects pause after 7 days without activity, which makes every login fail until you resume it.
  2. Project settings → API: copy the URL and anon/publishable key into .env.local (and into EAS environment variables for builds).
  3. SQL editor: run supabase/delete_user.sql. Without it, account deletion fails.
  4. Authentication → URL Configuration → add preci://auth-callback to Redirect URLs.
  5. Authentication → Providers:
    • Email: enable. If "Confirm email" is on, edit the Confirm signup and Reset password email templates so they include {{ .Token }} (the 6-digit code the app asks for). Supabase's built-in email sender is heavily rate-limited, so set up custom SMTP before launch.
    • Apple: enable it and set Client IDs to com.vivienkong.preci. A native-only app needs no secret or Services ID. The expo-apple-authentication plugin adds the entitlement at build time.
    • Google, Facebook: not needed for v1 (not shown in the UI). If re-enabled later: Google needs a Web OAuth client in Google Cloud (separate from the iOS client used for the Calendar import) with its ID/secret pasted into Supabase; Facebook needs a Meta app with Facebook Login, Live status, and a public privacy policy URL before non-developers can sign in. Both need the Supabase callback URL (https://<project-ref>.supabase.co/auth/v1/callback) added as an authorized redirect URI.

Known gaps

  • Apple asks apps with Sign in with Apple to revoke Apple's tokens when an account is deleted. That needs a server function and an Apple signing key, and isn't built.
  • Nothing here has run against a live Supabase project or on a device. Only the UI states, validation, and error handling were exercised (with a deliberately unreachable backend).

Data boundaries

  • Contacts and calendars are read on the device only after the user grants permission and chooses a source. Only names and birthdays are read, and only the people the user confirms are saved.
  • Recipient memories and gifting outcomes become Preci's first-party relationship graph.
  • Personally identifying contact fields should not be passed to the recommendation model.
  • Product prices and availability must come from merchant services, never from model generation.

Next integrations

  • Manual person and occasion entry as a fallback to selected-contact import
  • Local persistence, then authenticated cloud sync
  • Structured memory extraction and recommendation service
  • Live product catalog, pricing, and availability
  • RevenueCat subscriptions and one-time Occasion Pass
  • Notifications for preparation milestones and outcome review

About

Preci is a relationship-memory assistant that remembers the little things people mention and turn them into thoughtful gifts at the right time.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages