A lightweight, modern sales management console built with React + Vite + Tailwind CSS for efficient lead management and opportunity conversion. This project demonstrates advanced React patterns, TypeScript implementation, and modern UI/UX practices.
π― Purpose: This project serves as a comprehensive technical demonstration showcasing modern frontend development practices, component architecture, and user experience design.
| Device | Performance Score | Report |
|---|---|---|
| π± Mobile | View Report | PageSpeed Insights Mobile Analysis |
| π» Desktop | View Report | PageSpeed Insights Desktop Analysis |
- π Lead Management: Comprehensive lead listing with advanced filtering and sorting capabilities
- π Smart Search: Real-time search by name or company with instant results
- π Lead Scoring: Visual score indicators with sorting by highest potential
- π Inline Editing: Quick status updates and email validation directly in the interface
- π Lead Conversion: One-click conversion from leads to opportunities
- π Opportunity Tracking: Dedicated opportunity management with stage tracking
- π° Inline Value Editing: Direct amount editing in opportunities table with currency formatting
- π Currency Internationalization: Automatic currency display based on selected language (BRL/USD)
- π Dark/Light Theme: Automatic theme switching with system preference detection
- π Internationalization: Multi-language support (English/Portuguese) with react-i18next
- π± Responsive Design: Seamless experience across desktop and mobile devices
- β‘ Real-time Updates: Instant UI updates with optimistic rendering
- π Loading States: Elegant loading animations and error handling
- πΎ Persistent Filters: LocalStorage integration for filter and sort preferences
- β‘ Lightning Fast: Vite-powered development with HMR (Hot Module Replacement)
- π― Type Safety: Full TypeScript implementation with strict type checking
- π¨ Modern UI: Radix UI components with Tailwind CSS styling
- π¦ Optimized Bundle: Tree-shaking and code splitting for minimal bundle size
- π§ Developer Experience: ESLint + Prettier configuration for code quality
- ποΈ Modular Architecture: Component-based architecture with dedicated folders
- π Shared Resources: Centralized types, utilities, and constants
- π Clean Code: English documentation and consistent code standards
- π Interactive Tutorial: Built-in guided tutorial system covering all features including lead conversion and value editing
- π Export Functionality: Excel and CSV export capabilities for data analysis
- π Advanced Filtering: Multi-criteria filtering with persistent preferences
- π± Mobile-First: Responsive design optimized for all device sizes
src/
βββ components/ # Organized component library
β βββ ui/ # Base UI components (Radix + Tailwind)
β βββ shared/ # Shared utilities and types
β β βββ types.ts # Common type definitions
β β βββ constants.ts # Shared constants
β β βββ utils.ts # Shared utility functions
β β βββ index.ts # Centralized exports
β βββ kpi-cards/ # KPI dashboard components
β β βββ kpi-cards.tsx # Main component
β β βββ types.ts # Component-specific types
β β βββ utils.ts # Component utilities
β β βββ index.ts # Component exports
β βββ leads-table/ # Lead management components
β β βββ leads-table.tsx # Main table component
β β βββ score-indicator.tsx # Score visualization
β β βββ types.ts # Lead table types
β β βββ utils.ts # Table utilities
β β βββ index.ts # Component exports
β βββ opportunities-table/ # Opportunity management
β β βββ opportunities-table.tsx # Main component
β β βββ opportunities-header.tsx # Table header
β β βββ empty-opportunities-state.tsx # Empty state
β β βββ editable-amount-cell.tsx # Inline value editing
β β βββ types.ts # Opportunity types
β β βββ utils.ts # Opportunity utilities
β β βββ index.ts # Component exports
β βββ lead-detail-sheet/ # Lead detail management
β β βββ lead-detail-sheet.tsx # Main sheet component
β β βββ lead-header.tsx # Sheet header
β β βββ lead-form.tsx # Form component
β β βββ sheet-actions.tsx # Action buttons
β β βββ types.ts # Sheet types
β β βββ utils.ts # Sheet utilities
β β βββ index.ts # Component exports
β βββ lead-import-dialog/ # Lead import functionality
β β βββ lead-import-dialog.tsx # Main dialog
β β βββ json-import-tab.tsx # JSON import tab
β β βββ manual-import-tab.tsx # Manual import tab
β β βββ types.ts # Import types
β β βββ utils.ts # Import utilities
β β βββ index.ts # Component exports
β βββ language-switcher/ # Internationalization
β βββ language-switcher.tsx # Language toggle
β βββ types.ts # Language types
β βββ utils.ts # Language utilities
β βββ index.ts # Component exports
βββ contexts/ # React contexts
β βββ leads-provider.tsx # Lead state management
β βββ theme-provider.tsx # Theme management
βββ lib/ # Utilities and configurations
β βββ utils.ts # Helper functions
β βββ i18n.ts # Internationalization setup
βββ types/ # Global TypeScript definitions
βββ App.tsx # Main application component
- Node.js 18+
- pnpm (recommended) or npm
# Clone the repository
git clone <repository-url>
cd mini-seller
# Install dependencies
pnpm install
# Start development server
pnpm devpnpm dev # Start development server (http://localhost:3000)
pnpm build # Build for production
pnpm preview # Preview production build
pnpm test # Run unit tests
pnpm test:watch # Run tests in watch mode
pnpm test:coverage # Run tests with coverage report
pnpm test:ui # Run tests with UI interface
pnpm lint # Run ESLint
pnpm lint:fix # Fix ESLint issues automatically
pnpm type-check # Run TypeScript compiler
pnpm format # Format code with Prettier- Start the development server:
pnpm dev - Open your browser: Navigate to
http://localhost:3000 - Take the tutorial: Click the "Start Tutorial" button to learn the interface
- Import sample data: Use the import functionality to add leads
- Explore features: Try filtering, searching, and converting leads to opportunities
The project includes focused unit tests for core functionality:
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test --watchTest Coverage:
- β
Utility functions (
src/components/shared/utils.test.ts) - 32 tests - β
Score indicator component (
src/components/leads-table/score-indicator.test.tsx) - 8 tests - Total: 40 unit tests
The test suite focuses on:
- Core utility functions (validation, formatting, filtering)
- Component rendering and behavior
- Business logic validation
- Simple, maintainable test cases
# Check for linting issues
npm run lint:check
# Fix linting issues automatically
npm run lint:fix
# Format code with Prettier
npm run format
# Check TypeScript types
npm run type-check
## π Data Structure
### Lead Object
```typescript
interface Lead {
id: string
name: string
company: string
email: string
source: string
score: number
status: 'new' | 'contacted' | 'qualified' | 'lost'
}interface Opportunity {
id: string;
name: string;
stage: string;
amount?: number;
accountName: string;
createdAt: string;
}- Dynamic Filtering: Filter by status with real-time updates
- Advanced Search: Search across name and company fields
- Smart Sorting: Sort by score (descending) for priority management
- Bulk Operations: Handle 100+ leads efficiently
- Lead Import: JSON and manual lead import functionality
- Score Visualization: Color-coded score indicators with progress bars
- Data Export: Export filtered leads to Excel (.xlsx) or CSV formats
- Always-Visible Import: Import button available in leads table for easy access
- Comprehensive Coverage: Step-by-step tutorial covering all features
- Lead Conversion Guide: Tutorial step for converting leads to opportunities
- Value Editing Tutorial: Guided tour of inline amount editing functionality
- Conditional Steps: Tutorial adapts based on available UI elements
- Visual Highlights: Spotlight effect on tutorial targets
- Progress Tracking: Clear indication of tutorial progress
- Skip Functionality: Users can skip or restart the tutorial anytime
- Multi-language Support: Tutorial content available in Portuguese and English
- Slide-over Design: Non-intrusive detail view
- Inline Editing: Direct status and email editing
- Email Validation: Real-time email format validation
- Save/Cancel Actions: Proper state management with error handling
- Form Validation: Comprehensive form validation with error messages
- One-click Conversion: Seamless lead-to-opportunity workflow from lead detail panel
- Automatic Data Mapping: Smart field mapping during conversion
- Stage Management: Opportunity pipeline tracking
- Inline Amount Editing: Click-to-edit functionality for opportunity values
- Currency Formatting: Automatic currency formatting based on language (R$ for Portuguese, $ for English)
- Input Validation: Real-time validation for numeric values with proper formatting
- Persistent Data: Automatic saving to localStorage with optimistic updates
- Empty State Handling: Elegant empty states with import suggestions
- Click-to-Edit Interface: Intuitive double-click activation for amount editing
- Real-time Validation: Instant feedback for invalid input with visual indicators
- Keyboard Navigation: Enter to save, Escape to cancel editing
- Currency Input Handling: Smart parsing of currency symbols and decimal separators
- Optimistic Updates: Immediate UI feedback with background persistence
- Error Recovery: Automatic rollback on save failures with user notification
- Dynamic Currency Display: Automatic currency formatting based on selected language
- Regional Number Formatting: Proper decimal and thousand separators per locale
- Language-Aware Validation: Input validation adapts to regional number formats
- Tutorial Localization: Complete tutorial experience in multiple languages
- Conditional UI Elements: Smart display of import buttons based on data state
- LocalStorage Persistence: Automatic data persistence across sessions
- JSON Fallback: Initial data loading from JSON files
- State Management: Centralized state with React Context
- Real-time Updates: Instant UI updates with optimistic rendering
- Currency Localization: Dynamic currency formatting using Intl.NumberFormat
- Input Sanitization: Proper validation and formatting for monetary values
- Color Palette: Carefully crafted color system with CSS custom properties
- Typography: Responsive typography scale with proper hierarchy
- Spacing: Consistent spacing system using Tailwind's spacing scale
- Components: Reusable component library built on Radix UI primitives
- Animations: Smooth transitions and micro-interactions
Supported languages:
- πΊπΈ English (default)
- π§π· Portuguese
Easily extensible for additional languages through the public/locales/ directory.
| Technology | Version | Purpose |
|---|---|---|
| React | 18 | UI Framework |
| Vite | 5.2.0 | Build Tool |
| TypeScript | 5.2.2 | Type Safety |
| Tailwind CSS | 3.4.17 | Styling |
| Radix UI | Latest | UI Primitives |
| React i18next | Latest | Internationalization |
| Lucide React | 0.454.0 | Icons |
| XLSX | 0.18.5 | Excel Export Functionality |
| File-Saver | 2.0.5 | File Download Management |
| React Joyride | 2.9.3 | Interactive Tutorial System |
| Sonner | 2.0.7 | Toast Notifications |
| Technology | Version | Purpose |
|---|---|---|
| Vitest | 3.2.4 | Testing Framework |
| Testing Library | 16.3.0 | React Testing Utilities |
| Jest DOM | 6.7.0 | DOM Testing Matchers |
| ESLint | 8.57.0 | Code Linting |
| Prettier | 3.6.2 | Code Formatting |
| MSW | 2.10.5 | API Mocking |
| JSDOM | 26.1.0 | DOM Environment for Tests |
- ESLint: Configured for React, TypeScript, and React Hooks
- Prettier: Automatic code formatting with consistent style
- VSCode Integration: Auto-format on save and lint fixes
- Batch Scripts: Windows-compatible scripts for easy linting
The project includes VSCode configuration files:
.vscode/settings.json: Editor settings for consistent formatting.vscode/extensions.json: Recommended extensions for optimal development
- React Hooks validation
- Unused variables detection
- Console statement warnings
- Consistent code style enforcement
- TypeScript best practices
- Bundle Size: Optimized for minimal bundle size
- Loading Time: Fast initial load with code splitting
- Runtime Performance: Efficient rendering with React 18 features
- Memory Usage: Optimized for handling large datasets
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under a Custom Technical Assessment License - see the LICENSE.md file for details.
- Built with modern React patterns and best practices
- Inspired by contemporary sales management tools
- Designed for developer experience and user satisfaction
Made with β€οΈ for efficient sales management