How abdelatifahmed/sanad works
Sanad is a web client connecting families who need care with professional companions. The principal journey is account creation, companion discovery, care-request or job-post creation, companion proposals, booking and payment, then ongoing coordination through schedules and chat. The client also provides AI search and care-plan assistance, support, notifications, profiles, and wallets. The graph reflects documented capabilities and shown imports/calls; unsampled page-level wiring is represented only by dashed, unverified links. Backend services are external to this repository.
Main entry points: api.ts API client · ClientCompanionsView.tsx Companion discovery · page.tsx Role registration · ReviewStep.tsx Registration submit
Components 27
Entry and identity
- Landing page
app/page.tsx - Role registration
app/(auth)/register/page.tsx - Registration state
store/registerStore.ts - Registration submit
components/auth/ReviewStep.tsx - Auth state
store/authStore.ts - Login
app/(auth)/login/page.tsx
Care marketplace
- Companion discovery
app/family/companions/ClientCompanionsView.tsx - Companion profiles
components/companion/CaregiverCard.tsx - AI smart search
components/ai/SmartSearchBar.tsx - Search request hook
hooks/useSmartSearch.ts - Care plan assistant
components/ai/CarePlanAssistant.tsx - Care requests
app/family/job-posts/new/page.tsx - Direct care request
components/care-request/DirectCareRequestForm.tsx - Companion proposals
app/companion/requests/page.tsx
Bookings and engagement
- Booking management
app/family/bookings/page.tsx - Wallet and payments
app/family/wallet/page.tsx - Shift schedules
app/companion/schedule/page.tsx - Chat experience
features/chat/components/ChatContainer.tsx - Chat and messages
features/chat/hooks/useChat.ts - Admin support
features/admin-support/hooks/useAdminSupport.ts - Notifications
components/notifications/NotificationsDashboard.tsx
Shared client services
- API client
lib/services/api.ts - Socket provider
components/providers/SocketProvider.tsx - Interactive maps
components/shared/LeafletMap.tsx
Other components
- Family or companion
- Sanad API
- Stripe Elements
Connections 32
- Family or companion → Landing page: visits
app/page.tsx - Family or companion → Role registration: registers
- Role registration → Registration state: updates
app/(auth)/register/page.tsx - Role registration → Registration submit: renders
app/(auth)/register/page.tsx - Registration submit → Sanad API: registers account
- Registration submit → Auth state: sets session
components/auth/ReviewStep.tsx - Family or companion → Login: signs in
- Login → API client: uses API
app/(auth)/login/page.tsx - Companion discovery → Companion profiles: renders
app/family/companions/ClientCompanionsView.tsx - Companion discovery → AI smart search: renders
app/family/companions/ClientCompanionsView.tsx - AI smart search → Search request hook: uses search
- Search request hook → API client: posts search
hooks/useSmartSearch.ts - API client → Sanad API: sends requests
lib/services/api.ts - Family or companion → Companion discovery: browses care
- Family or companion → Care requests: creates request
- Care requests → Direct care request: renders form
- Care requests → Care plan assistant: generates plan
- Family or companion → Companion proposals: applies to posts
- Companion proposals → Sanad API: submits proposals
- Family or companion → Booking management: manages bookings
- Booking management → Wallet and payments: pays for care
- Wallet and payments → Stripe Elements: processes payment
- Family or companion → Shift schedules: coordinates shifts
- Family or companion → Chat experience: opens chat
- Chat experience → Chat and messages: uses chat logic
- Chat and messages → API client: loads and sends
features/chat/hooks/useChat.ts - Chat and messages → Socket provider: receives realtime events
features/chat/hooks/useChat.ts - Family or companion → Admin support: requests support
- Admin support → API client: loads and sends
features/admin-support/hooks/useAdminSupport.ts - Family or companion → Notifications: views updates
- Interactive maps → Companion discovery: shows locations
- API client → Auth state: reads and refreshes session
lib/services/api.ts