Mobile app built with Expo (React Native), expo-router, Redux, and Supabase for auth and data.
- Node.js (LTS recommended, e.g. 20+)
- npm (comes with Node)
- For physical devices: Expo Go from the App Store or Play Store, or a dev build from
expo run:ios/expo run:android - For iOS simulators: Xcode (macOS only)
- For Android emulators: Android Studio and an AVD
From the project root:
npm installThe app reads Supabase settings from Expo public env vars (see src/lib/supabase.ts). Create a file named .env in the project root (this file is gitignored).
EXPO_PUBLIC_SUPABASE_URL=https://YOUR_PROJECT_REF.supabase.co
EXPO_PUBLIC_SUPABASE_ANON_KEY=your_anon_keyGet URL and anon key from the Supabase dashboard: Project Settings → API.
Restart the dev server after changing .env.
Start the Metro bundler and QR / dev menu:
npx expo start(npm start is equivalent — it runs expo start as defined in package.json.)
Then:
- Press i for iOS simulator, a for Android emulator, or w for web (if supported by your setup)
- Or scan the QR code with Expo Go on a phone (same network as your machine)
Other useful scripts:
| Command | Purpose |
|---|---|
npm run ios |
Build and run on iOS (native project generated as needed) |
npm run android |
Build and run on Android |
npm run web |
Start with web target |
The supabase/ folder holds migrations and Edge Functions for this project. To run Supabase locally or link a remote project, use the Supabase CLI; the app itself only needs the URL and anon key in .env to talk to your hosted (or local) instance.
- Blank Supabase errors or failed requests: Confirm
.envexists, variables are spelled exactly as above, and you restartednpx expo start. - Session not persisting:
src/lib/supabase.tscurrently uses in-memory auth storage for minimal native setup. For persistent login across restarts, wire inAsyncStorage(or SecureStore) in thecreateClientauth.storageoption.
Private project (package.json marks the repo as private).
Already completed by Rohan: Authentication flow —
LoginScreen,RegisterScreen,ForgotPasswordScreen,VerifyOtpScreen,NewPasswordScreen,useAuth.ts,AuthNavigator.tsx,AppNavigator.tsx,authSlice.ts,supabase.ts,Button.tsx,Input.tsx,validators.ts.
The remaining work is divided into 7 workstreams below. Each person should work on their own Git branch and open a PR when done. Read every stub file before implementing — each one contains documentation comments describing exactly what it should do.
Branch name: feature/foundation
This person builds the shared infrastructure that everyone else imports. Do this first — all other workstreams depend on it. No screens, no navigation.
Define and export the following TypeScript interfaces:
interface User
Fields: id: string, username: string, display_name: string, email: string, phone: string | null, location: string, preferences: string, preferred_communication: 'in-app' | 'email' | 'phone', role: 'user' | 'minder' | 'admin' | 'customer_support', account_status: 'active' | 'suspended' | 'banned', ratings: number, created_at: string.
Define and export:
interface PetOwner extends User
Additional fields: pet_info: string, pets?: Pet[].
Define and export:
interface PetMinder extends User
Additional fields: experience: string, vet_clinic_name: string | null, vet_clinic_phone: string | null, vet_clinic_address: string | null, listings?: Listing[].
Define and export:
interface Pet
Fields: id: string, owner_id: string, pet_type: string, breed: string, name: string, created_at: string.
Define and export:
interface VaccineEntry { name: string; date: string; next_due: string }
interface MedicalRecord
MedicalRecord fields: id: string, pet_id: string, vet_name: string, vet_clinic: string, vet_phone: string, vaccine_info: VaccineEntry[], medical_history: string, allergies: string[], updated_at: string.
Define and export:
type BookingStatus = 'pending' | 'confirmed' | 'cancelled' | 'completed'
interface Booking
Fields: id: string, pet_id: string, requester_id: string, minder_id: string, location: string, status: BookingStatus, start_time: string, end_time: string, created_at: string.
Also export interface BookingWithDetails extends Booking that includes pet?: Pet, minder?: User, requester?: User.
Define and export:
type ListingType = 'owner' | 'minder'
interface Listing
Fields: id: string, user_id: string, location: string, description: string, listing_type: ListingType, animal: string | null, time: string | null, price: number | null, rating: number | null, created_at: string.
Define and export:
interface ChatMessage
Fields: id: string, sender_id: string, receiver_id: string, message: string, read_status: boolean, thread_id: string, created_at: string.
Also export interface ChatThread { thread_id: string; other_user: User; last_message: ChatMessage; unread_count: number }.
Define and export:
interface Review
Fields: id: string, reviewer_id: string, reviewee_id: string, booking_id: string | null, rating: 1 | 2 | 3 | 4 | 5, comment: string, date: string.
Define and export:
type TicketStatus = 'pending' | 'opened' | 'closed'
type TicketPriority = 'low' | 'medium' | 'high'
type TicketCategory = 'general' | 'booking' | 'payment' | 'account' | 'safety'
interface Ticket
Fields: id: string, query_type: string, status: TicketStatus, priority: TicketPriority, by_user: string, category: TicketCategory, issue_description: string, created_at: string, updated_at: string.
Define and export:
interface TimeSlot { day: string; start: string; end: string }
interface Calendar
Fields: id: string, user_id: string, available_timing: TimeSlot[], booked_timing: TimeSlot[], updated_at: string.
Implement and export the following functions:
formatDate(isoString: string): string
Returns a human-readable date string, e.g. "28 Mar 2026".
formatDateTime(isoString: string): string
Returns date + time, e.g. "28 Mar 2026, 14:30".
formatRelativeTime(isoString: string): string
Returns relative time like "2 hours ago", "3 days ago", "just now".
formatDuration(startIso: string, endIso: string): string
Returns a human-readable duration like "2h 30m".
Implement and export:
formatPrice(amount: number, currency?: string): string
Defaults to GBP. Returns "£12.50", "£100.00" etc.
formatPricePerHour(amount: number): string
Returns "£12.50 / hr".
Implement the full Redux slice using createSlice from @reduxjs/toolkit.
State shape:
{ bookings: Booking[]; selectedBooking: Booking | null; loading: boolean; error: string | null }
Actions to export:
setBookings(state, action: PayloadAction<Booking[]>)— replace the full listaddBooking(state, action: PayloadAction<Booking>)— prepend a new bookingupdateBookingStatus(state, action: PayloadAction<{ id: string; status: BookingStatus }>)— find by id and update statussetSelectedBooking(state, action: PayloadAction<Booking | null>)— set the viewed bookingsetBookingLoading(state, action: PayloadAction<boolean>)setBookingError(state, action: PayloadAction<string | null>)
Export bookingReducer as default and all actions as named exports.
State shape:
{ threads: Record<string, ChatMessage[]>; loading: boolean; error: string | null }
Actions:
setThreadMessages(state, action: PayloadAction<{ threadId: string; messages: ChatMessage[] }>)— replace messages for a threadappendMessage(state, action: PayloadAction<ChatMessage>)— push a new message to its thread (usethread_idas key)markThreadRead(state, action: PayloadAction<string>)— setread_status = truefor all messages in a threadsetChatLoading(state, action: PayloadAction<boolean>)setChatError(state, action: PayloadAction<string | null>)
State shape:
{ listings: Listing[]; activeFilters: { animal?: string; location?: string; maxPrice?: number }; loading: boolean; error: string | null }
Actions:
setListings(state, action: PayloadAction<Listing[]>)setFilters(state, action: PayloadAction<Partial<...activeFilters>>)clearFilters(state)setListingsLoading(state, action: PayloadAction<boolean>)setListingsError(state, action: PayloadAction<string | null>)
State shape:
{ tickets: Ticket[]; selectedTicket: Ticket | null; loading: boolean; error: string | null }
Actions:
setTickets(state, action: PayloadAction<Ticket[]>)addTicket(state, action: PayloadAction<Ticket>)updateTicketStatus(state, action: PayloadAction<{ id: string; status: TicketStatus }>)setSelectedTicket(state, action: PayloadAction<Ticket | null>)setTicketLoading(state, action: PayloadAction<boolean>)setTicketError(state, action: PayloadAction<string | null>)
Wire all four new reducers into the store alongside the existing authReducer:
reducer: { auth: authReducer, bookings: bookingReducer, chat: chatReducer, listings: listingsReducer, tickets: ticketReducer }
Export type RootState = ReturnType<typeof store.getState> and type AppDispatch = typeof store.dispatch.
A wrapper component. Props: children: React.ReactNode, style?: ViewStyle. Renders a View with a white background, borderRadius: 12, subtle shadowColor/elevation shadow, and padding: 16. Pass style through for overrides.
Props: uri?: string | null, name: string, size?: number (default 44). If uri is provided render an Image in a circle of diameter size. Otherwise render a View of the same size with a coloured background and the first initial of name in white centred text. Choose background colour deterministically from the name (e.g. hash the first char to one of 6 preset colours).
Props: label: string, variant?: 'success' | 'warning' | 'danger' | 'info' | 'neutral' (default 'neutral'). Renders a small pill with coloured background and white text. Colour map: success=green, warning=amber, danger=red, info=blue, neutral=grey.
Props: value: number (0–5), maxStars?: number (default 5), size?: number (default 18), readonly?: boolean (default true), onRate?: (rating: number) => void. Renders star icons (use ★/☆ Unicode or an icon library already in the project). When readonly is false, each star is pressable and calls onRate.
Props: size?: 'small' | 'large' (default 'large'), color?: string, fullScreen?: boolean. When fullScreen is true, wrap in a flex-1 centred View that fills the screen. Otherwise render ActivityIndicator inline.
Write the actual SQL for all 9 stub migration files. The schema is already defined in the project README (Supabase schema section). Each file should contain:
001_create_users.sql—profilestable + RLS: users can read all profiles, only update their own.002_create_pets.sql—petstable + RLS: owners can CRUD their own pets; minders can read pets of booked owners.003_create_medical_records.sql—medical_recordstable + RLS: same owner-only write, minders with active booking can read.004_create_bookings.sql—bookingstable + enum typebooking_status ('pending','confirmed','cancelled','completed')+ RLS.005_create_listings.sql—listingstable + enumlisting_type ('owner','minder')+ RLS: anyone can read; only owner can write their own.006_create_chat_messages.sql—chat_messagestable + RLS: only sender/receiver can read or insert.007_create_reviews.sql—reviewstable + RLS: authenticated users can insert; anyone can read.008_create_tickets.sql—ticketstable + enums + RLS: users can read/create their own; admins can read all.009_create_calendars.sql—calendars,favourites,gps_locationstables + RLS.seed.sql— Insert 3 test profiles (1 owner, 1 minder, 1 admin), 2 pets, 1 booking, 2 listings, sample chat messages.
Branch name: feature/navigation-profile
Builds the three role-based navigators and the shared Profile screen that all user types access.
Dependency: Needs Aradhya's types and Redux slices exported before wiring navigation.
Implement a React Navigation Bottom Tab Navigator with four tabs:
- Dashboard (icon:
home) →OwnerDashboardScreen - Search (icon:
search) →SearchMinderScreen - Listings (icon:
list) →ListingsScreen - Profile (icon:
person) →ProfileScreen
Additionally define a nested Stack Navigator (not shown as tabs) for screens that are pushed modally from the tabs:
MinderProfile→MinderProfileScreen(params:{ minderId: string })BookingRequest→BookingRequestScreen(params:{ minderId: string })BookingDetails→BookingDetailsScreen(params:{ bookingId: string })PetProfile→PetProfileScreen(params:{ petId: string })AddPet→AddPetScreenGPSTracking→GPSTrackingScreen(params:{ bookingId: string })Favourites→FavouritesScreenLeaveReview→LeaveReviewScreen(params:{ bookingId: string; revieweeId: string })Chat→ChatScreen(params:{ threadId: string; otherUserId: string })CreateTicket→CreateTicketScreen
Export OwnerNavigator as default.
Implement a Bottom Tab Navigator with four tabs:
- Dashboard (icon:
home) →MinderDashboardScreen - Jobs (icon:
briefcase) →JobRequestsScreen - Availability (icon:
calendar) →AvailabilityScreen - Profile (icon:
person) →ProfileScreen
Nested stack screens:
JobDetails→JobDetailsScreen(params:{ bookingId: string })Session→SessionScreen(params:{ bookingId: string })MinderProfileEdit→MinderProfileEditScreenChat→ChatScreen(params:{ threadId: string; otherUserId: string })CreateTicket→CreateTicketScreen
Export MinderNavigator as default.
Implement a Stack Navigator:
- Initial route:
AdminDashboard→AdminDashboardScreen TicketQueue→TicketQueueScreenTicketDetail→TicketDetailScreen(params:{ ticketId: string })UserManagement→UserManagementScreen
Export AdminNavigator as default.
The current implementation shows a placeholder home after login. Update the authenticated branch to switch on role from Redux state:
role === 'user'orrole === 'minder'withlisting_type === 'owner'→<OwnerNavigator />role === 'minder'→<MinderNavigator />role === 'admin'orrole === 'customer_support'→<AdminNavigator />
Import all three navigators and the RootState type.
This screen is used by both owners and minders to view and edit their own profile.
ProfileScreen()
- On mount, fetch the current user's profile from
profilestable usingsupabase.from('profiles').select('*').eq('id', currentUserId).single(). - Display:
Avatarcomponent (initials fallback),display_name,username,email,phone,location,preferred_communication,experience(minder only),ratingsas aRatingcomponent. - Show an Edit button that toggles the form into edit mode.
- In edit mode, show
Inputfields fordisplay_name,phone,location,preferences,experience(if minder). - On save, call
supabase.from('profiles').update({ ... }).eq('id', currentUserId)and refresh local state. - Show a
LoadingSpinnerwhile fetching. Show an error message on failure.
FavouritesScreen()
- Fetch favourites:
supabase.from('favourites').select('*, minder:minder_id(*)').eq('owner_id', currentUserId). - Render a
FlatListofMinderCardcomponents, each showing the minder's name, rating, and location. - Pressing a card navigates to
MinderProfilescreen with theminderId. - Empty state: show "No saved minders yet" message.
- Swipe-to-delete or a remove button calls
supabase.from('favourites').delete().eq('id', favId)and removes from local list.
Props received via navigation: bookingId: string, revieweeId: string.
LeaveReviewScreen()
- Show the minder's name and
Avatarat the top. - A
Ratingcomponent in interactive mode (readonly={false}) to pick 1–5 stars. - A multi-line
Inputfor the comment (max 500 chars, show character count). - A submit
Buttonthat callssupabase.from('reviews').insert({ reviewer_id: currentUserId, reviewee_id, booking_id: bookingId, rating, comment }). - After successful insert, also update the minder's average rating in
profiles: fetch all their reviews, calculate average, updateratingsfield. - On success, navigate back and show a success toast/alert.
Branch name: feature/pet-management
Handles everything to do with pets and medical records, plus the Owner's main dashboard screen.
Dependency: Needs Aradhya's types (Pet, MedicalRecord, Booking) and common components (Card, Avatar, LoadingSpinner).
Props: pet: Pet, onPress: () => void.
PetCard({ pet, onPress })
Renders a pressable Card showing the pet's name, type, and breed. Use an emoji icon based on pet type (🐶 dog, 🐱 cat, 🐦 bird, 🐠 fish, 🐾 default). Tapping calls onPress.
Props: record: MedicalRecord.
MedicalRecordCard({ record })
Renders a Card with sections: vet contact info (name, clinic, phone), a list of vaccines with dates, allergies as Badge components (variant 'warning'), and a medical history text block. If any field is empty show a grey placeholder like "Not recorded".
OwnerDashboardScreen()
- On mount, fetch the owner's upcoming/active bookings:
supabase.from('bookings').select('*, pet:pet_id(*), minder:minder_id(*)').eq('requester_id', currentUserId).in('status', ['pending', 'confirmed']).order('start_time'). - Fetch their pets:
supabase.from('pets').select('*').eq('owner_id', currentUserId). - Dispatch both to Redux (
setBookings, but pets can be local state for now). - Layout:
- Greeting header:
"Hello, {display_name}". - Upcoming Bookings horizontal scroll:
FlatListofBookingCardcomponents. Tapping navigates toBookingDetails. - My Pets section:
FlatListofPetCardcomponents. Tapping navigates toPetProfile. - Add Pet button at the bottom of pets section — navigates to
AddPet. - Empty states for both sections.
- Greeting header:
- Show
LoadingSpinnerwhile fetching.
AddPetScreen()
- Form fields using
Inputcomponent:name(required),pet_type(required — show a picker or preset buttons: Dog, Cat, Bird, Fish, Other),breed(optional). - Validation: name must not be empty, pet_type must be selected.
- On submit, call
supabase.from('pets').insert({ owner_id: currentUserId, name, pet_type, breed }). - After insert, optionally navigate to the
PetProfilescreen for the new pet (so the owner can fill medical records). - Show loading state on the submit button during the request.
Props received via navigation: petId: string.
PetProfileScreen()
- Fetch pet:
supabase.from('pets').select('*').eq('id', petId).single(). - Fetch medical record:
supabase.from('medical_records').select('*').eq('pet_id', petId).maybeSingle(). - Display pet details at the top (name, type, breed,
PetCard-style header). - Below, render
MedicalRecordCardif a record exists, or a "No medical record yet" placeholder with an Add Medical Info button. - Edit Pet button: inline form to update
name,breed,pet_typeviasupabase.from('pets').update(...). - Add / Edit Medical Info opens a form with:
vet_name,vet_clinic,vet_phoneasInputfields.medical_historyas a multilineInput.allergies— a tag-style input: type an allergy and press enter to add it to an array; show each as a deletableBadge.vaccine_info— allow adding vaccine entries (name, date, next_due) with an Add button.- On save: upsert
supabase.from('medical_records').upsert({ pet_id: petId, ... }).
- Delete Pet button with confirmation alert. Calls
supabase.from('pets').delete().eq('id', petId)then navigates back.
Branch name: feature/listings-search
Implements the search and listings features for pet owners to discover minders, and for users to manage their own listings.
Dependency: Needs Aradhya's types (Listing, User), listingsSlice, useListings hook structure, and Card, Badge, Rating, LoadingSpinner components.
Props: listing: Listing, onPress: () => void.
ListingCard({ listing, onPress })
Pressable Card showing: listing type badge (Badge with 'info' for minder, 'success' for owner), location, animal type, price per hour (formatPricePerHour), and Rating component for rating. Tapping calls onPress.
Props: minder: User & { listing?: Listing }, onPress: () => void, isFavourited?: boolean, onToggleFavourite?: () => void.
MinderCard({ minder, onPress, isFavourited, onToggleFavourite })
Card with Avatar (left), minder's display_name, location, rating stars, price/hr. A heart icon (♡/♥) button in top-right corner to toggle favourite. Tapping the card calls onPress.
Props: filters: { animal?: string; location?: string; maxPrice?: number }, onChange: (filters) => void.
FilterBar({ filters, onChange })
A horizontal row of filter inputs. Animal type: pill buttons (All, Dog, Cat, Bird, Fish). Location: small Input text field. Max price: a simple Input with numeric keyboard. Changing any value calls onChange with the updated filters. Dispatch to listingsSlice.setFilters in the parent.
Implement and export the following functions (not a React hook class — just named async functions that interact with Supabase and dispatch to Redux):
fetchListings(dispatch, filters?: { animal?: string; location?: string; maxPrice?: number }): Promise<void>
Query supabase.from('listings').select('*, user:user_id(*)').eq('listing_type', 'minder'). Apply filters: ilike('animal', ...), ilike('location', ...), lte('price', ...) if provided. Dispatch setListingsLoading(true), then setListings(data), then setListingsLoading(false). On error dispatch setListingsError.
fetchMyListings(dispatch, userId: string): Promise<Listing[]>
Fetch all listings where user_id = userId. Return the array.
createListing(dispatch, listing: Omit<Listing, 'id' | 'created_at' | 'rating'>): Promise<Listing | null>
Insert into listings table. Return the created listing.
updateListing(dispatch, id: string, updates: Partial<Listing>): Promise<void>
Update listing by id.
deleteListing(dispatch, id: string): Promise<void>
Delete listing by id.
SearchMinderScreen()
- On mount, call
fetchListings(dispatch)to load all minder listings. - Render
FilterBarat the top. When filters change, re-callfetchListings(dispatch, filters). - Render a
FlatListofMinderCardcomponents. - For each card, check if
minderIdis in user's favourites (fetch once on mount fromsupabase.from('favourites').select('minder_id').eq('owner_id', currentUserId)). onToggleFavourite: if favourited, delete fromfavourites; if not, insert. Update local state.- Tapping a card navigates to
MinderProfilewith{ minderId: listing.user_id }. - Show
LoadingSpinnerwhile fetching. Show error message on failure. - Empty state: "No minders found. Try adjusting your filters."
Props received via navigation: minderId: string.
MinderProfileScreen()
- Fetch minder profile:
supabase.from('profiles').select('*').eq('id', minderId).single(). - Fetch minder's active listing:
supabase.from('listings').select('*').eq('user_id', minderId).eq('listing_type', 'minder').maybeSingle(). - Fetch reviews for this minder:
supabase.from('reviews').select('*, reviewer:reviewer_id(display_name, username)').eq('reviewee_id', minderId).order('date', { ascending: false }). - Display:
Avatar, name, location, rating (Ratingcomponent), experience text, listing details (animal types, price, available times). - Reviews section: scrollable list of review cards showing star rating, comment, reviewer name, date.
- Bottom CTA buttons: Book Now (navigates to
BookingRequestwith{ minderId }) and Message (navigates toChatwith the thread id{currentUserId}_{minderId}). - Heart button in header to favourite/unfavourite.
ListingsScreen()
This screen serves both owners (to post "I need a minder" listings) and minders (to manage their own "I'm available" listings). Detect role from Redux state.
- On mount, call
fetchMyListings(dispatch, currentUserId)to show the user's own listings. - Display each listing in a
ListingCard. - Create Listing button opens a modal form with fields:
description(multiline),location,animal,time,price. On submit callcreateListing(dispatch, { ...formData, user_id, listing_type }). - Each existing listing card has an Edit button (pre-fills form) and a Delete button with confirmation alert.
- Edit calls
updateListing; Delete callsdeleteListing.
Branch name: feature/bookings
Implements the complete booking flow from request to completion for the pet owner side.
Dependency: Needs Aradhya's types (Booking, Pet), bookingSlice, common components, and CalendarPicker outlined below.
Props: booking: BookingWithDetails, onPress: () => void.
BookingCard({ booking, onPress })
Pressable Card showing: pet name + type emoji, minder's Avatar and name, booking start/end times (formatDateTime), duration (formatDuration), BookingStatusBadge, and location. Tapping calls onPress.
Props: status: BookingStatus.
BookingStatusBadge({ status })
Renders a Badge with label = status (capitalised) and variant:
pending→'warning'confirmed→'success'cancelled→'danger'completed→'info'
Props: availableSlots: TimeSlot[], selectedStart: Date | null, selectedEnd: Date | null, onRangeChange: (start: Date, end: Date) => void.
CalendarPicker({ availableSlots, selectedStart, selectedEnd, onRangeChange })
Render a simple calendar view showing the current month. Days that have available slots are highlighted in green. First tap selects a day (start and end both that day). A second tap on another day sets an inclusive range; every day between must be available. A tap when a multi-day range is already selected starts a new single-day selection. Use React Native's built-in date/time capabilities — do not add new dependencies.
Implement and export:
fetchOwnerBookings(dispatch, ownerId: string): Promise<void>
Query supabase.from('bookings').select('*, pet:pet_id(*), minder:minder_id(display_name, ratings, location)').eq('requester_id', ownerId).order('start_time'). Dispatch setBookings.
fetchMinderBookings(dispatch, minderId: string): Promise<void>
Same query but .eq('minder_id', minderId). Dispatch setBookings.
createBooking(dispatch, booking: Omit<Booking, 'id' | 'created_at' | 'status'>): Promise<Booking | null>
Insert into bookings table with status: 'pending'. Dispatch addBooking. Return created booking.
updateBookingStatus(dispatch, bookingId: string, status: BookingStatus): Promise<void>
Update status field. Dispatch updateBookingStatus action.
cancelBooking(dispatch, bookingId: string): Promise<void>
Calls updateBookingStatus(dispatch, bookingId, 'cancelled').
Props received via navigation: minderId: string.
BookingRequestScreen()
- Fetch the minder's calendar availability:
supabase.from('calendars').select('*').eq('minder_id', minderId).maybeSingle(). - Fetch the owner's pets:
supabase.from('pets').select('*').eq('owner_id', currentUserId). - Form:
- Select Pet — a horizontal scrollable list of
PetCardcomponents (single selection). - Choose dates —
CalendarPickerwithavailableSlotsfrom minder's calendar (one day or a consecutive range). - Start and end time — start time on the first day and end time on the last day (end must be after start overall).
- Location —
Inputfield pre-filled with minder's location, editable.
- Select Pet — a horizontal scrollable list of
- Summary section showing price estimate:
formatPricePerHour(listing.price)× estimated hours. - Send Request button: validate all fields, call
createBooking(dispatch, { pet_id, requester_id: currentUserId, minder_id: minderId, location, start_time, end_time })with ISO datetimes from the chosen day and times. - On success, show alert and navigate back to dashboard.
Props received via navigation: bookingId: string.
BookingDetailsScreen()
- Fetch booking:
supabase.from('bookings').select('*, pet:pet_id(*), minder:minder_id(*), requester:requester_id(*)').eq('id', bookingId).single(). - Display full booking information:
BookingCardstyle layout but expanded with all details. - Show
BookingStatusBadgeprominently. - Action buttons depending on status:
pending: Cancel Request button → callscancelBooking.confirmed: Track Pet button → navigates toGPSTrackingwith{ bookingId }. Message Minder → navigates toChat.completed: Leave Review button → navigates toLeaveReviewwith{ bookingId, revieweeId: minder_id }.cancelled: show cancelled message with date.
- Show loading spinner while fetching.
Branch name: feature/minder
Builds all screens for the Pet Minder role: their dashboard, incoming job management, availability calendar, profile editing, and active session tracking.
Dependency: Needs Aradhya's types and slices, useBookings hook from Ulina, BookingCard and BookingStatusBadge components from Ulina.
MinderDashboardScreen()
- On mount, call
fetchMinderBookings(dispatch, currentUserId). - Layout:
- Header: greeting + the minder's average rating displayed as
Ratingcomponent. - Active / Upcoming Jobs section:
FlatListofBookingCard(statusconfirmed) sorted bystart_time. Tapping navigates toJobDetails. - Pending Requests section:
FlatListofBookingCard(statuspending). Tapping navigates toJobDetails. - Earnings Summary (read-only): count of completed bookings this month + total estimated earnings (sum of
price × durationfrom confirmed/completed listings).
- Header: greeting + the minder's average rating displayed as
- Pull-to-refresh to re-fetch bookings.
JobRequestsScreen()
- Display all bookings for the minder sorted by
created_atdescending. - Filter tabs at the top: All, Pending, Confirmed, Completed, Cancelled. Selecting a tab filters the list.
- Render
BookingCardfor each. Tapping navigates toJobDetails. - Pull-to-refresh. Loading spinner. Empty state per tab.
Props received via navigation: bookingId: string.
JobDetailsScreen()
- Fetch full booking with related data: pet info, owner profile, location.
- Display all booking details: pet name/type/breed, owner name + contact, dates/times, location,
BookingStatusBadge. - Also fetch the pet's medical record:
supabase.from('medical_records').select('*').eq('pet_id', booking.pet_id).maybeSingle(). If it exists, show a View Medical Record expandable section usingMedicalRecordCard. - Action buttons:
- If
pending: Accept → callsupdateBookingStatus(dispatch, bookingId, 'confirmed'). Decline → callscancelBooking. - If
confirmed: Start Session → navigates toSessionwith{ bookingId }. Message Owner → navigates toChat. - If
completed: show completion date and a prompt to respond to any review left.
- If
AvailabilityScreen()
- Fetch the minder's calendar:
supabase.from('calendars').select('*').eq('user_id', currentUserId).maybeSingle(). - Display a weekly calendar grid (Monday–Sunday). Each day shows existing available time slots as coloured blocks.
- Add Availability button: opens a bottom sheet form with fields:
day(day of week picker),starttime,endtime. On submit, appends toavailable_timingarray and callssupabase.from('calendars').upsert({ user_id: currentUserId, available_timing: updatedArray, updated_at: now() }). - Each existing slot has a delete button (remove from array and upsert).
booked_timingslots are shown in a different colour (read-only — they are populated when bookings are confirmed).
MinderProfileEditScreen()
- Pre-load current profile data from Redux state or re-fetch from Supabase.
- Editable fields:
display_name,phone,location,experience(multiline),preferences,preferred_communication(picker: In-App / Email / Phone), vet clinic fields (vet_clinic_name,vet_clinic_phone,vet_clinic_address). - On save, call
supabase.from('profiles').update({ ... }).eq('id', currentUserId). DispatchsetUseraction to update Redux store. - Validation:
display_namenot empty,phonevalid UK format (reusevalidatePhonefromvalidators.ts). - Cancel button discards changes.
Props received via navigation: bookingId: string.
SessionScreen()
- Fetch booking details to display context (pet name, owner name, location).
- On mount, call
startGPSTracking(bookingId)(see Rohan'suseGPS). This starts sending location updates to Supabase every 30 seconds. - Display a map-style placeholder (a
Viewwith the current GPS coordinates shown as text if expo-maps is unavailable) or useexpo-locationto showlatitudeandlongitude. - Show session timer (elapsed time since mount).
- End Session button: stops GPS tracking, calls
updateBookingStatus(dispatch, bookingId, 'completed'), navigates back toMinderDashboard. - Show a pulsing indicator while tracking is active.
Branch name: feature/chat-gps-admin
The most diverse workstream: real-time messaging, live pet GPS tracking for owners, and the full admin/support panel.
Dependency: Needs Aradhya's types (ChatMessage, Ticket), chatSlice, ticketSlice, and common components.
Props: message: ChatMessage, isOwn: boolean.
MessageBubble({ message, isOwn })
Render a chat bubble: isOwn messages are right-aligned with a blue/teal background; received messages are left-aligned with a light grey background. Show message text, and time below in small grey text (formatRelativeTime). Implement a simple read_status indicator (double tick ✓✓ in blue when read, grey when unread) for own messages only.
Props: onSend: (message: string) => void, disabled?: boolean.
ChatInput({ onSend, disabled })
A bottom-docked row with a text Input (multiline, expands up to 4 lines) and a Send Button. Pressing Send or the return key calls onSend(text) and clears the input. Disable send button when input is empty or disabled is true.
Implement and export:
fetchThread(dispatch, threadId: string): Promise<void>
Query supabase.from('chat_messages').select('*').eq('thread_id', threadId).order('created_at'). Dispatch setThreadMessages({ threadId, messages: data }).
sendMessage(dispatch, msg: Omit<ChatMessage, 'id' | 'created_at' | 'read_status'>): Promise<void>
Insert into chat_messages. Dispatch appendMessage.
subscribeToThread(threadId: string, onNewMessage: (msg: ChatMessage) => void): RealtimeChannel
Use Supabase Realtime: supabase.channel('thread-{threadId}').on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'chat_messages', filter: 'thread_id=eq.{threadId}' }, callback).subscribe(). Return the channel so the component can unsubscribe on unmount.
markMessagesRead(threadId: string, receiverId: string): Promise<void>
supabase.from('chat_messages').update({ read_status: true }).eq('thread_id', threadId).eq('receiver_id', receiverId).eq('read_status', false).
Props received via navigation: threadId: string, otherUserId: string.
ChatScreen()
- On mount, fetch the other user's display name and
Avatarfor the header. - Call
fetchThread(dispatch, threadId)to load history. - Subscribe with
subscribeToThread(threadId, (msg) => dispatch(appendMessage(msg))). On unmount, callchannel.unsubscribe(). - Call
markMessagesRead(threadId, currentUserId)on mount and when new messages arrive. - Render a
FlatList(inverted) ofMessageBubblecomponents sourced from Reduxstate.chat.threads[threadId]. ChatInputat the bottom. On send, callsendMessage(dispatch, { sender_id: currentUserId, receiver_id: otherUserId, message: text, thread_id: threadId }).- Auto-scroll to latest message on new message.
Implement and export:
startGPSTracking(bookingId: string): () => void
Request Location.requestForegroundPermissionsAsync(). If denied, alert the user. If granted, start a Location.watchPositionAsync watcher with accuracy Balanced and interval 30 000 ms. On each update, call updateGPSLocation(bookingId, coords.latitude, coords.longitude). Return a cleanup function that removes the watcher.
updateGPSLocation(bookingId: string, latitude: number, longitude: number): Promise<void>
supabase.from('gps_locations').upsert({ booking_id: bookingId, latitude, longitude, updated_at: new Date().toISOString() }).
subscribeToGPS(bookingId: string, onUpdate: (lat: number, lon: number) => void): RealtimeChannel
Subscribe to postgres_changes on gps_locations filtered by booking_id. Call onUpdate with new coords. Return the channel.
fetchLastLocation(bookingId: string): Promise<{ latitude: number; longitude: number } | null>
supabase.from('gps_locations').select('latitude, longitude').eq('booking_id', bookingId).maybeSingle().
Props received via navigation: bookingId: string.
GPSTrackingScreen()
- On mount, call
fetchLastLocation(bookingId)and display the initial coordinates. - Subscribe with
subscribeToGPS(bookingId, (lat, lon) => setLocation({ lat, lon })). Unsubscribe on unmount. - Display: a placeholder map area (large
Viewwith a grey background labelled "Map View") showing the rawlatitudeandlongitudewithformatDateTime(updatedAt). - Show a pulsing "Live" indicator while connected.
- If
expo-locationmap view is feasible, render aMapViewusingreact-native-mapsif it's available inpackage.json; otherwise the coordinate display is sufficient. - Back button returns to
BookingDetails.
Implement and export:
fetchUserTickets(dispatch, userId: string): Promise<void>
supabase.from('tickets').select('*').eq('by_user', userId).order('created_at', { ascending: false }). Dispatch setTickets.
fetchAllTickets(dispatch): Promise<void>
(Admin only) supabase.from('tickets').select('*, user:by_user(display_name, email)').order('created_at', { ascending: false }). Dispatch setTickets.
createTicket(dispatch, ticket: Omit<Ticket, 'id' | 'created_at' | 'updated_at' | 'status'>): Promise<Ticket | null>
Insert into tickets. Dispatch addTicket. Return the created ticket.
updateTicketStatus(dispatch, ticketId: string, status: TicketStatus): Promise<void>
Update status and updated_at. Dispatch updateTicketStatus.
CreateTicketScreen()
- Form fields:
query_type— textInput(short summary).category— picker: General / Booking / Payment / Account / Safety.issue_description— multilineInput(required, min 20 chars).
- On submit, call
createTicket(dispatch, { query_type, category, issue_description, by_user: currentUserId, priority: 'medium' }). - On success, show confirmation alert and navigate back.
- Validation:
issue_descriptionat least 20 characters.
AdminDashboardScreen()
- On mount, fetch summary stats:
- Total users:
supabase.from('profiles').select('id', { count: 'exact' }). - Open tickets:
supabase.from('tickets').select('id', { count: 'exact' }).neq('status', 'closed'). - Active bookings:
supabase.from('bookings').select('id', { count: 'exact' }).eq('status', 'confirmed'). - New users this week: filter
profiles.created_at > 7 days ago.
- Total users:
- Display each stat in a
Cardas a large number with a label. - Buttons: View Ticket Queue →
TicketQueue, Manage Users →UserManagement.
TicketQueueScreen()
- Call
fetchAllTickets(dispatch)on mount. - Filter tabs: All, Pending, Opened, Closed.
- Priority sort: high → medium → low within each tab.
- Each ticket row shows: category
Badge, query_type, submitter name, priority (coloured),created_atrelative time, status. - Tapping a row navigates to
TicketDetailwith{ ticketId }. - Pull-to-refresh.
Props received via navigation: ticketId: string.
TicketDetailScreen()
- Fetch:
supabase.from('tickets').select('*, user:by_user(display_name, email, username)').eq('id', ticketId).single(). - Display all ticket fields: submitter info, category, issue description, timestamps.
- Status Controls: three buttons — Open / Close / Escalate (High Priority). Each calls
updateTicketStatus(dispatch, ticketId, newStatus)or updatespriority. - Message User button: navigates to
Chatwith thread idsupport_{ticketId}so the admin can reply directly.
UserManagementScreen()
- Fetch all profiles:
supabase.from('profiles').select('*').order('created_at', { ascending: false }). - Search bar at top that filters by
usernameoremailclient-side. - Role filter tabs: All, Users, Minders, Admins.
- Each row:
Avatar, username, email, roleBadge, account_statusBadge,created_at. - Tapping a user opens an action sheet (bottom modal) with:
- Suspend Account →
supabase.from('profiles').update({ account_status: 'suspended' }).eq('id', userId). - Ban Account → updates
account_status: 'banned'. - Reactivate → updates
account_status: 'active'. - Change Role → picker to reassign role, updates
rolefield.
- Suspend Account →
- Pull-to-refresh.
| Person | Branch | Key Files |
|---|---|---|
| Aradhya — Foundation | feature/foundation |
All src/types/*.ts, src/store/*Slice.ts, src/utils/formatDate.ts, src/utils/formatPrice.ts, src/components/common/Card.tsx, Avatar.tsx, Badge.tsx, Rating.tsx, LoadingSpinner.tsx, all supabase/migrations/*.sql |
| Alaur — Navigation & Profile | feature/navigation-profile |
OwnerNavigator.tsx, MinderNavigator.tsx, AdminNavigator.tsx, AppNavigator.tsx (update), ProfileScreen.tsx, FavouritesScreen.tsx, LeaveReviewScreen.tsx |
| Tahrima — Pet Management | feature/pet-management |
PetCard.tsx, MedicalRecordCard.tsx, OwnerDashboardScreen.tsx, AddPetScreen.tsx, PetProfileScreen.tsx |
| Xinzhu — Listings & Search | feature/listings-search |
ListingCard.tsx, MinderCard.tsx, FilterBar.tsx, useListings.ts, SearchMinderScreen.tsx, MinderProfileScreen.tsx, ListingsScreen.tsx |
| Ulina — Bookings | feature/bookings |
BookingCard.tsx, BookingStatusBadge.tsx, CalendarPicker.tsx, useBookings.ts, BookingRequestScreen.tsx, BookingDetailsScreen.tsx |
| William — Minder Features | feature/minder |
MinderDashboardScreen.tsx, JobRequestsScreen.tsx, JobDetailsScreen.tsx, AvailabilityScreen.tsx, MinderProfileEditScreen.tsx, SessionScreen.tsx |
| Rohan — Chat, GPS & Admin | feature/chat-gps-admin |
MessageBubble.tsx, ChatInput.tsx, useChat.ts, ChatScreen.tsx, useGPS.ts, GPSTrackingScreen.tsx, useTickets.ts, CreateTicketScreen.tsx, AdminDashboardScreen.tsx, TicketQueueScreen.tsx, TicketDetailScreen.tsx, UserManagementScreen.tsx |
Aradhya (Foundation)
└─► Alaur (Navigation) ─────────────────────────────────────────────────────┐
└─► Tahrima (Pet Management) ───────────────────────────────────────────────┤
└─► Xinzhu (Listings) ───────────────────────────────────────────────────── ┤
└─► Ulina (Bookings) ────────────────────────────────────────────────────── ┤
└─► William (Minder) — needs BookingCard, useBookings from Ulina ┤
└─► Rohan (Chat/GPS/Admin) ┘
└─► All merge into main
Tip: Alaur, Tahrima, Xinzhu, Ulina, and Rohan can all start once Aradhya has pushed the types and Redux slices. William should wait for Ulina's
BookingCardanduseBookingsto be merged, or stub them temporarily.