Skip to main content

Overview

App Courier supports three primary user roles, each with dedicated interfaces and permissions designed for their specific workflows.

Admin

Manage packages, customers, drivers, and branches

Customer

Request shipments and track packages

Driver

Accept and complete deliveries

Role Comparison

FeatureAdminCustomerDriver
Create Packages✅ Full✅ Request
Track Packages✅ All✅ Own✅ Assigned
Manage Customers
Assign Deliveries
Update Status✅ All✅ Assigned
View Dashboard✅ Full✅ Limited✅ Personal
Manage Drivers
View Analytics✅ Personal
Upload Photos
Generate Reports

Admin Role

User Types

Admins can have different types within the system:
// User type IDs in the system
1: Super Admin
2: Branch Manager  
3: Staff/Employee

Admin Capabilities

  • Create new packages
  • View all packages across branches
  • Update package status
  • Assign packages to drivers
  • View package history and images
  • Generate shipping labels
  • Create and edit customer profiles
  • Manage customer addresses
  • Configure customer pricing plans
  • View customer shipping history
  • Search and filter customers
  • View all drivers at branch
  • Assign packages to drivers
  • Track driver performance
  • View driver delivery history
  • Manage driver accounts
  • View daily/weekly/monthly metrics
  • Package counts by status
  • Revenue reports
  • Branch performance
  • Customer analytics
  • Manage branches
  • Configure pricing plans
  • Set up payment types
  • Configure delivery types
  • User account management

Admin Interface

The admin panel has four main modules:
final List<Widget> _screens = [
  const DashboardScreen(),    // Analytics and metrics
  const CustomerScreen(),     // Customer management  
  const EncomiendaScreen(),  // Package management
  const MotorizadosScreen(), // Driver management
];

Admin Authentication

Admins login with:
  • Email address
  • Password
  • Branch assignment (automatic)
POST /auth/login
{
  "email": "[email protected]",
  "password": "password123"
}

Customer Role

Customer Types

Personal customers:
  • Individual users
  • DNI identification
  • Basic features
  • Standard pricing

Customer Capabilities

  • Track packages by remito number
  • View package status and history
  • See estimated delivery dates
  • View delivery photos
  • Request new shipments
  • Provide sender/recipient details
  • Select delivery options
  • View price estimates
  • Submit request for admin processing
  • Update contact information
  • Manage delivery addresses
  • Change password
  • View shipping history
  • View recent shipments
  • Track active packages
  • Access shipment history
  • Quick search

Customer Interface

Customer app modules:
Routes:
- Dashboard (modulesCliente)
- Request Shipment (solicitarEnvio)
- Pending Requests (solicitudesEnvio)  
- Completed Requests (solicitudesAtendidas)
- Profile (userClienteDetail)

Customer Authentication

Customers login with:
  • Username (usuario) or email
  • Password
POST /auth/loginCliente
{
  "usuario": "customer123",
  "password": "password123"
}

Customer Registration

Customers can self-register:
1

Enter Email

Provide name and email address
2

Verify Email

Receive and enter verification code
3

Create Account

Set password and complete profile
4

Start Using

Request shipments and track packages

Driver Role

Driver Types

// User type IDs for drivers
4: Primary Driver (Motorizado Principal)
5: Secondary Driver (Motorizado Secundario)

Driver Capabilities

  • See assigned packages
  • View delivery addresses
  • Access customer contact info
  • Check package details
  • Update package status
  • Mark as delivered
  • Return undeliverable packages
  • Add delivery notes
  • Take delivery photos
  • Upload images
  • Document package condition
  • Confirm delivery location
  • View completed deliveries
  • Check daily statistics
  • Access delivery history
  • Review assigned packages

Driver Interface

Driver app modules:
Modules:
- Dashboard: Performance metrics and statistics
- Encomiendas: View and manage assigned packages

Driver Assignment

Drivers are assigned packages by admins:
POST /encomienda/addMotorizados
{
  "id_encomienda": 123,
  "motorizados": [4, 8]  // Driver user IDs
}
Multiple drivers can be assigned to one package:
  • Primary Driver: Main responsible driver
  • Secondary Driver: Backup or assistant

Authentication Sessions

All roles receive a JWT token upon login:
class AuthSession {
  int? id;
  int? idUsuario;
  String? nombres;
  String? email;
  int? idTipoUsuario;  // Role: 1-3 (Admin), Customer, 4-5 (Driver)
  int? idSucursal;     // Branch ID (for admin/driver)
  String? token;       // JWT authentication token
}

Token Usage

The token is included in all API requests:
headers: {
  'Authorization': 'Bearer $token'
}
Tokens expire after a period of inactivity. Users must login again if token expires (401 error).

Permission Matrix

Package Operations

OperationAdminCustomerDriver
CreateRequest only
View All
View Own✅ Assigned
Update Status✅ Assigned
Assign Driver
Delete

Customer Operations

OperationAdminCustomerDriver
CreateSelf only
View All
View Own
UpdateSelf only
Delete

System Operations

OperationAdminCustomerDriver
Manage Branches
Configure Plans
View Analytics✅ Full✅ Personal
Manage Users
Generate Reports

Best Practices

Assign appropriate roles: Ensure users have the minimum permissions needed for their job function.
Train users on their interface: Each role has a tailored interface. Provide role-specific training.
Protect admin credentials: Admin accounts have full system access. Use strong passwords and never share credentials.

Role-Specific Documentation

Detailed guides for each role:

Admin Guide

Complete guide for administrators

Customer Guide

Help for customers using the app

Driver Guide

Instructions for delivery drivers

See Also

Build docs developers (and LLMs) love