How jinendra/crm-dashboard-react works
Purpose and Runtime
CRM Pro Dashboard is a client-side CRM/sales dashboard. It presents sales metrics, charts, customer views, and placeholder navigation sections using React 18, TypeScript, Tailwind CSS, Recharts, and Lucide icons. No backend, authentication, persistence, or external API integration is present; the application operates from bundled mock data.
Entry/bootstrap paths:
• src/index.tsx
• src/App.tsx
• index.html
Application Shell and Navigation
App.tsx is the primary composition and view-selection boundary. It owns the active section state and renders the application shell rather than using a routing library. Sidebar.tsx supplies collapsible navigation and communicates section selection upward; App.tsx conditionally selects dashboard, customer management, settings, or other section content.
Paths:
• src/App.tsx
• src/components/Sidebar.tsx
• src/components/Settings.tsx
Dashboard Analytics Stage
The dashboard is the main reporting surface. It transforms supplied CRM aggregates into KPI cards, revenue trends, pipeline distribution, recent activity, and team-performance UI. Recharts is the visualization boundary: React components configure/render charts, while mock data supplies the series and categories.
Paths:
• src/components/Dashboard.tsx
• src/components/MetricCard.tsx
• src/data/mockData.ts
Customer Management Workflow
Customer management is a local CRUD-style interface composed from list, detail, add, edit, and delete-confirmation views. Its state/control flow is expected to remain inside the React component hierarchy: selection from the list drives detail/edit views, while add/edit/delete actions update in-memory customer state. There is no indicated repository layer or remote persistence boundary.
Paths:
• src/components/CustomerManagement.tsx
• src/components/CustomerList.tsx
• src/components/AddCustomer.tsx
Customer Detail and Mutation Boundaries
Customer inspection and mutation are deliberately separated into focused presentation/dialog components. CustomerDetails.tsx displays the selected entity; EditCustomer.tsx collects changes; DeleteConfirmation.tsx gates destructive operations. The parent management component should remain the authority for customer collection state and callback orchestration.
Paths:
• src/components/CustomerDetails.tsx
• src/components/EditCustomer.tsx
• src/components/DeleteConfirmation.tsx
Data Contract Boundary
CRM domain shapes are centralized in TypeScript definitions and instantiated by static sample data. Components should consume these contracts rather than introduce ad hoc entity shapes. Replacing mockData.ts with API adapters is the main future integration seam, while src/types/index.ts should remain the shared UI/domain contract.
Paths:
• src/types/index.ts
• src/data/mockData.ts
Styling, Build, and Delivery
Global CSS and Tailwind establish the visual system, including responsive and dashboard-specific styling. The repository is Vite-based, despite README references to Create React App; vite.config.ts and the presence of src/index.tsx define the material build/runtime setup. Node/npm provides local development and production bundling.
Paths:
• src/index.css
• tailwind.config.js
• vite.config.ts
Main entry points: CustomerManagement.tsx Customer state controller · App.tsx App view controller · Dashboard.tsx Dashboard reporting · index.ts CRM contracts
Components 19
Client Runtime
- HTML host
index.html - React bootstrap
src/index.tsx
Application Shell
- App view controller · Owns active-section state and conditional view selection.
src/App.tsx - Sidebar navigation · Reports selected sections to App.
src/components/Sidebar.tsx - Settings view
src/components/Settings.tsx
Dashboard Analytics
- Dashboard reporting · Composes KPI, activity, pipeline, trend, and team reporting.
src/components/Dashboard.tsx - KPI cards
src/components/MetricCard.tsx - Recharts · Visualization rendering boundary.
Customer Management
- Customer state controller · Owns in-memory customer collection and mutation callbacks.
src/components/CustomerManagement.tsx - Customer list · Selection drives detail and edit flows.
src/components/CustomerList.tsx - Add customer
src/components/AddCustomer.tsx - Customer details
src/components/CustomerDetails.tsx - Edit customer
src/components/EditCustomer.tsx - Delete confirmation · Gates destructive customer actions.
src/components/DeleteConfirmation.tsx
Data Contract
- CRM contracts · Shared UI and domain entity shapes.
src/types/index.ts - Bundled mock data · Primary future API-adapter seam.
src/data/mockData.ts
Build & Styling
- Global visual system
src/index.css - Tailwind configuration
tailwind.config.js - Vite build runtime · Drives local development and production bundling.
vite.config.ts
Connections 23
- HTML host → React bootstrap: hosts
- React bootstrap → App view controller: mounts
- React bootstrap → Global visual system: loads
- Vite build runtime → HTML host: serves/bundles
- Tailwind configuration → Global visual system: generates utilities for
- App view controller → Sidebar navigation: renders
- Sidebar navigation → App view controller: section selection
- App view controller → Dashboard reporting: selects dashboard
- App view controller → Customer state controller: selects customers
- App view controller → Settings view: selects settings
- Dashboard reporting → KPI cards: composes
- Dashboard reporting → Recharts: configures charts
- Bundled mock data → Dashboard reporting: supplies aggregates
- CRM contracts → Bundled mock data: defines data shapes
- CRM contracts → Dashboard reporting: contracts
- Bundled mock data → Customer state controller: seeds customers
- CRM contracts → Customer state controller: contracts
- Customer state controller → Customer list: provides collection
- Customer list → Customer state controller: selects customer
- Customer state controller → Add customer: orchestrates create
- Customer state controller → Customer details: shows selected
- Customer state controller → Edit customer: orchestrates update
- Customer state controller → Delete confirmation: orchestrates delete