HomeApp Details
AndroidiOS
Platform Overview

CGT FleetOps
UAE Fleet Management

Vehicle tracking, invoicing with aging analysis, maintenance scheduling, timesheet management, and RBAC — built for Curve Genaral Transport LLC operations in the UAE.

v1.0.0 Remote Portal App Next.js 16 + React 19 5 Languages incl. RTL 5 Roles, 36 Permissions
Company
Curve Genaral Transport LLC
Location
Abu Dhabi, UAE
Portal
app.cgt.llc
Demo Login
Credentials provided by administrator
At a Glance

Platform Capabilities

16
Modules
Prisma Models
5
Roles, 36 Permissions
Languages incl. RTL
🚛

Vehicles

Fleet inventory, registration, assignments, mileage, and availability status tracking.

Invoicing

Create invoices, track payments, 5-bucket aging analysis, VAT at 5% AED.

🔧

Maintenance

Schedule service, track costs, link records to vehicles and equipment.

📋

Estimates

Itemized quotes with approval workflow. Convert approved estimates to invoices.

Architecture

System Architecture

Thin Capacitor shell connecting to a full Next.js 16 web application. All data and logic server-side.

graph TB
    AND[Android App - 4.0 MB] --> SHELL[HTML Shell + Loader]
    IOS[iOS App - 642 KB] --> SHELL
    SHELL --> CHECK{Online?}
    CHECK -->|Yes| PORTAL[Next.js 16 Portal at cgt.llc]
    CHECK -->|No| OFFLINE[Offline Panel + Retry]
    OFFLINE -->|Reconnect| CHECK
    PORTAL --> NAUTH[NextAuth v5]
    NAUTH --> RBAC[RBAC: 5 Roles, 36 Permissions]
    RBAC --> MODULES[16 Modules]
    MODULES --> PRISMA[Prisma ORM - 26 Models]
    PRISMA --> NEON[PostgreSQL on Neon]
    PORTAL --> VERCEL[Vercel fra1]
    MODULES --> SWR[SWR Data Fetching]
    MODULES --> PDF[html2canvas + jspdf]

    style AND fill:#1B3A5C,stroke:#2a5280,color:#fff
    style IOS fill:#1B3A5C,stroke:#2a5280,color:#fff
    style SHELL fill:#1B3A5C,stroke:#F47920,color:#fff
    style PORTAL fill:#1B3A5C,stroke:#F47920,color:#fff
    style OFFLINE fill:#7f1d1d,stroke:#ef4444,color:#fff
    style NEON fill:#1a2520,stroke:#22c55e,color:#fff
    style VERCEL fill:#1a2520,stroke:#22c55e,color:#fff
        
User Flow

App Launch and Authentication

flowchart TD
    A[Open FleetOps App] --> B[Splash Screen - Navy, 2s]
    B --> C[Show Connecting Spinner]
    C --> D{navigator.onLine?}
    D -->|Yes| E[Fetch app.cgt.llc]
    D -->|No| F[Show Offline Panel]
    E --> G{Response OK?}
    G -->|Yes| H[Redirect to Portal]
    G -->|No| F
    F --> I[Show 4 Feature Icons]
    I --> J[Retry Button]
    J --> D
    H --> K[NextAuth Login Screen]
    K --> L[Enter Email + Password]
    L --> M{Valid Credentials?}
    M -->|Yes| N[JWT Session Created]
    M -->|No| O[Error Message]
    O --> L
    N --> P[Dashboard with Role-Filtered Sidebar]

    style A fill:#1B3A5C,stroke:#F47920,color:#fff
    style P fill:#1B3A5C,stroke:#F47920,color:#fff
    style F fill:#7f1d1d,stroke:#ef4444,color:#fff
    style O fill:#7f1d1d,stroke:#ef4444,color:#fff
                

Demo Credentials

EmailPasswordRole
Contact your administrator for login credentials

Authentication

  • NextAuth v5 with credentials provider
  • JWT sessions managed server-side
  • Middleware guards all authenticated routes
  • Unauthenticated API calls get 401 JSON
  • Unauthenticated pages redirect to login
Modules

16-Module Application Map

graph LR
    DASH[Dashboard] --> FLEET[Fleet]
    DASH --> FINANCE[Finance]
    DASH --> OPS[Operations]
    DASH --> GROWTH[Growth]

    FLEET --> VEH[Vehicles]
    FLEET --> EQUIP[Equipment]
    FLEET --> MAINT[Maintenance]

    FINANCE --> EST[Estimates]
    FINANCE --> INV[Invoices]
    FINANCE --> TS[Timesheets]
    FINANCE --> RECV[Receivables]
    FINANCE --> RC[Rate Cards]

    OPS --> CLI[Clients]
    OPS --> HR[HR]
    OPS --> COMMS[Comms]
    OPS --> DOCS[Documents]

    GROWTH --> MKT[Marketing Leads]
    GROWTH --> MKTPL[Marketplace]
    GROWTH --> RPT[Reports]

    style DASH fill:#1B3A5C,stroke:#F47920,color:#fff
    style FLEET fill:#1a3355,stroke:#3b82f6,color:#fff
    style FINANCE fill:#1a3355,stroke:#3b82f6,color:#fff
    style OPS fill:#1a3355,stroke:#3b82f6,color:#fff
    style GROWTH fill:#1a3355,stroke:#3b82f6,color:#fff
        

Fleet

Vehicles, equipment profiles, mileage, assignments, availability status, public registration endpoint.

Finance

Estimates with approval, invoices with aging, timesheets, receivables, rate cards. VAT at 5% AED.

Operations

Client management, HR records, communications log, document storage and management.

Growth

Marketing leads and conversion tracking, marketplace listings, performance reports and analytics.

Core Feature

Estimate to Invoice Lifecycle

flowchart TD
    A[New Estimate] --> B[Select Client]
    B --> C[Add Line Items]
    C --> D[Equipment + Rate + Qty + Price]
    D --> E[Apply Discount]
    E --> F[Auto-calc VAT at 5% AED]
    F --> G{Action}
    G -->|Save| H[Draft Estimate]
    G -->|Submit| I[Pending Approval]
    I --> J{Approved?}
    J -->|Yes| K[Approved Estimate]
    J -->|No| L[Rejected]
    L --> C
    K --> M{Convert?}
    M -->|Yes| N[Create Linked Invoice]
    M -->|No| O[Archive]
    N --> P[Invoice with Snapshot Fields]
    P --> Q[Track Payments]
    Q --> R[Aging Buckets: Current to 90+]
    P --> S[Share: PDF Export]

    style A fill:#1B3A5C,stroke:#F47920,color:#fff
    style K fill:#166534,stroke:#22c55e,color:#fff
    style L fill:#7f1d1d,stroke:#ef4444,color:#fff
    style N fill:#1e3a5f,stroke:#3b82f6,color:#fff
            

VAT Calculation

  • Rate: 5% AED, applied after discount
  • Formula: vat = subtotal - discount x 0.05
  • Rate stored per document for historical integrity

Invoice Aging Buckets

BucketDaysColor
Current0Green
1-301 to 30Yellow
31-6031 to 60Orange
61-9061 to 90Red
90+Over 90Purple

Aging recalculated on every read — not stored in DB.

Access Control

RBAC: 5 Roles, 36 Permissions

Every API route calls requireAuth before processing. Sidebar items filtered by role.

flowchart TD
    REQ[API Request] --> MW[Middleware Check]
    MW --> AUTH{Authenticated?}
    AUTH -->|No, API| ERR1[401 JSON Response]
    AUTH -->|No, Page| ERR2[Redirect to Login]
    AUTH -->|Yes| PERM{Has Permission?}
    PERM -->|Yes| EXEC[Execute Route Handler]
    PERM -->|No| ERR3[403 Forbidden]
    EXEC --> SIDEBAR[Filter Sidebar by Role]

    style REQ fill:#1B3A5C,stroke:#F47920,color:#fff
    style EXEC fill:#166534,stroke:#22c55e,color:#fff
    style ERR1 fill:#7f1d1d,stroke:#ef4444,color:#fff
    style ERR2 fill:#7f1d1d,stroke:#ef4444,color:#fff
    style ERR3 fill:#7f1d1d,stroke:#ef4444,color:#fff
                

5 Roles

RoleKey Access
AdminFull access to all 36 permissions, user management, settings
AccountsCreate and edit estimates + invoices, manage timesheets, view others
OperationsEdit equipment, manage maintenance + timesheets, view finance
SalesEdit clients + marketing, create estimates, view invoices + equipment
ViewerRead-only: clients, equipment, estimates, invoices, reports

Permission Pattern

  • Format: module:action — e.g. invoices:create
  • API: requireAuth in every route handler
  • UI: NAV_PERMISSION_MAP filters sidebar
  • 16 modules x variable actions = 36 total permissions
  • Defined in src/lib/permissions.ts
Infrastructure

Backend Stack

flowchart TD
    APP[FleetOps Mobile] --> CGT[app.cgt.llc]
    CGT --> NEXT[Next.js 16 + React 19]
    NEXT --> API[26 API Route Directories]
    API --> PRISMA[Prisma ORM - 26 Models]
    PRISMA --> NEON[PostgreSQL on Neon]
    NEXT --> NAUTH[NextAuth v5]
    NAUTH --> JWT[JWT Sessions]
    NEXT --> TW[Tailwind v4 + Radix UI]
    NEXT --> CHARTS[Recharts]
    API --> SWR[SWR Client Fetching]
    API --> PUBLIC[2 Public Endpoints]

    style APP fill:#1B3A5C,stroke:#F47920,color:#fff
    style NEON fill:#1a2520,stroke:#22c55e,color:#fff
    style CGT fill:#1B3A5C,stroke:#F47920,color:#fff
    style NEXT fill:#1a3355,stroke:#3b82f6,color:#fff
                

Server Stack

ComponentDetail
FrameworkNext.js 16, App Router, TypeScript
UIReact 19, Radix UI, Tailwind CSS v4
ORMPrisma, 26 models
DatabasePostgreSQL on Neon
AuthNextAuth v5, credentials provider
ChartsRecharts
Data FetchingSWR with manual mutate
PDF Exporthtml2canvas + jspdf
HostingVercel, fra1 region

Key API Routes

  • 26 authenticated API route directories
  • 2 public endpoints: vehicle registration + job applications
  • Estimate-to-invoice conversion: POST /api/estimates/[id]/convert
  • Sequential number generation: /api/next-number
  • Activity log + audit trail endpoints
Features

Languages, Shortcuts, and Sharing

5 Languages with RTL

CodeLanguageDirectionFont
ENEnglishLTRSystem default
ARArabicRTLNoto Sans Arabic
TRTurkishLTRSystem default
RURussianLTRSystem default
URUrduRTLNoto Sans Arabic

Stored in localStorage('fleetops-locale'). RTL auto-switches document direction and font.

Keyboard Shortcuts

?Open shortcuts help modal
Alt+NOpen quick create menu
flowchart TD
    A[User Selects Language] --> B{RTL?}
    B -->|AR or UR| C[Set dir to RTL]
    B -->|EN, TR, RU| D[Set dir to LTR]
    C --> E[Load Noto Sans Arabic]
    D --> F[System Font]
    E --> G[Save to localStorage]
    F --> G
    G --> H[Reload Interface Text]

    style A fill:#1B3A5C,stroke:#F47920,color:#fff
    style C fill:#5c4a1e,stroke:#be9a5f,color:#fff
                
Considerations

Known Limitations and Workarounds

LimitationImpactWorkaround
Online-onlyNo offline data. Static shell only without internet.Auto-reconnect on online event; retry button
No push notificationsNo alerts for overdue invoices, maintenance, or assignmentsDashboard aging colors highlight overdue items
PDF quality varieshtml2canvas renders at screen resolutionUse tablet or desktop for higher-resolution exports
Neon connection poolFree tier limits concurrent DB connectionsCoordinate peak usage; upgrade Neon plan if needed
Domain-lockedWebView restricted to cgt.llc onlyExternal links open in device browser
iOS unsignedIPA needs Apple Developer account for distributionTestFlight or direct install on provisioned devices
No real-time syncOther users changes need manual refreshSWR revalidates on focus; manual refresh available
🚛

Full Fleet Management

Vehicles, operators, maintenance, timesheets — complete fleet operations platform for UAE.

💰

Financial Control

5-bucket invoice aging, VAT at 5% AED, estimate-to-invoice conversion, payment tracking.

1 / 10
to navigate