How obai-khsara/doctor-appointment-frontend works
This is a React doctor-appointment frontend. Users browse doctors and departments, register or log in, then create and manage appointments; administrators can add doctors. The app entry point mounts routing, authentication, and query providers, while route components and shared hooks handle screens and backend requests. The README is only the Vite template, so product capabilities are inferred from the source index and excerpts. Unsampled component internals limit some screen-to-hook details; shown API relationships are supported by the sampled hooks.
Main entry points: App.jsx Routes and shell · Home.jsx Home page · useDoctor.js Doctor data hooks · AuthContext.jsx Auth context
Components 26
App and navigation
- React entry
src/main.jsx - Routes and shell
src/App.jsx - Desktop navigation
src/components/Navbar.jsx - Mobile navigation
src/components/NavbarMobile.jsx - Not found page
src/pages/NotFound.jsx
Doctor discovery
- Home page
src/pages/Home.jsx - Hero slider
src/components/HeroSlider.jsx - Call to action
src/components/CallToAction.jsx - About section
src/components/About.jsx - Service statistics
src/components/States.jsx - Department listing
src/components/Departments.jsx - Doctor highlights
src/components/Doctors.jsx - Doctor directory
src/pages/AllDoctors.jsx - Doctor details
src/pages/DoctorDetails.jsx - Doctor data hooks
src/hooks/useDoctor.js - Department data hooks
src/hooks/useDepartments.js
Identity and access
- Auth context
src/context/AuthContext.jsx - Login screen
src/components/Login.jsx - Registration screen
src/components/Register.jsx - Route access guard
src/components/RequireAuth.jsx
Appointments and administration
- Create appointment
src/pages/AddAppointment.jsx - Appointment data hooks
src/hooks/useAppointments.js - My appointments
src/pages/MyAppointment.jsx - Add doctor
src/pages/AddDoctor.jsx
Other components
- Visitor / patient / admin
- Appointment backend
Connections 39
- Visitor / patient / admin → React entry: opens app
src/main.jsx - React entry → Routes and shell: renders
src/main.jsx - React entry → Auth context: provides auth
src/main.jsx - Routes and shell → Desktop navigation: renders
src/App.jsx - Routes and shell → Home page: routes to
src/App.jsx - Routes and shell → Login screen: routes to
src/App.jsx - Routes and shell → Registration screen: routes to
src/App.jsx - Routes and shell → Doctor directory: routes to
src/App.jsx - Routes and shell → Doctor details: routes to
src/App.jsx - Routes and shell → Route access guard: guards routes
src/App.jsx - Routes and shell → Add doctor: routes to
src/App.jsx - Routes and shell → Create appointment: routes to
src/App.jsx - Routes and shell → My appointments: routes to
src/App.jsx - Routes and shell → Not found page: fallback route
src/App.jsx - Routes and shell → Mobile navigation: shows conditionally
src/App.jsx - Desktop navigation → Auth context: reads session
src/components/Navbar.jsx - Mobile navigation → Auth context: reads session
src/components/NavbarMobile.jsx - Login screen → Auth context: uses auth
src/components/Login.jsx - Registration screen → Auth context: uses auth
src/components/Register.jsx - Route access guard → Auth context: checks access
src/components/RequireAuth.jsx - Home page → Hero slider: renders
src/pages/Home.jsx - Home page → Call to action: renders
src/pages/Home.jsx - Home page → About section: renders
src/pages/Home.jsx - Home page → Service statistics: renders
src/pages/Home.jsx - Home page → Department listing: renders
src/pages/Home.jsx - Home page → Doctor highlights: renders
src/pages/Home.jsx - Department listing → Department data hooks: loads data
src/components/Departments.jsx - Service statistics → Department data hooks: loads counts
src/components/States.jsx - Service statistics → Doctor data hooks: loads counts
src/components/States.jsx - Doctor highlights → Doctor data hooks: loads data
src/components/Doctors.jsx - Doctor directory → Doctor data hooks: loads doctors
src/pages/AllDoctors.jsx - Doctor details → Doctor data hooks: loads doctor
src/pages/DoctorDetails.jsx - Create appointment → Doctor data hooks: loads choices
src/pages/AddAppointment.jsx - Create appointment → Appointment data hooks: submits booking
src/pages/AddAppointment.jsx - My appointments → Appointment data hooks: manages bookings
src/pages/MyAppointment.jsx - Add doctor → Doctor data hooks: submits doctor
src/pages/AddDoctor.jsx - Doctor data hooks → Appointment backend: requests doctors
src/hooks/useDoctor.js - Department data hooks → Appointment backend: requests departments
src/hooks/useDepartments.js - Appointment data hooks → Appointment backend: manages appointments
src/hooks/useAppointments.js