How towhidur-rahmaan/car-doctor-client works
1. Application type and deployment
- This is a React single-page application built with Vite and styled with Tailwind CSS.
- It is deployed on Firebase Hosting (firebase.json, .firebase, .firebaserc), with the live app linked in the README.
2. Top-level product shape
- The app is a car service/customer portal with two major user experiences:
- a public marketing + booking flow
- a protected authenticated area for bookings, profiles, reviews, and admin management
- The UI and navigation are organized to support both customer-facing pages and an admin dashboard.
3. Core shell and routing
- src/main.jsx boots the app, and src/Routes.jsx is the main route map.
- src/Layout/Main.jsx and src/Layout/DashboardLayout.jsx define the two main shells:
- the public site layout
- the dashboard layout
- src/ErrorPage.jsx provides the fallback boundary for invalid routes.
4. Authentication and access control
- src/provider/AuthProvider.jsx centralizes authentication state and likely exposes the user/session context to the app.
- src/Routes.jsx/PrivateRoute.jsx protects logged-in-only pages.
- src/Routes.jsx/AdminRoute.jsx adds an admin-only boundary for dashboard management screens.
- src/hooks/useAdmin.jsx is a role check hook used to distinguish admin users from regular users.
5. Firebase integration boundary
- src/firebase/firebase.config.js holds Firebase client configuration.
- The repo structure strongly suggests Firebase is the main backend dependency for auth and likely data persistence.
- The presence of Firebase Hosting config also means the SPA is served as static assets from Firebase rather than a custom server.
6. Public site content
- The public experience is split into reusable feature sections under src/pages/Home/...:
- banner/hero
- why choose us
- services
- customer reviews
- team
- contact/products area
- src/pages/AboutUs/AboutUs.jsx provides a standalone informational page.
- src/pages/ServiceDetails/ServiceDetails.jsx represents a detail view for an individual service.
7. Booking and customer workflows
- src/pages/BookService/BookService.jsx is the primary booking entry point.
- src/pages/Bookings/Bookings.jsx and src/pages/Bookings/BookingRow.jsx represent the customer’s booking list and row-level actions.
- src/pages/AddReview/AddReview.jsx is a customer action page for submitting feedback.
- src/pages/Profile/Profile.jsx is the authenticated user account area.
8. Admin dashboard workflows
- src/pages/Dashboard/AdminHome.jsx is the dashboard landing page for admins.
- src/pages/Dashboard/AddService.jsx, ManageServices.jsx, ManageBookings.jsx, and ManageReviews.jsx are the main operational screens.
- These pages form the admin control plane for maintaining services, handling bookings, and moderating reviews.
9. Shared UI and cross-cutting components
- src/pages/Shared/NavBar/NavBar.jsx and src/pages/Shared/Footer/Footer.jsx provide global site chrome.
- Root-level UI helpers such as FloatingCTA.jsx, GlobalEffects.jsx, IntroLoader.jsx, and SectionReveal.jsx suggest reusable animation/UX wrappers used across multiple pages.
- These components are cross-cutting presentation layers, not business logic.
10. Static content and asset flow
- public/products.json and public/services.json are static data sources consumed by the frontend at runtime.
- The src/assets/ tree contains images/icons for banners, products, services, login screens, customer sections, and team pages.
- This indicates a mostly client-driven content model, where some visible content is loaded from static JSON and bundled assets rather than from a separate CMS.
11. Route and feature boundaries
- The repository is organized by feature/page rather than by low-level components.
- Public marketing pages, authenticated user pages, and admin pages are separated into different folders, which maps cleanly to distinct diagram layers:
- anonymous/public
- authenticated customer
- authenticated admin
12. Build and runtime tooling
- vite.config.js, tailwind.config.js, postcss.config.js, and eslint.config.js define the frontend build, styling, and linting toolchain.
- There is no evidence of a custom backend service in this repo; the architecture appears to be a frontend SPA + Firebase-backed identity/deployment setup with static content and client-side routing.
Main entry points: AdminRoute.jsx Admin gate · PrivateRoute.jsx Private gate · Home.jsx Home page · Routes.jsx Route map
Components 34
Core shell
App bootstrap, routing, layouts, auth, and cross-cutting UI
- Entry point · Mounts the React app and starts routing
src/main.jsx - Route map · Defines public, private, and admin routes
src/Routes.jsx - Private gate · Blocks unauthenticated access to protected pages
src/Routes.jsx/PrivateRoute.jsx - Admin gate · Restricts dashboard management to admin users
src/Routes.jsx/AdminRoute.jsx - Auth provider · Holds global login state and user session data
src/provider/AuthProvider.jsx - Admin check · Determines whether the current user is an admin
src/hooks/useAdmin.jsx - Main shell · Shared layout for the public site
src/Layout/Main.jsx - Dashboard shell · Shared layout for protected dashboard pages
src/Layout/DashboardLayout.jsx - Error page · Displays invalid-route or app-level error state
src/ErrorPage.jsx - Nav bar · Global top navigation
src/pages/Shared/NavBar/NavBar.jsx - Footer · Global footer for public pages
src/pages/Shared/Footer/Footer.jsx - UI effects · Reusable animation and CTA helpers
FloatingCTA.jsx
Public site
Anonymous marketing and service discovery experience
- Home page · Landing page composed from reusable marketing sections
src/pages/Home/Home/Home.jsx - Banner · Hero entry section
src/pages/Home/Banner/Banner.jsx - Services · Shows service offerings and cards
src/pages/Home/Services/Services.jsx - Contact · Contact and product showcase area
src/pages/Home/Home/Contact/Contact.jsx - Reviews · Customer testimonials section
src/pages/Home/Home/CustomerReview/CustomerReview.jsx - Team · Team introduction section
src/pages/Home/Home/Team/Team.jsx - Why us · Value proposition section
src/pages/Home/Home/WhyChooseUs/WhyChooseUs.jsx - About us · Standalone informational page
src/pages/AboutUs/AboutUs.jsx - Service details · Shows an individual service
src/pages/ServiceDetails/ServiceDetails.jsx
Customer area
Authenticated customer workflows
- Book service · Primary booking entry point
src/pages/BookService/BookService.jsx - Bookings · Customer booking list and actions
src/pages/Bookings/Bookings.jsx - Booking row · Row-level booking actions
src/pages/Bookings/BookingRow.jsx - Add review · Authenticated feedback submission page
src/pages/AddReview/AddReview.jsx - Profile · Authenticated user account area
src/pages/Profile/Profile.jsx - Login · User sign-in screen
src/pages/Login/Login.jsx - Signup · User registration screen
src/pages/Signup/Signup.jsx
Admin area
Protected dashboard management screens
- Admin home · Dashboard landing page for admins
src/pages/Dashboard/AdminHome.jsx - Add service · Creates new services
src/pages/Dashboard/AddService.jsx - Manage services · Edits and maintains services
src/pages/Dashboard/ManageServices.jsx - Manage bookings · Handles booking operations
src/pages/Dashboard/ManageBookings.jsx - Manage reviews · Moderates customer reviews
src/pages/Dashboard/ManageReviews.jsx
Data and assets
Firebase client setup and runtime content sources
- Firebase config · Client-side Firebase setup for auth and persistence
src/firebase/firebase.config.js
Connections 32
- Entry point → Route map: boots · Entry point renders the route map
- Route map → Main shell: public shell · Public pages are wrapped in the main layout
- Route map → Dashboard shell: dashboard shell · Protected admin pages use the dashboard layout
- Route map → Private gate: guards · Private routes protect authenticated customer pages
- Route map → Admin gate: guards · Admin routes enforce role-based access
- Route map → Error page: fallback · Unhandled routes go to the error page
- Auth provider → Private gate: session · Authentication state powers protected access
- Auth provider → Admin gate: session · Role checks depend on the current user session
- Auth provider → Admin check: context · Admin hook reads from auth state
- Firebase config → Auth provider: auth backend · Firebase provides the client auth boundary
- Main shell → Nav bar: includes · Public shell contains site navigation
- Main shell → Footer: includes · Public shell contains site footer
- Main shell → UI effects: reuses · Public experience uses shared UI effects
- Home page → Banner: composes · Home page assembles hero section
- Home page → Services: composes · Home page assembles services section
- Home page → Contact: composes · Home page assembles contact/products section
- Home page → Reviews: composes · Home page assembles testimonials section
- Home page → Team: composes · Home page assembles team section
- Home page → Why us: composes · Home page assembles value proposition section
- Services → Service details: leads to · Service browsing connects into detail views
- Service details → Book service: routes to · Detail view leads into booking
- Private gate → Book service: protects · Booking requires a signed-in user
- Private gate → Bookings: protects · Booking history is authenticated
- Private gate → Add review: protects · Review submission is authenticated
- Private gate → Profile: protects · Profile access requires login
- Private gate → Admin gate: feeds · Admin-only pages are also protected by login
- Bookings → Booking row: renders · Bookings list is built from row items
- Admin gate → Admin home: protects · Admin landing page is role-gated
- Admin gate → Add service: protects · Add-service screen is admin only
- Admin gate → Manage services: protects · Service management is admin only
- Admin gate → Manage bookings: protects · Booking operations are admin only
- Admin gate → Manage reviews: protects · Review moderation is admin only