This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
TrendWeight is a monorepo web application for tracking weight trends by integrating with smart scales from Withings and Fitbit. It consists of a React frontend and C# ASP.NET Core backend, deployed as Docker containers.
Use ChunkHound MCP server for semantic code search:
mcp__ChunkHound__search_semantic- Natural language queries for finding relevant codemcp__ChunkHound__search_regex- Pattern-based searches with optional path filtering- ChunkHound has indexed 412 files with 2,300 code chunks
apps/web/- React 19 + TypeScript + Vite frontend with TanStack Routerapps/api/- C# ASP.NET Core 9.0 Web API backend- Uses Turborepo with npm workspaces for build orchestration
- Frontend: React 19, TypeScript, Vite, TailwindCSS v4, TanStack Router/Query, Clerk auth
- Backend: ASP.NET Core 9.0, C#, Supabase (PostgreSQL), JWT authentication
- Deployment: Docker containers, tmuxinator for development
user_accounts- Maps Clerk IDs to internal UUIDsprofiles- User profiles and settings (JSONB)provider_links- OAuth tokens for integrations (JSONB)source_data- Raw measurement data (JSONB)
# Start both frontend and backend dev servers via tmuxinator
npm run dev
# Stop development servers
npm run dev:stop
# Build all workspaces
npm run build
# Run all tests
npm run test
# Type checking and linting across all workspaces
npm run check
# Format code
npm run format
# Install dependencies for all workspaces
npm install
# Clean all build artifacts and dependencies
npm run clean# Development server (port 5173)
npm run -w apps/web dev
# Run tests with coverage
npm run -w apps/web test:coverage
# Generate TanStack Router routes (run before typecheck)
npm run -w apps/web generate-routes
# Type checking with route generation
npm run -w apps/web typecheck
# Lint with ESLint
npm run -w apps/web lint# Development server with hot reload (port 5199)
npm run -w apps/api dev
# Build the solution
npm run -w apps/api build
# Run tests
npm run -w apps/api test
# Format C# code
npm run -w apps/api format
# Lint (build with warnings as errors)
npm run -w apps/api lint# Build production Docker image
npm run docker:build
# Run container locally (port 8080)
npm run docker:runapps/api/TrendWeight/
├── Features/ # Feature-based organization
│ ├── Auth/ # Authentication infrastructure
│ ├── Profile/ # User profile management
│ ├── Measurements/ # Weight data management
│ └── Providers/ # Withings/Fitbit integrations
└── Infrastructure/ # Cross-cutting concerns
├── Auth/ # JWT authentication handlers
└── DataAccess/ # Supabase data access layer
apps/web/src/
├── components/ # Shared UI components (PascalCase)
│ └── ui/ # shadcn/ui components
├── lib/ # Core utilities and API client
│ ├── auth/ # Authentication utilities
│ └── api/ # API client and hooks
├── routes/ # TanStack Router pages (auto-generated routing)
│ ├── __root.tsx # Root layout
│ ├── dashboard.tsx # Main dashboard
│ └── oauth/ # OAuth callback handlers
└── types/ # TypeScript type definitions
- Project Name: TrendWeight (capital T, capital W, no space)
- Frontend: PascalCase for components, camelCase for variables/functions
- Backend: PascalCase for public members, camelCase for private/parameters
- Database: snake_case for table and column names
- Routes: kebab-case for route files
- Test files:
*.test.ts(x)colocated with components - Setup:
src/test/setup.ts - Coverage:
npm run -w apps/web test:coverage
- Integration tests use
WebApplicationFactory<Program> - Run:
npm run -w apps/api test
- Frontend: Clerk React SDK with social logins (Google, Microsoft, Apple)
- Backend: JWT validation via Clerk JWKS endpoints
- Database: User mapping via
user_accountstable - Route Protection:
requireAuthguards at route level
Required environment variables (see .env.example):
# Frontend (Vite)
VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
VITE_SUPABASE_URL=https://your-project-ref.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
# Backend (ASP.NET Core)
Clerk__Authority=https://your-instance.clerk.accounts.dev
Clerk__SecretKey=your_clerk_secret_key
Supabase__Url=https://your-project-ref.supabase.co
Supabase__AnonKey=your_supabase_anon_key
Supabase__ServiceKey=your_supabase_service_role_key
- Import Aliases: Frontend uses
@/alias forsrc/imports - Route Generation: TanStack Router routes auto-generated from file structure
- Hot Reload: Backend uses
dotnet watch, frontend uses Vite HMR - Code Quality: Husky pre-commit hooks run formatting and linting
- No PRs: Changes are pushed directly to main branch by maintainer
- Production deploys as Docker container on port 8080
- Container serves both frontend static files and API endpoints
- Uses YARP reverse proxy to route requests between API and static content
- read the files in @docs/steering/ for guidance on the project