API Reference Overview
Welcome to the MotorDesk API reference documentation. This section provides comprehensive documentation for all components and hooks used throughout the MotorDesk fleet management system.What is MotorDesk?
MotorDesk is a modern vehicle fleet management SaaS platform with electronic billing capabilities. Built with React, TypeScript, and Redux, it provides a complete solution for managing vehicles, customers, sales, and service history.Architecture
The MotorDesk application follows a modular architecture:- UI Components: Reusable interface elements (buttons, inputs, modals)
- Business Components: Domain-specific components for vehicles, customers, and sales
- Custom Hooks: React hooks for state management and business logic
- Redux Store: Centralized state management for auth, sales, and application data
Component Library
MotorDesk includes a collection of UI components built on top of standard HTML elements with enhanced styling and TypeScript support:Button Component
Interactive button with variants, sizes, and loading states
Input Components
Form inputs including text fields and select dropdowns
Modal Components
Dialog overlays for forms, details, and confirmations
Custom Hooks
The application uses custom React hooks to encapsulate business logic and state management:useAuth
Authentication and user session management
useSales
Sales document creation and cart management
useVehicles
Vehicle fleet management and service history
useCustomers
Customer directory and API validation
TypeScript Support
All components and hooks are fully typed with TypeScript, providing:- Type-safe props and parameters
- IntelliSense support in modern IDEs
- Compile-time error checking
- Self-documenting code
Styling Approach
Components use Tailwind CSS for styling with:- Utility-first CSS classes
- Responsive design patterns
- Custom CSS modules for complex layouts
- Consistent design tokens
Getting Started
Explore the documentation by selecting a component or hook from the navigation menu. Each page includes:- Complete API signatures
- Prop/parameter descriptions with types
- Usage examples
- Return value documentation
All code examples use TypeScript and assume you have the necessary dependencies installed.
