How mahi-rejone/bloodflow works
BloodFlow is a blood-donation coordination web app: users authenticate, discover donors and blood requests, and can notify nearby donors; role-based areas also support profiles, donations, and administration. The sampled code shows login/session state and nearby-donor alerting, while the file tree identifies broader request, donation, event, blog, and user-management areas. Connections to unsampled pages are omitted where the index does not establish their runtime calls.
Main entry points: baseApi.tsx API Base Query · userApi.ts User Management · page.tsx Sign In · notificationApi.ts Notification API
Components 26
Authentication
- Sign In
src/app/(AuthPage)/login/page.tsx - Registration
src/app/(AuthPage)/register/page.tsx - Email Verification
src/app/(AuthPage)/verify/page.tsx - Session Route
src/app/(AuthPage)/api/auth/session/route.ts
Donor Coordination
- Home and Donor Discovery
src/components/home/heroBanner.tsx - Blood Requests
src/app/(MainPage)/(withnav)/requests/page.tsx - Nearby Alerts
src/hooks/useNotifyNearby.ts - Donor Profiles
src/app/(MainPage)/(withnav)/(Authorized)/donors/[id]/page.tsx - Notification Panel
src/components/NotificationsPanel.tsx
Donations and Content
- Donation Flows
src/app/(MainPage)/(withnav)/(Authorized)/donate/page.tsx - Donation API
src/redux/feature/donation/donationApi.ts - Blog Pages
src/app/(MainPage)/(withnav)/blogs/page.tsx - Blog API
src/redux/feature/blog/blogApi.ts - Event Pages
src/app/(MainPage)/(withnav)/events/[id]/page.tsx - Event API
src/redux/feature/event/eventApi.ts
Role Administration
- Admin Workspace
src/app/(MainPage)/(withoutnav)/(Authorized)/[role]/(sidebar_pages)/dashboard/page.tsx - User Management
src/redux/feature/user/userApi.ts - Role Route Generator
src/utils/RouteGeneratior.tsx - Sidebar UI
src/components/ui/sidebar.tsx
Client State and API
- Authentication API
src/redux/feature/auth/authApi.ts - Blood Request API
src/redux/feature/blood/bloodRequestApi.ts - Notification API
src/redux/feature/notification/notificationApi.ts - API Base Query
src/redux/api/baseApi.tsx - Auth State
src/redux/feature/authSlice.ts - Redux Store
src/redux/store/store.ts
Other components
- User
Connections 22
- User → Sign In: submits credentials
src/app/(AuthPage)/login/page.tsx - Sign In → Authentication API: requests login
src/app/(AuthPage)/login/page.tsx - Sign In → Session Route: creates session
src/app/(AuthPage)/login/page.tsx - Sign In → Auth State: sets credentials
src/app/(AuthPage)/login/page.tsx - Registration → User Management: registers user
src/app/(AuthPage)/register/page.tsx - Email Verification → User Management: verifies user
src/app/(AuthPage)/verify/page.tsx - Authentication API → API Base Query: injects endpoints
src/redux/feature/auth/authApi.ts - Blood Request API → API Base Query: uses base query
src/redux/feature/blood/bloodRequestApi.ts - Notification API → API Base Query: injects endpoints
src/redux/feature/notification/notificationApi.ts - User Management → API Base Query: injects endpoints
src/redux/feature/user/userApi.ts - API Base Query → Auth State: refreshes credentials
src/redux/api/baseApi.tsx - Redux Store → Auth State: combines reducer
src/redux/store/store.ts - Redux Store → API Base Query: registers API middleware
src/redux/store/store.ts - Home and Donor Discovery → Blood Request API: queries requests
src/components/home/heroBanner.tsx - Home and Donor Discovery → User Management: queries donors
src/components/home/heroBanner.tsx - Blood Requests → Blood Request API: loads requests
src/app/(MainPage)/(withnav)/requests/page.tsx - Blood Requests → User Management: loads users
src/app/(MainPage)/(withnav)/requests/page.tsx - Blood Requests → Notification API: uses notifications
src/app/(MainPage)/(withnav)/requests/page.tsx - Nearby Alerts → Notification API: sends nearby alert
src/hooks/useNotifyNearby.ts - Notification Panel → Notification API: loads notifications
src/components/NotificationsPanel.tsx - Blog Pages → Blog API: loads blog posts
src/app/(MainPage)/(withnav)/blogs/page.tsx - Role Route Generator → Sidebar UI: renders sidebar items
src/utils/RouteGeneratior.tsx