AMS fetches its doctor roster from a MockAPI endpoint on every app launch and whenever the Home screen mounts. Each doctor card displays avatar, name, qualification, department, star rating, and comment count. Users can mark any doctor as a favourite — that preference is persisted to AsyncStorage and survives app restarts. A dedicated Doctors listing screen lets users sort and filter the full roster in multiple ways before diving into a doctor’s full profile.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Jay-byte389/AMS/llms.txt
Use this file to discover all available pages before exploring further.
Doctor Data Shape
Each object returned byGET /Doctors contains the following fields:
| Field | Type | Description |
|---|---|---|
id | string | Unique MockAPI record ID |
name | string | Doctor’s display name |
qualification | string | Abbreviated degree, e.g. "M.D." |
department | string | Medical speciality / department |
avatar | string | Remote image URL |
ratings | number | Average star rating |
comments | number | Total comment count |
experience | number | Years of experience |
focus | string | Primary clinical focus area |
profile | string | Biographical profile paragraph |
careerpath | string | Career history narrative |
highlights | string | Key professional highlights |
reviews | number | Total review count (falls back to 40) |
Fetching Doctors
Doctors are loaded via thefetchDoctors thunk, which calls GET /Doctors through the Axios instance configured at https://6a61e9edda10c59c180a02b0.mockapi.io:
doctorsList in the doctors slice:
HomeScreen shows an ActivityIndicator. Once resolved, the list renders in a FlatList.
Home Screen Doctor Card
Each card in theHomeScreen FlatList displays:
- Avatar — remote image loaded with
source={{ uri: item.avatar }} - Name + Qualification — displayed together as
{item.name} {item.qualification} - Department — shown as the speciality subtitle
- Star rating chip —
item.ratingsalongside a star icon - Comment chip —
item.commentsalongside a comment icon - Favourite toggle — heart icon that dispatches
toggleFavourtie(item.id); filled whenfavouriteIds.includes(item.id)
Doctor Detail Screen (DoctorInfo)
Navigating to theInfo route (from HomeScreen or Doctors) passes the full doctor object as a route parameter:
DoctorInfo screen renders a two-section layout:
- Info Section
- Schedule Section
- Experience badge — shows
{doctor.experience} Years Experience - Focus card — highlights
doctor.focus - Name card —
doctor.name+doctor.qualification+doctor.department - Stats row — star rating, review count (
doctor.reviews || 40), and availability hours (Mon-Sat / 9:00AM - 5:00PM) - Profile —
doctor.profileparagraph - Career Path —
doctor.careerpathparagraph - Highlights —
doctor.highlightsparagraph - Schedule button — switches the view to the calendar/slot selector
Disabling Fully-Booked Calendar Dates
DoctorInfo computes markedDates from the Redux appointments list:
Doctors Listing Screen
Navigating from the Home screen via the Doctors button opensDoctors.jsx, which receives the full doctor array as route.params.doctors. The screen provides a horizontal sort/filter bar with five modes:
| Tab | Index | Behaviour |
|---|---|---|
A→Z | 0 | Sorts by name alphabetically |
| Star icon | 1 | Sorts by ratings descending |
| Heart icon | 2 | Filters to doctors in favouriteIds |
| Venus icon | 3 | Filters by gender === 'Male' |
| Mars icon | 4 | Filters by gender === 'Female' |
Favourites component which groups doctors by department in an expandable accordion view.
Tapping an Info button on any card navigates to DoctorInfo:
Favourites
Favourite state lives in thedoctors Redux slice as a plain favouriteIds array:
@favourite_doctors key. HomeScreen loads them on mount and saves them whenever the array changes: