Skip to content
RJoshi141Public

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Layer app icon: three product swatches, moss, sand and amber

Layer

Ingredient-smart skincare for iOS.
Scan a label, understand what's inside, and build a morning and night routine that works for your skin.

SwiftUI · SwiftData · Vision · Foundation Models · SpeechAnalyzer · WidgetKit · iOS 26

Layer's amber start screen and the scan screen


Why

Skincare labels are dense INCI lists in tiny type. Most people can't tell which of their products clash, what order to apply them in, or whether that serum from last spring is still good. Layer reads the bottle for you and turns it into something you can act on.

Under the hood it's three problems I care about: pulling structured data out of messy real-world documents, an assistant that reasons over your own data, and voice as an input. All of it runs on the phone.

What it does

Scan any label Photograph a bottle, tube or box (2 or 3 angles if the list wraps). Layer reads the ingredient list, product name, brand, type and shelf life.
Find the product photo Barcode lookup, then visual search, then a strict name match. The product is lifted off its background on device, so every photo is a clean transparent cutout.
Know what's inside Each ingredient is matched to a 242-entry database with roles, plain-English summaries and tags. Unknown ones are classified by INCI naming rules and learned for next time.
Fit your skin A 5-question profile (type, sensitivity, concerns, experience with actives, things to avoid) drives personal flags like "good for breakouts" or "has fragrance, which you wanted to avoid".
Layer it right Pick products for morning and night. Layer orders them thinnest to thickest and flags clashes, like retinol with acids, from 11 conflict rules.
Routine review An assistant explains each step, suggests swaps and gaps, and answers questions about your routine with tool calls into your shelf.
Voice check-ins "Used the retinol, skin feels tight" becomes a structured log of products, skin feel and reactions.
Expiry tracking Uses the open-jar symbol from the label, or the typical shelf life for that product type. Warns before something turns.
Your product, unfolded Every scanned product is laid out as a flat carton, like real packaging before it's folded: front, who it's for, what it does, key ingredients and watch-outs.
Widget and sharing Tonight's routine on your home screen and lock screen. Share a routine as a styled card or a plain list.

A closer look

Routine review over a looping serum clip, with an add suggestion and a tip

A second look at every routine

The routine review explains what each step does, suggests swaps for your skin, and spots gaps. Every suggestion is numbered and tagged (fix, swap, add, tip) and most come with a one-tap action, like adding the moisturizer you already own.

Ask follow-up questions, answered from your own shelf through tool calls. Without Apple Intelligence the same review runs on rules, so it works on any iPhone.

Built around your skin

A short tour explains what Layer does, then five quick questions: skin type, sensitivity, up to three concerns, experience with actives, and anything to avoid.

Those answers turn the same ingredient list into personal advice. A retinol can be "good for breakouts" for one person and "start slow" for someone new to actives. Drying alcohol near the top of the list or fragrance gets flagged when your skin is dry or sensitive.

Sensitivity question over a close-up of skin, with Sometimes selected
Night routine editor with products marked in or out

Routines that put themselves in order

Mark what goes into morning or night and Layer slots it into layering order by type, thinnest to thickest. Clashing pairs show up as a heads up before you use them.

Tonight's steps also live on your home screen and lock screen. The widget flips between morning and night on its own, and the app writes a small snapshot to a shared App Group so the widget never touches the database. Share any routine as a styled card or a plain list.

Check in by voice

"Used the retinol, skin feels tight" becomes a structured log: which products, how your skin feels, any reactions. Speech is transcribed on device with SpeechAnalyzer, then parsed by the on-device model or keyword rules.

Nothing leaves the phone.

Tour page about voice check-ins

How scanning works

photo(s) ──► Vision OCR ──┬──► INCI parser ──► ingredient DB + classifier ──┐
   │                      │                                                ├──► review ──► shelf
   │                      └──► rules + on-device LLM ──────────────────────┘
   │                           (name, brand, type, PAO, % actives)
   └──► barcode ──► Open Beauty Facts / UPCitemdb ──► Google Lens ──► subject cutout ──► product photo
  • Ingredients never touch the LLM. A deterministic parser splits the INCI list (handling 1,2-Hexanediol, Water (Aqua), words broken across lines, and lists spread over several photos), then matches each name with alias and typo-tolerant lookup. A model can't invent an ingredient that isn't on the bottle.
  • The model handles the fuzzy parts. Name, brand and category come from @Generable guided generation, so the output is typed Swift, not JSON to parse.
  • Rules first, model second. Regex and heuristics run every time and are the full fallback on devices without Apple Intelligence. The app is complete without it.
  • Human in the loop. Nothing is saved until you've reviewed and edited it.

The assistant

The routine assistant is a LanguageModelSession with three tools: the current routine, rule-based suggestions, and your whole shelf. It answers from your data instead of from general knowledge. On devices without Apple Intelligence, RoutineAdvisor produces the same review (step explanations, swaps, gaps, one-tap fixes) from rules, so the feature never disappears.

Privacy and cost

  • Your shelf, profile and check-ins live in SwiftData on the phone. No account, no backend.
  • OCR, extraction, speech, background removal and the assistant run on device.
  • Network calls are only for finding a product photo, and every source is free with no card: Open Beauty Facts, the UPCitemdb trial endpoint, and an optional SerpApi key (free tier) for Google Lens.

Design

The look borrows from quiet skincare brands rather than app templates: warm ivory paper with film grain, earthy black, one soft moss and amber glass as a rare accent. Type is three voices. Tenor Sans for product names and titles, Jost in tracked capitals for labels and buttons, and a handwritten script for small human notes. Controls are hairlines and sharp black blocks, including custom toggles, choice sheets and date fields.

Real photography and slow video carry the mood: amber light on the start screen, bottles lined up small to large while a label is read (that is layering order), and a candlelit serum clip behind the routine check. The icon is three product swatches, stacked like layers. Everything lives in Design/Theme.swift and Design/Controls.swift and adapts to dark mode.

Project structure

Layer/
├─ Scanning/        OCR, INCI parser, heuristics, LLM extraction, barcode, photo search, cutouts
├─ Ingredients/     ingredient database, classifier, conflict rules (JSON)
├─ Profile/         skin profile, onboarding and intro tour, personal fit checks
├─ Routine/         routine tab, ordering, conflict checker, editor, share card
├─ Assistant/       Foundation Models session + tools, rule-based advisor
├─ Voice/           SpeechAnalyzer recorder, check-in parser
├─ Views/           shelf, product page, add and review flows
├─ Models/          SwiftData models (Product, RoutineLog)
├─ WidgetSupport/   snapshot shared with the widget through an App Group
└─ Design/          colors, type, buttons, shared components
LayerWidget/        small, medium and lock screen widgets
LayerTests/         Swift Testing suites

Run it

Requirements: Xcode 26+, iOS 26+. A real iPhone is best since the camera and speech need hardware. Apple Intelligence is optional.

  1. Clone and open Layer/Layer.xcodeproj.

  2. In Signing & Capabilities, pick your team for both the Layer and LayerWidgetExtension targets.

  3. Both targets use the App Group group.com.ritikajoshi.layer. If you change the bundle ID, change the group in both targets and in WidgetSync.swift / LayerWidget.swift.

  4. Optional, for Google Lens photo search: create Layer/Layer/Secrets.plist with your free SerpApi key. It's gitignored.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0"><dict>
      <key>SerpApiKey</key><string>YOUR_KEY</string>
    </dict></plist>
  5. Run on your iPhone. On first launch you get a short tour, then the skin questions.

Tests

Cmd+U runs the Swift Testing suites: INCI parsing, ingredient classification, conflict rules, fit checks, check-in parsing and the routine advisor. These cover the deterministic core that everything else leans on.

Roadmap

  • Label scanning with multi-photo merge, ingredient database, shelf
  • Learned ingredients and INCI-based classifier for unknowns
  • Product photo search with on-device background removal
  • Skin profile, personal fit checks, intro tour
  • Routine builder with layering order and conflict checks
  • Routine assistant with tool calling, plus a rule-based fallback
  • Voice check-ins with SpeechAnalyzer
  • Expiry tracking
  • Home screen and lock screen widget, routine sharing
  • App Intents and Siri ("what's my routine tonight?")
  • Trends from check-ins over time

Credits

Layer gives ingredient information, not medical advice. Patch test new products and see a dermatologist for skin concerns.