> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Braian551/viax/llms.txt
> Use this file to discover all available pages before exploring further.

# Platform Features

> Comprehensive overview of all features available in the Viax mobility platform

# Platform Features

Viax provides a complete suite of features for users, drivers, administrators, and companies to manage on-demand transportation and delivery services.

## User Features

### Authentication & Profile Management

<CardGroup cols={2}>
  <Card title="Secure Registration" icon="user-plus">
    * Email-based registration
    * Phone number verification
    * 6-digit verification codes
    * Password requirements enforcement
  </Card>

  <Card title="Login & Sessions" icon="right-to-bracket">
    * Secure email/password login
    * Session management
    * Remember me functionality
    * Password reset via email
  </Card>

  <Card title="Profile Management" icon="id-card">
    * Update personal information
    * Change profile photo
    * Manage contact details
    * Optional address information
  </Card>

  <Card title="Email Verification" icon="envelope-circle-check">
    * Automated email sending
    * 6-digit verification codes
    * Code expiration (10 minutes)
    * Resend verification option
  </Card>
</CardGroup>

### Trip Booking & Management

<Tabs>
  <Tab title="Request Trips">
    **Interactive Trip Booking**

    * Tap on map to select pickup location
    * Choose destination with real-time geocoding
    * View route preview on map
    * Distance and duration estimates
    * Real-time fare calculation

    **Service Types:**

    * 🚗 Ride (Personal transportation)
    * 📦 Package Delivery (Courier service)
  </Tab>

  <Tab title="Vehicle Selection">
    Choose from multiple vehicle categories:

    | Vehicle Type         | Capacity    | Use Case                    |
    | -------------------- | ----------- | --------------------------- |
    | 🏍️ Motorcycle       | 1-2         | Quick rides, small packages |
    | 🚗 Car               | 1-4         | Standard rides              |
    | 🏍️ Cargo Motorcycle | Packages    | Medium deliveries           |
    | 🚙 Cargo Car         | Large items | Big deliveries              |

    Pricing adjusts automatically based on vehicle type.
  </Tab>

  <Tab title="Trip Tracking">
    **Real-time Monitoring:**

    * Driver search status
    * Driver location tracking
    * Estimated arrival time
    * Route visualization
    * Trip status updates

    **Trip States:**

    * `pendiente` - Waiting for driver
    * `aceptada` - Driver assigned
    * `en_curso` - Trip in progress
    * `completada` - Successfully completed
    * `cancelada` - Cancelled by user/driver
  </Tab>
</Tabs>

### Maps & Location Services

<Steps>
  <Step title="GPS Positioning">
    Automatic location detection using device GPS with high-accuracy mode
  </Step>

  <Step title="Geocoding">
    Convert coordinates to addresses and vice versa using Nominatim API
  </Step>

  <Step title="Route Calculation">
    Calculate optimal routes using Mapbox Directions API with traffic data
  </Step>

  <Step title="Interactive Maps">
    Flutter Map integration with Mapbox tiles for smooth pan and zoom
  </Step>

  <Step title="Traffic Information">
    Real-time traffic data from TomTom API for accurate ETAs
  </Step>
</Steps>

### Payment Management

<Info>Payment system is in development. Current implementation includes:</Info>

* Fare estimation before booking
* Distance-based pricing
* Vehicle type surcharges
* Time-based charges
* Commission calculation
* Price breakdown display

***

## Driver Features

### Registration & Verification

<AccordionGroup>
  <Accordion title="Driver Onboarding">
    **Registration Process:**

    1. Complete personal information form
    2. Upload required documents:
       * Driver's license (front/back)
       * Vehicle registration
       * Insurance documents
       * Profile photo
    3. Submit for admin review
    4. Await approval notification

    **Document Requirements:**

    * Images in JPG/PNG format
    * Clear, readable scans
    * Valid expiration dates
    * Matching personal information
  </Accordion>

  <Accordion title="Verification Workflow">
    **Admin Review Process:**

    * Document authenticity check
    * Background verification
    * Vehicle inspection status
    * License validity confirmation

    **Approval States:**

    * `pendiente` - Awaiting review
    * `en_revision` - Under review
    * `aprobado` - Approved for service
    * `rechazado` - Rejected with reason
  </Accordion>
</AccordionGroup>

### Trip Management

```dart theme={null}
// Driver receives nearby trip requests
{
  "solicitud_id": 123,
  "usuario_nombre": "John Doe",
  "origen": "Calle 123",
  "destino": "Avenida 456",
  "distancia_km": 5.2,
  "duracion_minutos": 15,
  "precio_estimado": 12500,
  "tipo_vehiculo": "carro"
}
```

**Driver Capabilities:**

* View pending trip requests within 5km radius
* Accept or decline trip offers
* Navigate to pickup location
* Update trip status (en route, arrived, in progress)
* Complete trip and confirm payment
* View earnings breakdown

### Availability Management

<Tabs>
  <Tab title="Online/Offline">
    Toggle availability status:

    * **Online** (disponibilidad = 1): Receive trip requests
    * **Offline** (disponibilidad = 0): No requests received

    Automatic status changes:

    * Goes offline when accepting a trip
    * Returns online after trip completion
  </Tab>

  <Tab title="Location Updates">
    Real-time location tracking:

    * GPS coordinates updated every 10 seconds
    * Sent to backend for driver matching
    * Used for distance calculations
    * Powers user's "driver approaching" feature
  </Tab>
</Tabs>

### Driver Dashboard

<CardGroup cols={2}>
  <Card title="Earnings Overview" icon="money-bill-trend-up">
    * Daily/weekly/monthly earnings
    * Trip count statistics
    * Average fare per trip
    * Commission breakdown
  </Card>

  <Card title="Trip History" icon="clock-rotate-left">
    * Complete trip log
    * Filter by date range
    * Export trip reports
    * Rating history
  </Card>

  <Card title="Performance Metrics" icon="chart-line">
    * Acceptance rate
    * Cancellation rate
    * Average rating
    * Total distance driven
  </Card>

  <Card title="Document Status" icon="file-certificate">
    * License expiration alerts
    * Insurance renewal reminders
    * Vehicle inspection status
    * Document update prompts
  </Card>
</CardGroup>

***

## Administrator Features

### User Management

**User Operations:**

* View all registered users
* Search and filter users
* View user details and trip history
* Suspend/activate user accounts
* Handle user disputes
* Export user data

**Driver Management:**

* Review driver applications
* Approve/reject driver documents
* Monitor driver performance
* Handle driver complaints
* Manage driver ratings
* Deactivate problematic drivers

### Document Verification

<Steps>
  <Step title="Review Queue">
    Access pending driver document submissions with priority sorting
  </Step>

  <Step title="Document Inspection">
    View high-resolution document images with zoom and rotation
  </Step>

  <Step title="Verification Checks">
    * Verify authenticity
    * Check expiration dates
    * Match personal information
    * Validate vehicle details
  </Step>

  <Step title="Approval/Rejection">
    Approve or reject with detailed feedback for drivers
  </Step>
</Steps>

### Dashboard & Analytics

```json theme={null}
// Real-time dashboard metrics
{
  "active_users": 1523,
  "active_drivers": 342,
  "trips_today": 856,
  "revenue_today": 4250000,
  "avg_trip_duration": 18,
  "avg_fare": 15200,
  "pending_approvals": 23
}
```

**Available Reports:**

* User growth trends
* Driver performance rankings
* Revenue by vehicle type
* Peak usage hours
* Geographic heat maps
* Cancellation rate analysis

### Configuration Management

<Tabs>
  <Tab title="Pricing Rules">
    Configure dynamic pricing:

    * Base fare by vehicle type
    * Per-kilometer charges
    * Per-minute charges
    * Minimum fare amounts
    * Surge pricing rules
    * Platform commission rates
  </Tab>

  <Tab title="Service Areas">
    Define operational zones:

    * Geographic boundaries
    * Service availability
    * Zone-specific pricing
    * Driver allocation rules
  </Tab>

  <Tab title="Notifications">
    Manage communications:

    * Email templates
    * SMS notifications
    * Push notification settings
    * Automated messages
  </Tab>
</Tabs>

***

## Company Features

### Fleet Management

<CardGroup cols={2}>
  <Card title="Driver Fleet" icon="users">
    * Assign drivers to company
    * Monitor driver performance
    * Manage driver schedules
    * Track fleet utilization
  </Card>

  <Card title="Vehicle Management" icon="car">
    * Register company vehicles
    * Track maintenance schedules
    * Monitor vehicle status
    * Assign vehicles to drivers
  </Card>

  <Card title="Performance Tracking" icon="chart-simple">
    * Fleet-wide statistics
    * Driver comparison reports
    * Vehicle efficiency metrics
    * Revenue per driver
  </Card>

  <Card title="Company Settings" icon="building-circle-check">
    * Company profile management
    * Branding customization
    * Commission agreements
    * Service area restrictions
  </Card>
</CardGroup>

***

## Technical Features

### Architecture

**Clean Architecture Implementation:**

* Domain layer with business logic
* Data layer with repository pattern
* Presentation layer with provider state management
* Dependency injection via service locator
* Modular feature organization

**Prepared for Microservices:**

* Modular backend structure
* Service-based endpoints
* Centralized API configuration
* Independent feature modules

### API Integration

<CodeGroup>
  ```dart Authentication theme={null}
  // Login endpoint
  POST /auth/login.php
  {
    "email": "user@example.com",
    "password": "securepass123"
  }
  ```

  ```dart Trip Request theme={null}
  // Create trip request
  POST /user/create_trip_request.php
  {
    "usuario_id": 1,
    "latitud_origen": -34.603722,
    "longitud_origen": -58.381592,
    "latitud_destino": -34.613722,
    "longitud_destino": -58.391592,
    "tipo_servicio": "viaje",
    "tipo_vehiculo": "carro"
  }
  ```

  ```dart Driver Location theme={null}
  // Update driver location
  POST /conductor/update_location.php
  {
    "conductor_id": 42,
    "latitud": -34.603722,
    "longitud": -58.381592,
    "disponibilidad": 1
  }
  ```
</CodeGroup>

### Security Features

<Warning>
  Security is paramount in a mobility platform handling user data and payments.
</Warning>

* **Authentication**: Email/password with verification
* **SQL Injection Protection**: Prepared statements throughout
* **XSS Prevention**: Input sanitization
* **CORS Configuration**: Controlled API access
* **Session Management**: Secure token handling
* **Data Encryption**: Passwords hashed with bcrypt

### Database Schema

**Core Tables:**

* `usuarios` - User accounts and profiles
* `conductores` - Driver information and status
* `solicitudes_servicio` - Trip requests
* `viajes` - Completed trips
* `asignaciones_conductor` - Driver assignments
* `documentos_conductor` - Driver documents
* `configuracion_precios` - Pricing rules
* `administradores` - Admin accounts
* `audit_logs` - System activity logs
* `empresas` - Company accounts

***

## Development Features

### Multi-Environment Support

```bash theme={null}
# Development
flutter run --dart-define=API_BASE_URL=http://10.0.2.2/viax/backend

# Staging
flutter run --dart-define=API_BASE_URL=https://staging.viax.com

# Production
flutter run --dart-define=API_BASE_URL=http://76.13.114.194
```

### Hot Reload & Debugging

* Flutter hot reload for instant UI updates
* Comprehensive error logging
* Network request debugging
* State management inspection
* Performance profiling tools

### Documentation

<CardGroup cols={3}>
  <Card title="Architecture Docs" icon="book">
    20,000+ words of technical documentation
  </Card>

  <Card title="API Reference" icon="code">
    Complete endpoint documentation
  </Card>

  <Card title="Setup Guides" icon="gears">
    Step-by-step installation guides
  </Card>
</CardGroup>

***

## Coming Soon

<Info>Features currently in development or planned for future releases:</Info>

* 🔔 **Push Notifications**: Real-time alerts for trip updates
* 💬 **In-App Chat**: Communication between users and drivers
* ⭐ **Rating System**: Rate and review completed trips
* 💳 **Payment Gateway**: Credit card and digital wallet integration
* 📍 **Favorite Locations**: Save frequently used addresses
* 🎁 **Promotions**: Discount codes and referral system
* 📊 **Advanced Analytics**: Business intelligence dashboard
* 🌐 **Multi-Language**: Support for multiple languages
* 🌙 **Dark Mode**: System-wide theme support
* 🔐 **Two-Factor Auth**: Enhanced security with 2FA

<Check>
  Viax is feature-rich and production-ready with continuous improvements based on user feedback and business needs.
</Check>
