How pujari431/find-my-doc-now works
Project type and purpose
• This is a single-page, full-client React application built with Vite and TypeScript, using shadcn-ui and Tailwind for styling.
• Its purpose is to present a list of doctors and detailed doctor profiles via pages under src/pages, powered by a light “doctor-service” client in src/lib/doctor-service.ts.
File structure
• Top-level files:
• index.html, public/ → static entry point & assets
• Vite config & TS configs → build and type setup
• src/ → application code
• src/main.tsx → SPA bootstrap
• src/App.tsx → top-level router and shell
• src/pages/* → route components like Home, Doctors, DoctorProfile, NotFound
• src/components/ → reusable UI slices (Navbar, Hero, Footer, DoctorCard)
• src/components/ui/ → shadcn-ui primitives (buttons, dialogs, inputs, etc.)
• src/lib/doctor-service.ts → API client calling external backend
• src/hooks/ → custom hooks (mobile detection, toast notifications)
README for architectural hints
• Front-end only project, deployed via Lovable.
• No internal backend; all data comes from an external service (endpoint URL hidden in doctor-service).
• Dev server (npm run dev) provided by Vite.
Diagramming the system
a. Main components:
• Browser / User Agent
• React SPA (split into UI layer, routing layer, data layer)
• External Doctor API service
• Build & Deployment (Vite dev server / Lovable hosting)
b. Relationships & interactions:
• User → Browser → React SPA
• SPA → calls doctor-service → External API → returns JSON → SPA
• During development: Vite Dev Server serves assets and enables HMR
• On publish: Lovable CI/CD takes build output → static hosting with optional custom domain
c. Architectural patterns & principles:
• Component-based UI (Atomic + composite components in src/components)
• Unidirectional data flow: page → component → hook → service → API
• Separation of concerns:
• UI primitives (src/components/ui)
• Feature components (src/components/DoctorCard.tsx, etc.)
• Routing (App.tsx + src/pages)
• Data fetching (src/lib/doctor-service.ts)
d. Key technologies & libraries:
• React + React Router (via App.tsx for routing)
• Vite (fast dev server + build)
• TypeScript (typesafety)
• Tailwind CSS + shadcn-ui (design system)
• Lovable (CI/CD & hosting)