Implements complete authentication system using Supabase Auth SDK following Archon's vertical slice architecture. Frontend Changes: - Install @supabase/supabase-js dependency - Create auth feature in vertical slice pattern: * AuthContext and Provider for global auth state * authService with Supabase Auth methods (signIn, signUp, signOut, etc.) * Auth query hooks with TanStack Query integration * TypeScript types for User, Session, AuthState * ProtectedRoute component for route guards - Add LoginPage and SignUpPage with Tron-themed design - Update App.tsx with AuthProvider and protected routes - Configure Supabase client with environment variables Backend Changes: - Create auth_service.py for JWT token validation - Create auth_middleware.py for protecting API routes (optional, commented by default) - Create auth_api.py with endpoints: * POST /api/auth/verify - Verify JWT token * GET /api/auth/user - Get current user * GET /api/auth/health - Auth service health check - Register auth router in main.py - Add middleware configuration (disabled by default) Configuration: - Update .env.example with VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY - Add comprehensive AUTHENTICATION_SETUP.md documentation Features: - Email/password authentication - Persistent sessions with localStorage - Auto token refresh - Route protection with loading states - Integration with existing TanStack Query patterns - Optional backend middleware for API protection - Row Level Security (RLS) ready Architecture follows CLAUDE.md guidelines: - Vertical slice architecture for auth feature - TanStack Query for state management - No backwards compatibility needed (beta) - KISS principle - Fail fast with detailed errors Notes: - Auth middleware is commented out by default to avoid breaking existing installations - Users can enable it when ready by uncommenting in main.py - Frontend auth works independently of backend middleware - Comprehensive setup guide included in AUTHENTICATION_SETUP.md
85 lines
3.8 KiB
JSON
85 lines
3.8 KiB
JSON
{
|
|
"name": "archon-ui",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "npx vite",
|
|
"build": "npx vite build",
|
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
"lint:files": "eslint --ext .js,.jsx,.ts,.tsx",
|
|
"biome": "biome check",
|
|
"biome:fix": "biome check --write",
|
|
"biome:format": "biome format --write",
|
|
"biome:lint": "biome lint",
|
|
"biome:ai": "biome check --reporter=json",
|
|
"biome:ai-fix": "biome check --write --reporter=json",
|
|
"biome:ci": "biome ci",
|
|
"preview": "npx vite preview",
|
|
"test": "vitest",
|
|
"test:run": "vitest run",
|
|
"test:ui": "vitest --ui",
|
|
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
"test:coverage": "npm run test:coverage:run && npm run test:coverage:summary",
|
|
"test:coverage:run": "vitest run --coverage --reporter=dot --reporter=json",
|
|
"test:coverage:stream": "vitest run --coverage --reporter=default --reporter=json --bail=false || true",
|
|
"test:coverage:summary": "echo '\\n📊 ARCHON TEST & COVERAGE SUMMARY\\n═══════════════════════════════════════\\n' && node -e \"try { const data = JSON.parse(require('fs').readFileSync('coverage/test-results.json', 'utf8')); const passed = data.numPassedTests || 0; const failed = data.numFailedTests || 0; const total = data.numTotalTests || 0; const suites = data.numTotalTestSuites || 0; console.log('Test Suites: ' + (failed > 0 ? '\\x1b[31m' + failed + ' failed\\x1b[0m, ' : '') + '\\x1b[32m' + (suites - failed) + ' passed\\x1b[0m, ' + suites + ' total'); console.log('Tests: ' + (failed > 0 ? '\\x1b[31m' + failed + ' failed\\x1b[0m, ' : '') + '\\x1b[32m' + passed + ' passed\\x1b[0m, ' + total + ' total'); console.log('\\n✨ Results saved to coverage/test-results.json'); } catch(e) { console.log('⚠️ No test results found. Run tests first!'); }\" || true",
|
|
"test:coverage:force": "vitest run --coverage --passWithNoTests || true",
|
|
"seed:projects": "node --loader ts-node/esm ../scripts/seed-project-data.ts"
|
|
},
|
|
"dependencies": {
|
|
"@mdxeditor/editor": "^3.42.0",
|
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
"@radix-ui/react-popover": "^1.1.15",
|
|
"@radix-ui/react-select": "^2.2.6",
|
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
"@radix-ui/react-toast": "^1.2.15",
|
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
"@supabase/supabase-js": "^2.81.1",
|
|
"@tanstack/react-query": "^5.85.8",
|
|
"@tanstack/react-query-devtools": "^5.85.8",
|
|
"clsx": "latest",
|
|
"date-fns": "^4.1.0",
|
|
"fractional-indexing": "^3.2.0",
|
|
"framer-motion": "^11.5.4",
|
|
"lucide-react": "^0.441.0",
|
|
"nanoid": "^5.0.9",
|
|
"prismjs": "^1.30.0",
|
|
"react": "^18.3.1",
|
|
"react-dnd": "^16.0.1",
|
|
"react-dnd-html5-backend": "^16.0.1",
|
|
"react-dom": "^18.3.1",
|
|
"react-markdown": "^10.1.0",
|
|
"react-router-dom": "^6.26.2",
|
|
"tailwind-merge": "latest",
|
|
"zod": "^3.25.46"
|
|
},
|
|
"devDependencies": {
|
|
"@biomejs/biome": "2.2.2",
|
|
"@testing-library/jest-dom": "^6.4.6",
|
|
"@testing-library/react": "^14.3.1",
|
|
"@testing-library/user-event": "^14.5.2",
|
|
"@types/node": "^20.19.0",
|
|
"@types/react": "^18.3.1",
|
|
"@types/react-dom": "^18.3.1",
|
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
"@typescript-eslint/parser": "^6.21.0",
|
|
"@vitejs/plugin-react": "^4.2.1",
|
|
"@vitest/coverage-v8": "^1.6.0",
|
|
"@vitest/ui": "^1.6.0",
|
|
"autoprefixer": "latest",
|
|
"eslint": "^8.57.1",
|
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
"eslint-plugin-react-refresh": "^0.4.1",
|
|
"jsdom": "^24.1.0",
|
|
"postcss": "latest",
|
|
"tailwindcss": "3.4.17",
|
|
"ts-node": "^10.9.1",
|
|
"typescript": "^5.5.4",
|
|
"vite": "^5.2.0",
|
|
"vitest": "^1.6.0"
|
|
}
|
|
}
|