How tanvirhassan-official/careloom-client works
1. Overall shape
- Careloom here is a Next.js App Router frontend. The repository mainly contains the user-facing application: home page, doctor browsing, appointment details, auth screens, and dashboard screens.
- The actual data/auth backend is mostly خارج this repo boundary; the README points to a separate Careloom-server repository.
2. Primary runtime boundary
- src/app defines the route map, while most UI logic is pushed into src/components/clientPages.
- That split suggests a clear separation between route shells and page implementations: app routes mount reusable client-page components rather than containing heavy logic directly.
3. Route structure
- Public pages:
- / home
- /appointments doctor listing
- /appointments/category/[speciality] specialty filtering
- /appointments/[id] doctor detail / booking entry point
- /signin and /signup
- Protected/user pages:
- /dashboard
- Support routes:
- /api/auth/[...all] for authentication handling
- not-found.jsx for 404 behavior
4. Doctor discovery subsystem
- The appointment browsing flow is the core product path.
- src/components/clientPages/Doctors.jsx, Specialists.jsx, and TopRatedDoctors.jsx indicate multiple views into the same doctor catalog: full list, specialty-oriented views, and highlighted doctors on the home page.
- doctorCard.jsx and the appointment route pages imply doctor records are rendered as reusable cards and then expanded into details pages.
5. Appointment management subsystem
- The booking flow centers on /appointments/[id], where a user likely sees a doctor profile and books a slot.
- The dashboard contains Appointments.jsx, which likely supports view/update/delete of existing bookings, matching the README’s “My Bookings” behavior.
- This is the main read/write domain in the app: doctor selection → booking creation → user-managed booking lifecycle.
6. Authentication and session subsystem
- Authentication is handled through src/lib/auth.js, src/lib/auth-client.js, and the catch-all route src/app/api/auth/[...all]/route.js.
- The README indicates email/password, Google login, JWT sessions, and protected routes, so auth is a first-class system boundary rather than a simple UI feature.
- GoogleLogin.jsx, Signin.jsx, and Signup.jsx are the user entry points for this flow.
7. Protected route / access control boundary
- src/proxy.js likely enforces route-level access control, redirecting unauthenticated users away from dashboard/booking areas and preserving intended destination after login.
- This means the architecture separates public browsing from authenticated booking management, with auth gating applied centrally.
8. Dashboard subsystem
- src/components/clientPages/Dashboard.jsx appears to be the dashboard shell.
- The dashboard supports profile management and booking management, so it is the app’s authenticated workspace.
- The dashboard is a consumer of the same underlying auth/session state and booking data as the public appointment pages, but with edit privileges.
9. Home page and marketing/information layer
- Banner.jsx, Why.jsx, Footer.jsx, Navbar.jsx, and Avatar.jsx suggest a conventional landing-page layer that introduces the service and routes users into discovery or auth flows.
- src/components/page.jsx and TopRatedDoctors.jsx likely compose the home page into sections emphasizing trust and featured doctors.
10. Styling and UI system
- globals.css, postcss.config.mjs, and the README’s Tailwind/DaisyUI references indicate a utility-first styling setup with component-level responsiveness.
- This affects the architecture mostly as a shared presentation layer rather than a data layer.
11. External dependencies and service boundaries
- The frontend depends on an external API/backend for doctors, appointments, and user records; the separate server repo is the persistence and business-logic boundary.
- Authentication is integrated through the app’s auth route and shared auth libraries, rather than being embedded directly in each page.
12. Data flow summary
- Typical user flow:
1. Visit home or appointments listing
2. Filter/browse doctors by specialty
3. Open doctor details
4. Sign in/sign up if needed
5. Book an appointment
6. Manage bookings/profile in the dashboard
- This creates a mostly linear flow with two important shared dependencies: session state and backend-sourced doctor/appointment data.
13. Why this matters for an architecture diagram
- The clearest diagram should show:
- A Next.js frontend shell
- A client-page UI layer
- A route/auth boundary
- An external backend/API/database boundary
- The central interactions are browsing doctors, authenticating users, and managing appointments, with the dashboard representing the authenticated control plane.
Main entry points: page.js Home · layout.js App shell · auth.js Auth setup · doctorCard.jsx Doctor card
Components 30
App routes
Next.js App Router shells and route endpoints
- App shell · Global document and shared app chrome
src/app/layout.js - Home · Public entry page for the product
src/app/page.js - Appointments · Doctor browsing entry point
src/app/appointments/page.jsx - Specialty filter · Appointment browsing by speciality
src/app/appointments/category/[speciality]/page.jsx - Doctor detail · Doctor profile and booking entry point
src/app/appointments/[id]/page.jsx - Dashboard · Authenticated workspace for profile and bookings
src/app/dashboard/page.jsx - Sign in · User login entry page
src/app/signin/page.jsx - Sign up · User registration entry page
src/app/signup/page.jsx
UI components
Shared presentation and page-level client components
- Page sections · Home page sections and shared marketing content
src/components/page.jsx - Doctors view · Main doctor listing and browsing UI
src/components/clientPages/Doctors.jsx - Specialists view · Specialty-oriented doctor discovery UI
src/components/clientPages/Specialists.jsx - Top rated · Highlighted doctors shown on the home page
src/components/TopRatedDoctors.jsx - Doctor card · Reusable doctor summary card
src/components/doctorCard.jsx - Bookings UI · Appointment management interface in the dashboard
src/components/clientPages/Appointments.jsx - Dashboard shell · Authenticated dashboard container
src/components/clientPages/Dashboard.jsx - Sign in UI · Login form and related actions
src/components/clientPages/Signin.jsx - Sign up UI · Registration form and related actions
src/components/clientPages/Signup.jsx - Google login · Third-party sign-in entry point
src/components/GoogleLogin.jsx - Navbar · Primary navigation across public and auth flows
src/components/Navbar.jsx - Banner · Home page hero content
src/components/Banner.jsx - Why careloom · Value proposition and trust content
src/components/Why.jsx - Footer · Shared footer content
src/components/Footer.jsx - Avatar · User identity display component
src/components/Avatar.jsx
Auth boundary
Authentication, session, and route protection
- Auth API · Catch-all authentication endpoint
src/app/api/auth/[...all]/route.js - Access proxy · Route-level protection and redirect handling
src/proxy.js - Auth setup · Server-side authentication configuration
src/lib/auth.js - Client auth · Browser-side authentication/session helpers
src/lib/auth-client.js
Shared assets
Global styles and layout plumbing
- Global styles · Application-wide styling foundation
src/app/globals.css
External backend
Server-side data and persistence boundary outside this repo
- Careloom server · Separate backend repository providing data, appointments, and persistence
Other components
- Careloom · Main client application for browsing doctors, signing in, and managing appointments
Connections 31
- Careloom → App shell: uses · App-level shell wraps all routes
- App shell → Navbar: includes · Shared navigation is mounted in the shell
- App shell → Footer: includes · Shared footer is mounted in the shell
- App shell → Global styles: loads · Global styles apply across the app
- Home → Page sections: composes · Landing page assembles shared sections
- Home → Banner: shows · Hero section on the home page
- Home → Why careloom: shows · Trust and explanation section
- Home → Top rated: shows · Featured doctors section
- Appointments → Doctors view: renders · Main doctor browsing page delegates to client UI
- Specialty filter → Specialists view: renders · Specialty-filtered browsing delegates to client UI
- Doctor detail → Doctor card: uses · Doctor detail flow builds on reusable doctor representation
- Dashboard → Dashboard shell: renders · Dashboard route mounts the authenticated workspace
- Dashboard shell → Bookings UI: contains · Dashboard includes appointment management
- Sign in → Sign in UI: renders · Login route mounts the sign-in form
- Sign up → Sign up UI: renders · Registration route mounts the sign-up form
- Sign in UI → Google login: offers · Login UI supports Google authentication
- Sign up UI → Google login: offers · Registration UI supports Google authentication
- Auth API → Auth setup: uses · API route delegates to shared auth configuration
- Auth setup → Client auth: pairs with · Server and client auth layers share session behavior
- Access proxy → Auth setup: checks · Route protection depends on auth/session state
- Access proxy → Dashboard: protects · Dashboard access is gated by the proxy
- Access proxy → Doctor detail: protects · Booking-related routes are access-controlled
- Doctors view → Doctor card: reuses · Doctor list is rendered from cards
- Specialists view → Doctor card: reuses · Specialty views reuse the same doctor card
- Top rated → Doctor card: reuses · Featured doctors are shown with cards
- Dashboard shell → Avatar: shows · Dashboard likely displays the signed-in user identity
- Doctors view → Careloom server: fetches · Doctor catalog comes from the external server
- Specialists view → Careloom server: fetches · Specialty-filtered doctor data comes from the external server
- Doctor detail → Careloom server: fetches · Doctor detail and booking data are sourced externally
- Bookings UI → Careloom server: mutates · Booking management reads and updates appointment records
- Auth setup → Careloom server: depends on · Authentication relies on server-side user/session storage