From 4c1870ebb44a2b9834689ffb12447c91a3ed1419 Mon Sep 17 00:00:00 2001 From: Dianaka123 Date: Wed, 25 Feb 2026 23:22:08 +0300 Subject: [PATCH] Add root CLAUDE.md and rename spec CLAUDE.md Created project-level CLAUDE.md with current architecture, quick start, gotchas, and conventions. Renamed dancechamp-claude-code/CLAUDE.md to SPEC-CLAUDE.md to distinguish target spec from current project context. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 75 +++++++++++++++++++ .../{CLAUDE.md => SPEC-CLAUDE.md} | 0 2 files changed, 75 insertions(+) create mode 100644 CLAUDE.md rename dancechamp-claude-code/{CLAUDE.md => SPEC-CLAUDE.md} (100%) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..00411c2 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,75 @@ +# CLAUDE.md — Pole Dance Championships App + +## Target Vision +See `dancechamp-claude-code/` for full spec (3-app Supabase platform). +Current implementation is a simplified MVP working toward that goal. + +## Quick Start + +```bash +# Backend +cd backend && .venv/Scripts/python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload + +# Mobile (set BASE_URL in src/api/client.ts to LAN IP first) +cd mobile && npx expo start --lan --clear + +# Seed test data +cd backend && .venv/Scripts/python seed.py +``` + +## Current Architecture + +- **Backend**: FastAPI + SQLAlchemy 2 (async) + aiosqlite (SQLite dev) + Alembic + bcrypt +- **Mobile**: Expo (blank-typescript) + React Navigation v6 + Zustand + Axios + Ionicons +- **Auth**: JWT access (15min) + refresh token rotation (7 days, SHA-256 hashed in DB) + +## Project Layout + +``` +backend/app/ FastAPI app (models, schemas, routers, crud, services) +backend/alembic/ Async migrations +backend/.venv/ Virtual env (use .venv/Scripts/python) +mobile/src/api/ Axios client + API modules (auth, championships, users) +mobile/src/store/ Zustand auth store +mobile/src/screens/ auth/, championships/, admin/, profile/ +mobile/src/navigation/ RootNavigator -> AuthStack | AppStack (Tabs + Detail) +dancechamp-claude-code/ Target spec: SPEC.md, PLAN.md, DATABASE.md, DESIGN-SYSTEM.md, SCREENS.md +``` + +## Gotchas + +- **passlib + bcrypt 5.x incompatible** — use `bcrypt` directly (NOT passlib) +- **Circular import**: auth_service.py must NOT import crud_user +- **SQLAlchemy UUID**: Use `sqlalchemy.Uuid(as_uuid=True)` not `postgresql.UUID` +- **Expo newArchEnabled: true** crashes Expo Go — keep `false` in app.json +- **Stale uvicorn**: Kill with `powershell.exe -NoProfile -Command "Get-Process python | Stop-Process -Force"` +- **BASE_URL**: mobile/src/api/client.ts must use LAN IP (not localhost) for physical devices + +## Test Credentials (run seed.py) + +``` +admin@pole.dev / Admin1234 (admin, approved) +organizer@pole.dev / Org1234 (organizer, approved) +member@pole.dev / Member1234 (member, approved) +``` + +## API Routes + +- Auth: POST /api/v1/auth/{register,login,refresh,logout,me} +- Championships: GET/POST/PATCH/DELETE /api/v1/championships +- Registrations: POST/GET/PATCH/DELETE /api/v1/registrations +- Users (admin): GET /api/v1/users, PATCH /api/v1/users/{id}/{approve,reject} +- Health: GET /internal/health | Swagger: GET /docs + +## Code Conventions + +- Backend: Pydantic v2 schemas, async SQLAlchemy, `from_attributes = True` +- Mobile: Functional components, Zustand stores, Ionicons for icons +- Registration: members auto-approved, organizers require admin approval +- Tab navigator uses `headerShown: true` for safe area; no manual headings in tab screens + +## Environment + +- Windows 10, Python 3.12, Node.js +- Docker NOT installed, PostgreSQL NOT installed (use SQLite for dev) +- venv always in backend/.venv diff --git a/dancechamp-claude-code/CLAUDE.md b/dancechamp-claude-code/SPEC-CLAUDE.md similarity index 100% rename from dancechamp-claude-code/CLAUDE.md rename to dancechamp-claude-code/SPEC-CLAUDE.md