How shantopaul/saas-dashboard-website works
1. Overall shape
- This is a client-side SaaS dashboard frontend, not a full backend app.
- The app is built as a single-page React 19 + TypeScript project, bundled with Vite and styled with Tailwind CSS.
- Most “business data” is currently mock/static data in src/data, with architecture prepared for future backend/Firebase integration.
2. App entry and composition
- src/main.tsx bootstraps the app.
- src/App.tsx is the top-level composition point that wires providers, routing, and global UI behavior.
- The root runtime is a stack of context/providers plus route-driven page rendering.
3. Routing and page boundaries
- src/routes/AppRoutes.tsx defines the main navigation map.
- src/routes/ProtectedRoute.tsx is the auth boundary that separates public/auth pages from dashboard-only pages.
- Pages are split into three domains:
- src/pages/public for marketing surfaces
- src/pages/auth for login/register flows
- src/pages/dashboard for authenticated product areas
4. Layout system
- Layouts in src/components/layout are the primary structural boundary of the UI.
- PublicLayout wraps marketing pages with navigation/footer.
- AuthLayout isolates login/register screens.
- DashboardLayout provides the app shell for authenticated pages, with persistent navigation, header, and content viewport.
- This means pages are mostly content assemblies; the layout decides the page frame.
5. Shared UI component layer
- src/components/common contains reusable presentational primitives: buttons, inputs, cards, modals, dropdowns, toggles, spinners, and motion wrappers.
- These components are used across forms, dashboards, and tables, keeping styling and behavior consistent.
- Modal, Dropdown, ThemeToggle, and PageMotion are especially important because they influence interaction patterns and accessibility.
6. Dashboard-specific UI
- src/components/dashboard holds higher-level widgets for operational views: stat cards, activity feeds, customer tables, and chart wrappers.
- src/components/dashboard/charts contains the analytics visualization layer, likely powered by Recharts-style chart components with theme-aware rendering.
- This layer is distinct from common primitives: it assembles business-facing dashboard blocks rather than generic UI controls.
7. Tabular/billing data presentation
- src/components/tables is a dedicated subsystem for data-heavy views such as activity logs, customers, invoices, and transactions.
- DataTable acts as the generic table engine, while the other table components specialize it for each domain.
- Utility files like tableFormat.ts and tableUtils.tsx centralize formatting and column rendering rules, which helps keep billing and ledger screens consistent.
8. State management
- Global client state lives in Zustand stores under src/store.
- The store boundaries are purposeful:
- authStore for session/auth simulation
- themeStore for dark/light mode persistence
- layoutStore for sidebar/window UI state
- notificationStore for unread counts and filters
- toastStore for transient feedback
- This indicates the app relies on local reactive state rather than server synchronization for most interactions.
9. Providers and cross-cutting concerns
- ThemeProvider and ToastProvider in src/providers wrap the app with cross-cutting UI infrastructure.
- Theme is a global concern affecting styling tokens and component behavior.
- Toasts provide non-blocking user feedback across routes, likely connected to store-driven events.
10. Data flow and content model
- The app is largely fed by static datasets in src/data rather than API calls.
- These datasets cover navigation, search, notifications, pricing, testimonials, charts, invoices, customers, and user profiles.
- src/types mirrors those datasets with explicit interfaces, creating a typed contract between mock data, components, and pages.
11. Auth and form handling
- Login/register pages use React Hook Form and Zod, which makes validation schema-driven and keeps rendering efficient.
- authStore plus ProtectedRoute simulate session control on the client side.
- The auth boundary is important architecturally even if the current backend is mocked or minimal.
12. Search and command surface
- The repo includes a dedicated searchable command layer via DashboardSearch and src/data/searchData.ts.
- This powers omni-search/keyboard-driven navigation across dashboard sections and records.
- Search is therefore a first-class navigation system, not just a UI filter.
13. Styling, motion, and accessibility
- Tailwind CSS and src/styles/globals.css define the visual system.
- Framer Motion is used for page and component transitions.
- The README and component set indicate accessibility is a design constraint: semantic layout regions, focus trapping in modals, keyboard support, and reduced-motion awareness.
14. Configuration and deployment boundary
- src/config/firebase.ts suggests a prepared integration point for Firebase credentials from .env files, though the current app reads as frontend-first and simulated.
- vercel.json and the Vite build setup indicate deployment as a static frontend on Vercel.
- The external-runtime boundary is therefore mostly build-time and hosting-oriented, not server-centric.
15. How to draw the architecture
- Model this as: browser entrypoint → app providers/router → layout shell → page module → shared widgets → static data/store.
- Keep public, auth, and protected dashboard areas as separate route zones.
- Put Zustand stores and providers as cross-cutting layers spanning all zones.
- Treat src/data and src/types as the current content/data backbone until backend services are introduced.
Main entry points: DashboardLayout.tsx Dashboard Shell · App.tsx App · AppRoutes.tsx Routes · PublicLayout.tsx Public Layout
Components 30
Entry & Shell
Browser bootstrap, app composition, providers, and routing.
- Main · Vite entrypoint that mounts the React app.
src/main.tsx - App · Top-level composition for providers and routing.
src/App.tsx - Routes · Main route map for public, auth, and protected areas.
src/routes/AppRoutes.tsx - Auth Gate · Client-side boundary for protected dashboard pages.
src/routes/ProtectedRoute.tsx - Theme · Global theme provider for color mode and styling context.
src/providers/ThemeProvider.tsx - Toasts · Global toast provider for transient user feedback.
src/providers/ToastProvider.tsx
Public & Auth
Marketing and authentication surfaces.
- Public Layout · Shell for marketing pages with navigation and footer.
src/components/layout/PublicLayout.tsx - Auth Layout · Dedicated frame for login and register flows.
src/components/layout/AuthLayout.tsx - Landing · Public homepage and marketing entry surface.
src/pages/public/LandingPage.tsx - Features · Public feature-focused marketing page.
src/pages/public/FeaturesPage.tsx - Pricing · Public pricing and plan comparison page.
src/pages/public/PricingPage.tsx - Login · Authentication page for sign-in.
src/pages/auth/LoginPage.tsx - Register · Authentication page for account creation.
src/pages/auth/RegisterPage.tsx
Dashboard
Authenticated product area and its shell.
- Dashboard Shell · Authenticated app frame with sidebar, header, and viewport.
src/components/layout/DashboardLayout.tsx - Header · Top bar with search, notifications, and theme controls.
src/components/layout/DashboardHeader.tsx - Sidebar · Persistent dashboard navigation panel.
src/components/layout/Sidebar.tsx - Search · Dashboard command/search surface.
src/components/layout/DashboardSearch.tsx - Notifications · Notification dropdown surface used in the dashboard header.
src/components/layout/NotificationDropdown.tsx - Dashboard Home · Authenticated overview page.
src/pages/dashboard/DashboardPage.tsx - Analytics · Authenticated analytics page.
src/pages/dashboard/AnalyticsPage.tsx - Billing · Authenticated billing and transactions page.
src/pages/dashboard/BillingPage.tsx - Profile · Authenticated user profile page.
src/pages/dashboard/ProfilePage.tsx - Settings · Authenticated application settings page.
src/pages/dashboard/SettingsPage.tsx
UI System
Reusable components and higher-level dashboard widgets.
- Common UI · Reusable controls and presentational building blocks.
src/components/common/index.ts - Dashboard Widgets · Dashboard-specific cards, feeds, tables, and chart wrappers.
src/components/dashboard/index.ts - Tables · Reusable data table engine and domain tables.
src/components/tables/index.ts
State & Data
Client stores, static datasets, and typed content models.
- Stores · Client-side Zustand stores for auth, theme, layout, notifications, and toasts.
src/store/index.ts - Mock Data · Static datasets for navigation, charts, users, invoices, notifications, and content.
src/data/index.ts - Types · Shared TypeScript interfaces for app content and records.
src/types/index.ts - Firebase Config · Prepared external configuration boundary for future Firebase use.
src/config/firebase.ts
Connections 35
- Main → App: boots · Main mounts the app root.
- App → Theme: wraps · App composes the theme provider.
- App → Toasts: wraps · App composes the toast provider.
- App → Routes: renders · App delegates page selection to routing.
- Routes → Public Layout: public · Public routes use the marketing shell.
- Routes → Auth Layout: auth · Authentication routes use the auth shell.
- Routes → Auth Gate: guards · Protected routes pass through the auth boundary.
- Auth Gate → Dashboard Shell: allows · Successful auth enters the dashboard shell.
- Public Layout → Landing: hosts · Public shell renders landing content.
- Public Layout → Features: hosts · Public shell renders feature content.
- Public Layout → Pricing: hosts · Public shell renders pricing content.
- Auth Layout → Login: hosts · Auth shell renders sign-in.
- Auth Layout → Register: hosts · Auth shell renders sign-up.
- Dashboard Shell → Header: contains · Dashboard shell includes the header.
- Dashboard Shell → Sidebar: contains · Dashboard shell includes persistent navigation.
- Header → Search: exposes · Header contains command/search entry.
- Header → Notifications: exposes · Header contains notification access.
- Header → Common UI: uses · Header relies on shared UI primitives.
- Dashboard Shell → Dashboard Home: hosts · Shell renders the dashboard overview page.
- Dashboard Shell → Analytics: hosts · Shell renders analytics pages.
- Dashboard Shell → Billing: hosts · Shell renders billing pages.
- Dashboard Shell → Profile: hosts · Shell renders profile pages.
- Dashboard Shell → Settings: hosts · Shell renders settings pages.
- Dashboard Home → Dashboard Widgets: assembles · Overview page is built from dashboard widgets.
- Analytics → Dashboard Widgets: assembles · Analytics page uses chart and summary widgets.
- Billing → Tables: uses · Billing page relies on data table components.
- Profile → Common UI: uses · Profile page uses shared UI controls.
- Settings → Common UI: uses · Settings page uses shared UI controls.
- Common UI → Stores: reads · Shared UI reacts to global client state.
- Dashboard Widgets → Mock Data: reads · Dashboard widgets are fed by static datasets.
- Tables → Mock Data: reads · Tables are populated from mock records.
- Mock Data → Types: typed by · Static data follows shared TypeScript contracts.
- Stores → Types: typed by · Store state uses shared interfaces.
- Search → Mock Data: indexes · Search uses predefined searchable content.
- Firebase Config → App: prepared for · Firebase config marks future backend integration.