Skip to content

πŸš€ A lightweight sales management console built with React, Vite, and TypeScript for efficient lead management and opportunity conversion.

License

Notifications You must be signed in to change notification settings

ChristopherMarques/mini-seller

Repository files navigation

πŸš€ Mini Seller Console

image

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.

πŸ“Š Performance Metrics

Device Performance Score Report
πŸ“± Mobile View Report PageSpeed Insights Mobile Analysis
πŸ’» Desktop View Report PageSpeed Insights Desktop Analysis

Mini Seller Console Vite Tailwind CSS TypeScript

✨ Features

🎯 Core Functionality

  • πŸ“‹ 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)

🎨 User Experience

  • πŸŒ“ 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

πŸ› οΈ Technical Highlights

  • ⚑ 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

πŸ—οΈ Architecture

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

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm

Installation

# Clone the repository
git clone <repository-url>
cd mini-seller

# Install dependencies
pnpm install

# Start development server
pnpm dev

Available Scripts

pnpm 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

First Time Setup

  1. Start the development server: pnpm dev
  2. Open your browser: Navigate to http://localhost:3000
  3. Take the tutorial: Click the "Start Tutorial" button to learn the interface
  4. Import sample data: Use the import functionality to add leads
  5. Explore features: Try filtering, searching, and converting leads to opportunities

Testing

The project includes focused unit tests for core functionality:

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test --watch

Test 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

Code Quality & Formatting

# 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'
}

Opportunity Object

interface Opportunity {
  id: string;
  name: string;
  stage: string;
  amount?: number;
  accountName: string;
  createdAt: string;
}

🎯 Key Features Breakdown

Lead Management

  • 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

Interactive Tutorial System

  • 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

Lead Detail Panel

  • 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

Opportunity Management

  • 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

Inline Editing Features

  • 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

Internationalization & Localization

  • 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

Data Management

  • 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

🎨 Design System

  • 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

🌍 Internationalization

Supported languages:

  • πŸ‡ΊπŸ‡Έ English (default)
  • πŸ‡§πŸ‡· Portuguese

Easily extensible for additional languages through the public/locales/ directory.

πŸ”§ Technical Stack

Core Technologies

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

Development Tools

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

βš™οΈ Development Configuration

Code Quality Tools

  • 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

VSCode Setup

The project includes VSCode configuration files:

  • .vscode/settings.json: Editor settings for consistent formatting
  • .vscode/extensions.json: Recommended extensions for optimal development

Linting Rules

  • React Hooks validation
  • Unused variables detection
  • Console statement warnings
  • Consistent code style enforcement
  • TypeScript best practices

πŸ“ˆ Performance

  • 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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under a Custom Technical Assessment License - see the LICENSE.md file for details.

⚠️ Important: This project is intended exclusively for technical assessment purposes in job application processes. Commercial use, redistribution, or any other use is strictly prohibited.

πŸ™ Acknowledgments

  • 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

About

πŸš€ A lightweight sales management console built with React, Vite, and TypeScript for efficient lead management and opportunity conversion.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages