8000 GitHub - amyrlam/onlysteps · GitHub
[go: up one dir, main page]

Skip to content
amyrlamPublic

Repository files navigation

OnlySteps

CodeRabbit Pull Request Reviews

Step competitions with your friends: an open-source, ad-free alternative to StepUp. Your iPhone counts the steps, groups compete on a weekly leaderboard, and the winner gets posted to Slack every Monday morning.

The name isn't final. It lives in one setting per app (NEXT_PUBLIC_APP_NAME, APP_DISPLAY_NAME, APP_NAME) so renaming is cheap.

How it fits together

iPhone app (SwiftUI)  ── reads steps from Apple Health ──┐
                                                          ▼
Web app (Next.js)  ◀── groups, leaderboards ──▶  Supabase (Postgres + Auth)
                                                          │
                                   pg_cron, hourly ──▶ weekly-winner Edge Function ──▶ Slack webhook

A browser can't read Apple Health, so automatic step counts come from the iPhone app. The web app is for signing in, typing in step totals by hand, managing groups, invites, and Slack settings, and viewing leaderboards.

Path What it is
packages/tokens Design tokens in the Design Tokens Community Group format (2025.10). Built with Style Dictionary into CSS variables for web and Tokens.swift for iOS.
packages/ui Web design system: shadcn/ui components on Base UI, themed by the tokens, documented in Storybook.
apps/web Next.js app (App Router, Tailwind v4, Supabase auth).
apps/ios SwiftUI app with HealthKit step sync. See apps/ios/README.md.
supabase Database migrations (schema, row level security, leaderboard function) and the weekly-winner Edge Function.

Getting started (web)

Prerequisites: Node 22, pnpm 10 (corepack enable), Docker (for local Supabase).

pnpm install
pnpm tokens                 # build design tokens
pnpm dlx supabase start     # local Postgres, Auth, and Studio; prints the anon key
cp apps/web/.env.example apps/web/.env.local   # paste the anon key
pnpm dev                    # http://localhost:3000
pnpm storybook              # http://localhost:6006

Local sign-in emails land in the Supabase mail viewer that supabase start prints (Mailpit).

Design tokens

Edit the JSON in packages/tokens/tokens/, then run pnpm tokens. Semantic color names match shadcn's CSS variables (--primary, --muted-foreground, …), so shadcn components pick them up unchanged. Commit the regenerated apps/ios/OnlySteps/DesignSystem/Tokens.swift; CI fails if it is stale.

Storybook and Chromatic

pnpm storybook runs the design system locally. On pull requests that touch packages/ui or packages/tokens, CI publishes the Storybook to Chromatic for a shareable link once the CHROMATIC_PROJECT_TOKEN repository secret is set. Visual regression checks aren't enforced yet.

Slack weekly winner

Each group owner can paste a Slack incoming webhook URL on the group page and pick the day and hour (default Monday 9am in the group's time zone). An hourly cron job calls the weekly-winner function, which posts last week's leaderboard for every group whose time has come and remembers the week it announced. There's also a "Send test post" button.

To enable it on a hosted Supabase project, see the comments in supabase/migrations/*_schedule_weekly_winner.sql.

Deploying

  • Database and functions: the Deploy Supabase workflow runs supabase db push and deploys Edge Functions on pushes to main. It needs the repository secrets SUPABASE_ACCESS_TOKEN, SUPABASE_PROJECT_ID and SUPABASE_DB_PASSWORD, plus CRON_SECRET for the weekly Slack post.
  • Web: Vercel, with Root Directory apps/web and the NEXT_PUBLIC_SUPABASE_* variables from apps/web/.env.example. Every PR gets a preview URL. In Supabase Auth > URL Configuration, add https://*-<your-vercel-team>.vercel.app/** as a redirect URL so sign-in works on previews.
  • Storybook: Chromatic (see above).

License

GPL-3.0. Components in packages/ui/src/components start from shadcn/ui (MIT).

Releases

Packages

Contributors

Languages

0