How leodviana/clubclincheckpro works
This is a Next.js dental-support chat frontend: users sign in, access chat conversations, and submit messages; administrators review open, pending-response, and closed chats and can manage conversations. Authentication is maintained through a provider and API client, while chat and admin screens use a shared authenticated-fetch layer. The tree also shows password recovery/reset and a credits display. Evidence is limited to the README (empty), tree, SOURCE INDEX, and sampled excerpts; unsampled reset and credit behavior is represented without speculative connections.
Main entry points: useAuth.ts Auth hook · useApi.ts Authenticated API hook · page.tsx Chat conversation · UserCredits.tsx Credits display
Components 22
Access and identity
- Login screen
app/login/page.tsx - Password recovery
app/recuperar/page.tsx - Password reset route
app/api/Login/resetPassword/route.ts - Auth provider
components/AuthProvider.tsx - Auth hook
hooks/useAuth.ts - Auth gate
components/AuthGate.tsx - Account navigation
components/NavAuth.tsx - App shell
app/layout.tsx - Admin redirect
components/AdminRedirect.tsx
Chat workflow
- Chat conversation
app/chat/[chatId]/page.tsx - Home and credits
app/page.tsx - Credits display
components/UserCredits.tsx
Admin operations
- Open chats
app/admin/chats/page.tsx - Pending response
app/admin/chats/pending-admin-response/page.tsx - Closed chats
app/admin/chats/closed/page.tsx - Admin dashboard
app/admin/page.tsx
Shared client services
- Credits adapter
lib/utils/credits-adapter.ts - Authenticated API hook
hooks/useApi.ts - API fetch helper
lib/api-fetch.ts - Authentication API client
lib/auth-client.ts
Other components
- User
- Backend API
Connections 31
- User → Login screen: opens
app/login/page.tsx - Login screen → Auth hook: uses session
app/login/page.tsx - Password recovery → Authentication API client: requests recovery
app/recuperar/page.tsx - Auth provider → Authentication API client: calls auth
components/AuthProvider.tsx - Auth hook → Auth provider: reads context
hooks/useAuth.ts - App shell → Auth provider: provides session
app/layout.tsx - App shell → Auth gate: gates access
app/layout.tsx - App shell → Account navigation: renders navigation
app/layout.tsx - Auth gate → Auth hook: checks session
components/AuthGate.tsx - Account navigation → Auth hook: reads session
components/NavAuth.tsx - Home and credits → Credits display: renders credits
app/page.tsx - Home and credits → Admin redirect: renders redirect
app/page.tsx - Admin redirect → Auth hook: checks identity
components/AdminRedirect.tsx - Credits display → Auth hook: reads session
components/UserCredits.tsx - Credits display → Authenticated API hook: loads data
components/UserCredits.tsx - Credits display → Credits adapter: adapts credits
components/UserCredits.tsx - Chat conversation → Auth hook: reads session
app/chat/[chatId]/page.tsx - Chat conversation → Authenticated API hook: loads and sends
app/chat/[chatId]/page.tsx - Open chats → Auth hook: checks identity
app/admin/chats/page.tsx - Open chats → Authenticated API hook: loads and closes
app/admin/chats/page.tsx - Open chats → Chat conversation: links conversations
app/admin/chats/page.tsx - Pending response → Auth hook: checks identity
app/admin/chats/pending-admin-response/page.tsx - Pending response → Authenticated API hook: loads chats
app/admin/chats/pending-admin-response/page.tsx - Pending response → Chat conversation: links conversations
app/admin/chats/pending-admin-response/page.tsx - Closed chats → Auth hook: checks identity
app/admin/chats/closed/page.tsx - Closed chats → Authenticated API hook: loads chats
app/admin/chats/closed/page.tsx - Closed chats → Chat conversation: links conversations
app/admin/chats/closed/page.tsx - Admin dashboard → User: serves dashboard
app/admin/page.tsx - Authenticated API hook → Auth hook: gets token
hooks/useApi.ts - Authenticated API hook → API fetch helper: sends requests
hooks/useApi.ts - Authentication API client → Backend API: calls auth endpoints
lib/auth-client.ts