8000 GitHub - andrewtobilko/settie-examples: Runnable examples for building on Settie with @settie/api · GitHub
[go: up one dir, main page]

Skip to content

About

Runnable examples for building on Settie with @settie/api

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Settie logo

Settie Examples

Download Settie on the App Store Settie website Settie on Reddit Join Settie on Discord

An example Next.js app using the Settie API. Log in with Settie to chart body weight and training volume over the last 12 weeks.

What it shows

  • OAuth sign-in with PKCE using @settie/api/auth.
  • Server-side API requests and encrypted sessions with iron-session.
  • A shadcn/ui chart showing weekly training volume and body weight in the user's preferred unit.

The app requests offline_access, measurements.read, sessions.read, and settings.read.

Run locally

Requires Node.js 22.22.2 or later.

pnpm install
cp .env.example .env.local

Generate a secret with openssl rand -base64 32 and put it in SESSION_SECRET in .env.local. Keep APP_URL set to the exact origin where the app runs. Then start it:

pnpm dev

Open http://localhost:3000. The app uses https://api.settie.app by default; set SETTIE_API_URL to another Settie API origin if needed. For deployment, set APP_URL to the public HTTPS origin and use a unique production session secret.

Files to explore

File Purpose
app/page.tsx One-page layout and login/logout controls
components/progress-chart.tsx shadcn/ui and Recharts chart
app/api/auth OAuth login, callback, and logout routes
lib/session.ts Encrypted session and token refresh
app/api/chart/route.ts Server-side Settie API requests
lib/chart-data.ts Weekly data aggregation

About

Runnable examples for building on Settie with @settie/api

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0