Set up Next.js 16 project with TypeScript for a training decision app that integrates menstrual cycle phases with Garmin biometrics for Hashimoto's thyroiditis management. Stack: Next.js 16, React 19, Tailwind/shadcn, PocketBase, Drizzle, Zod, Resend, Vitest, Biome, Lefthook, Nix dev environment. Includes: - 7 page routes (dashboard, login, settings, calendar, history, plan) - 12 API endpoints (garmin, user, cycle, calendar, overrides, cron) - Core lib utilities (decision engine, cycle phases, nutrition, ICS) - Type definitions and component scaffolding - Python script for Garmin token bootstrapping - Initial unit tests for cycle utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
# ABOUTME: PhaseFlow Garmin Token Generator using garth library.
|
|
# ABOUTME: Run this locally to authenticate with Garmin (supports MFA).
|
|
"""
|
|
PhaseFlow Garmin Token Generator
|
|
Run this locally to authenticate with Garmin (supports MFA)
|
|
|
|
Usage:
|
|
pip install garth
|
|
python3 garmin_auth.py
|
|
"""
|
|
import json
|
|
from getpass import getpass
|
|
|
|
try:
|
|
import garth
|
|
except ImportError:
|
|
print("Error: garth library not installed.")
|
|
print("Please install it with: pip install garth")
|
|
exit(1)
|
|
|
|
email = input("Garmin email: ")
|
|
password = getpass("Garmin password: ")
|
|
|
|
# MFA handled automatically - prompts if needed
|
|
garth.login(email, password)
|
|
|
|
tokens = {
|
|
"oauth1": garth.client.oauth1_token.serialize(),
|
|
"oauth2": garth.client.oauth2_token.serialize(),
|
|
"expires_at": garth.client.oauth2_token.expires_at.isoformat()
|
|
}
|
|
|
|
print("\n--- Copy everything below this line ---")
|
|
print(json.dumps(tokens, indent=2))
|
|
print("--- Copy everything above this line ---")
|
|
print(f"\nTokens expire: {tokens['expires_at']}")
|