Skip to content
hha297Public

About

Trackwise is a mobile-first nutrition and fitness app. Log meals, scan barcodes, train from an exercise library, set personal goals, and review progress — in one place.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

53 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trackwise

Trackwise

Nutrition & fitness tracking — on your phone
Food diary · Barcode scan · Workouts · Widgets · Goals · Progress
Free on Android · Estimates, not medical measurements

Live Download

Expo React Native TypeScript Supabase TanStack Query Locales

About Features Setup Config Privacy


What is Trackwise?

Trackwise is a mobile-first nutrition and fitness app. Log meals, scan barcodes, train from an exercise library, set personal goals, and review progress — in one place.

Diary Calories & macros vs your targets Scan Open Food Facts lookup — not AI OCR Train Library, templates, sets & estimated burn Own data RLS-backed data · export / delete

Who it’s for: people who want everyday food and training awareness with clear estimates — not a medical device, and not AI meal recognition.

Availability today: free core tracking on Android via Google Play. Home-screen Daily and Workout widgets are included. iOS is planned for later.


Key features

Area Highlights
Food diary Log meals by search, recent foods, custom entries, or barcode. Daily calories, protein, carbs, fat vs targets.
Barcode scan Camera scan for product barcodes (EAN / UPC). Lookup via Open Food Facts; confirm serving, meal, and date. No AI meal recognition or OCR.
Workouts Exercise library & templates, active session with sets, history with estimated calorie burn.
Goals Guided setup: lose / maintain / gain. Editable daily calorie and macro targets.
Progress 7 / 30 / 90-day trends for nutrition, training, and body measurements (BMI / composition when inputs allow — marked as estimates).
Account Profile, units, appearance, language. JSON export / import. Delete data or full account via secure Edge Function.
Home widgets Trackwise Daily (calories + carbs/protein/fat/water cards) and Trackwise Workout. Android home screen now; iOS later. Not Expo Go.

Account & access

Auth Email + password with 8-digit OTP verification · Optional Google OAuth · Password recovery OTP
Locales English · Finnish · Swedish · Vietnamese
Platforms Android first · iOS later

How Trackwise works

flowchart LR
  A[Sign up · verify OTP] --> B[Setup goals]
  B --> C[Log food · scan · train]
  C --> D[Review diary & progress]
  D --> E[Adjust targets]

  style A fill:#202020,stroke:#00D95F,color:#fcfcfc
  style B fill:#00D95F,stroke:#13873c,color:#202020
  style C fill:#3B82F6,stroke:#1e40af,color:#fff
  style D fill:#C47F1A,stroke:#8a5c00,color:#fff
  style E fill:#635BFF,stroke:#3d37a8,color:#fff
Loading

Bootstrap and route guards keep welcome, incomplete setup, recovery sessions, and the home tabs distinct — a welcome flag alone does not mean the profile is complete.


Repository layout

This monorepo holds the mobile app plus two Next.js web packages and Supabase:

Path Role
/ (root) Expo / React Native mobile app
admin/ Internal Admin console (localhost:3000)
dashboard/ Public marketing site for trackwise.one (localhost:3001)
supabase/ Migrations, Auth email templates, Edge Functions, local CLI config

Expand mobile src/ layout

app/                          # Expo Router screens & layouts
assets/                       # Branding, fonts, workout exercise art
supabase/                     # Migrations, templates, functions, seed

widgets/                      # Home-screen widget UI (iOS SwiftUI / Android Compose)

src/
├── components/ui/            # Shared UI primitives
├── features/                 # Domain: auth, diary, scan, workouts, goals, widgets
├── i18n/                     # Locale resources (en, fi, sv, vi)
├── lib/                      # Supabase client, query client, analytics adapters
├── stores/                   # Zustand — active workout draft only
└── theme/                    # Design tokens (see DESIGN.MD)

Tech stack

Layer Choice
Mobile Expo SDK 58, Expo Router, React Native, TypeScript
UI NativeWind / Tailwind, Lucide, Trackwise tokens (#00D95F)
Fonts Bricolage Grotesque · JetBrains Mono
Server state TanStack Query
Forms React Hook Form + Zod
Backend Supabase Auth, Postgres, RLS, Storage, Edge Functions
Food lookup Open Food Facts (barcode)
Images Unsigned Cloudinary preset (food / avatar / custom exercise)
Admin / web Next.js App Router (separate packages under admin/, dashboard/)
Tests Vitest

Getting started

Requirements

  • Node.js 22+ and npm
  • Physical Android phone (primary) or iOS device
  • Expo Go for SDK 58 — or a development build when native modules require it
  • Optional: Docker Desktop for local Supabase

Install & run (Cloud Supabase)

npm install
# create .env.local (see Configuration)
npm start                 # Expo tunnel by default
# or: npm run start:lan

Scan the QR code with Expo Go (SDK 58).

Script Purpose
npm start / npm run start:lan Expo development server
npm run start:clear Tunnel + clear Metro cache
npm run typecheck TypeScript
npm run lint ESLint
npm test Vitest
npm run supabase:start Local Supabase (Docker)
npm run supabase:status / supabase:stop Local status / stop

Apply schema to a linked project:

npx supabase db push
npx supabase functions deploy delete-account

Home screen widgets are not available in Expo Go. Use a development or store build after installing dependencies:

npm install
npx expo prebuild --clean

prebuild generates android/ and ios/ (gitignored CNG). Rebuild after changing expo-widgets plugin options in app.json.

EAS builds (widgets included)

# Android
eas build --platform android --profile development
eas build --platform android --profile production

# iOS
eas build --platform ios --profile development
eas build --platform ios --profile production

Local native run after prebuild: npm run android / npm run ios.

Home screen widgets

Pin Trackwise on the home screen so today’s calories and workout stay visible without opening the app. Widgets ship in the Play Store / development / production build, not Expo Go. Sign in and open Trackwise once so numbers can sync.

How to add them (Android)

  1. Install Trackwise from Google Play (or a matching APK).
  2. Open the app while signed in so today’s diary and workout can write a snapshot.
  3. Long-press an empty area on the home screen → Widgets → Trackwise.
  4. Add Trackwise Daily and/or Trackwise Workout, then resize if the launcher allows it.
  5. Tap Daily to open the diary (trackwise:///). Tap Workout to open today’s plan or session.
Trackwise Daily Trackwise Workout
Shows Calories left, then carbs / protein / fat / water as eaten/target cards with bars Today’s planned or completed session
Size One 4×4 Glance layout (no iOS-style small/medium/large) 4×2, resizes horizontally
Fourth Daily card Water (fiber is not in the snapshot) —
Offline Last snapshot until you open the app again Same

In-app Account → Help and the public site (trackwise.one/support, features) describe the same steps for users.

Developers

Shared snapshots live in src/features/widgets/. Platform UI is in widgets/TrackwiseDaily.* and widgets/TrackwiseWorkout.*. The app writes JSON-serializable props; native widget runtimes cannot use React Query, Zustand, or a live Supabase session.

  • Android snapshots call the native ExpoWidgets module and do not import() widgets/*.tsx at runtime (that Metro extra bundle timed out and left the home widget on the skeleton). Layouts are compiled into the APK (generateExpoWidgetsLayoutRegistry).
  • After changing widgets/*.android.tsx, rebuild that registry, install the APK, and remove then re-add the home widget. Debug reinstall often keeps expo.modules.widgets SharedPreferences (previous layout).
  • Glance ignores fillMaxWidth(fraction) (always 100%), so the Daily 2×2 uses fixed width(). Box / overlaying a number inside a calorie ring crashes with Loading widget. Android tap-to-open is a Glance root actionStartActivity on snapshot openUrl; widgetURL is iOS-only in SDK 58 (plugins/apply-android-widget-open-app.js re-applies the patch after npm install).
  • Android widgets use system type (fontSize / fontWeight only). iOS layouts request Bricolage Grotesque and JetBrains Mono; the widget extension still needs those TTFs in UIAppFonts or it falls back to San Francisco.
  • Logout / account switch / deletion replace snapshots with a signed-out state so the previous user’s numbers are not left on the home screen.

iOS (later / device testing)

  • Widgets require iOS 17+ (containerBackground). Small = calorie ring; medium/large = ring + 2×2 cards.
  • Apple Developer: App Group group.com.trackwise.app on com.trackwise.app and extension com.trackwise.app.widgets.
  • EAS provisions the extension when those identifiers exist on the team.

Android packaging

  • Application ID stays com.trackwise.app. No extra Play Console widget listing is required.

Widgets keep the last valid snapshot when offline. They do not poll Supabase in the background.


Configuration

Create .env.local in the repo root (gitignored). Expo prefers variables already set in the shell over this file.

Full .env.local template

# ── Supabase (required) ────────────────────────────────────────────
# Hosted project URL + publishable (anon) key from Project Settings → API.
# EXPO_PUBLIC_SUPABASE_KEY is accepted as an alias for the publishable key.
EXPO_PUBLIC_SUPABASE_URL=https://YOUR_PROJECT.supabase.co
EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your_publishable_key

# ── Media (optional — Create Food / avatar / custom exercise) ──────
# Unsigned upload preset only. Never put Cloudinary API secrets in the app.
EXPO_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloud_name
EXPO_PUBLIC_CLOUDINARY_UPLOAD_PRESET=your_unsigned_preset

# ── Public links (optional until real URLs exist) ──────────────────
# EXPO_PUBLIC_PRIVACY_POLICY_URL=https://trackwise.one/privacy
# EXPO_PUBLIC_TERMS_OF_SERVICE_URL=https://trackwise.one/terms
# EXPO_PUBLIC_SUPPORT_EMAIL=support@example.com
# EXPO_PUBLIC_ADMIN_URL=http://localhost:3000

Hard rules

  • Never put the service-role key, database password, or Cloudinary API secret in app code or EXPO_PUBLIC_*
  • Client uploads are capped at 1 MB (food, avatar, custom exercise)
  • Avatars use Cloudinary folder trackwise/avatars; only the HTTPS URL is stored on profiles.avatar_url
  • System exercise art lives under assets/images/workout/exercises/ and the Storage bucket exercise-images

Auth email (hosted Supabase)

The app uses in-app 8-digit OTP (not magic links). Align Dashboard settings with supabase/templates/:

  1. Authentication → Email — Confirm email ON · OTP length 8
  2. Confirm signup template — paste supabase/templates/confirmation-otp.html ({{ .Token }}, no {{ .ConfirmationURL }})
  3. Reset password template — paste supabase/templates/recovery-otp.html

Local supabase/config.toml already wires this for supabase start. Details: supabase/README.md.


Local Supabase (Docker)

Docker Desktop must be running. The npm-scoped CLI is enough (no global install).

npm run supabase:start
npm run supabase:status
Service URL
API http://127.0.0.1:54321
Studio http://127.0.0.1:54323
Mailpit (auth emails) http://127.0.0.1:54324

Point the current PowerShell session at local keys, then start Expo from the same shell:

$supabase = npx --yes supabase status -o json | ConvertFrom-Json
$env:EXPO_PUBLIC_SUPABASE_URL = $supabase.API_URL
$env:EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY = $supabase.PUBLISHABLE_KEY
npm run start:lan

Return to Cloud values from .env.local:

Remove-Item Env:EXPO_PUBLIC_SUPABASE_URL, Env:EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY
npm start

Stop without wiping the local DB volume:

npm run supabase:stop

Do not run supabase db reset, supabase stop --no-backup, or delete Docker volumes unless losing local data is intentional.

Physical phone on mobile data

Expo --tunnel only forwards the Metro bundle — not Supabase. Prefer a private Tailscale serve of port 54321 (API only), never Funnel/ngrok for the local stack. See operational notes in git history / team docs for the exact tailscale serve flow.


Google OAuth

Redirect URI is resolved at runtime (src/features/auth/redirect.ts):

Environment Redirect shape
Expo Go tunnel exp://<tunnel-host>.exp.direct/--/auth/callback
Expo Go LAN exp://<lan-ip>:8081/--/auth/callback
Dev / store build trackwise://auth/callback

Supabase → Authentication → URL Configuration

  • Site URL: trackwise://auth/callback
  • Redirect allowlist (preferred wildcards):
exp://**/--/auth/callback
exp://**
trackwise://auth/callback
trackwise://**

Google Cloud Console authorizes only the Supabase callback
(https://<project-ref>.supabase.co/auth/v1/callback) — not the app deep link. Keep the Google client secret in Supabase provider settings only.

Tunnel is the most reliable Expo Go OAuth path on Android; LAN Custom Tabs often fail to return exp://192.168.x.x. Development builds use trackwise://auth/callback.


Web packages

Package Port Docs
Admin console 3000 admin/README.md
Public site (trackwise.one) 3001 dashboard/README.md
cd admin && npm install && npm run dev
cd dashboard && npm install && npm run dev

Admin requires an admin row in public.user_roles (bootstrap via admin_bootstrap_grant — see admin README). Local seed includes test@admin.com / testadmin after db reset.


Data & privacy

  • User-owned tables use RLS keyed to auth.uid(); client filters are not a security boundary
  • Account deletion uses the delete-account Edge Function with the service role on the server only
  • Calorie and activity values are estimates for everyday tracking — not medical measurements or advice
  • Barcode scanning looks up products on Open Food Facts; Trackwise does not claim AI meal recognition

Policy drafts: Privacy · Terms


Design system

See DESIGN.MD together with src/theme/ and src/components/ui/.

Token Value
Primary #00D95F
Display Bricolage Grotesque
Body Bricolage Grotesque
Mono JetBrains Mono

Contributing

This repository powers the Trackwise product (package.json is "private": true).

  1. Branch from the current default branch
  2. Keep changes scoped; follow AGENTS.md and package-local AGENTS.md files
  3. Run npm run lint, npm run typecheck, and npm test before opening a PR
  4. Prefer small PRs with a clear “why”
  5. Do not commit secrets, force-push shared history, or reset hosted production without authorization

License

No open-source license file is published in this repository. Treat the codebase as proprietary unless the maintainers state otherwise.


Trackwise

Trackwise
Make every step count.


trackwise.one

About

Trackwise is a mobile-first nutrition and fitness app. Log meals, scan barcodes, train from an exercise library, set personal goals, and review progress — in one place.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages