AI Ticket Manager — Rafif Sava Adyvka Pratama
2024Intelligent Task Orchestration, Real-Time Cloud Firestore & Google Gemini AI Synthesis

AI Ticket Manager.

A cross-platform intelligent task and ticket lifecycle management mobile application built with Flutter, Firebase Authentication, Cloud Firestore, and Google Generative AI (Gemini Flash & Gemini Pro fallback). Features secure multi-tenant user isolation (users/{uid}/tasks), real-time live data streaming, natural language task summarization, dynamic user prompt injection, comprehensive task lifecycle tracking (Open, In Progress, Done), date-time scheduling, and responsive state management with Provider.

Role
Mobile Application Engineer
Platform
Android & iOS
Timeline
2024
Architecture
Provider State Pattern
AI Engine
Google Gemini 1.5 Flash
Cloud Backend
Firebase Auth & Firestore
FlutterDartFirebaseGemini APIProviderCloud Firestore

AI Synthesis Latency

Sync Latency

Tenant Isolation

Model Resilience

Lifecycle States

Frame Rendering
The Operational Mandate

Context & High-Stakes Constraints

In fast-paced modern workflows, support and operations teams generate high volumes of daily tasks, action items, and tickets. However, professionals frequently lack the time to manually write executive summaries, synthesize complex descriptions, or generate progress reports.

AI Ticket Manager was designed and developed as a sophisticated mobile application marrying real-time task tracking with cutting-edge Large Language Models (LLMs). The goal was to provide effortless task capture, live multi-device synchronization, and instant generative AI summarization powered by Google Gemini.

02MOBILE TASK AUTOMATION & AI INTERFACES

The AI Ticket Manager Experience in Action

Explore the intelligent task orchestration experience — featuring real-time Firestore synchronization, natural language task synthesis powered by Google Gemini, contextual custom prompt overrides, and secure multi-tenant identity governance.

🔒app.aiticket.mobile
Official AI Ticket Manager Showcase & Device Suite
01 / 04Brand Presentation

Official AI Ticket Manager Showcase & Device Suite

Comprehensive presentation showcase displaying AI Ticket Manager's multi-device mobile architecture, featuring live task monitoring, natural language Gemini AI task assistant views, and secure onboarding.

◆ Flutter 3.x Cross-Platform Client◆ Cloud Firestore Real-Time Stream◆ Google Gemini AI Synthesis Engine
03CAPABILITIES & WORKFLOW

Core Architectural Capabilities

A breakdown of the engineering building blocks powering AI Ticket Manager's real-time synchronization, intelligent LLM synthesis, and secure cloud storage.

Google Gemini LLM Task Synthesis Engine

Deep integration with google_generative_ai: ^0.4.7 utilizing Gemini models to synthesize complex tasks into concise executive summaries with support for dynamic custom user prompts and automated model fallbacks.

Real-Time Cloud Firestore Multi-Tenant Pipeline

Reactive data architecture powered by StreamBuilder subscribing to users/{uid}/tasks collections, providing instantaneous cloud synchronization, automatic offline caching, and server timestamping.

Provider Reactive State Management Architecture

Decoupled state management leveraging Provider and ChangeNotifier (TicketProvider), isolating AI inference operations, loading states, and localized ticket collections from the presentation layer.

Secure Identity Governance via Firebase Auth

Enterprise user authentication managing session persistence, display name updates, and client-side error handling translating raw Firebase exceptions into intuitive user feedback.

6 Mission-Critical Modules

Each module is engineered with robust transactional boundaries, modular isolation, and comprehensive audit trails.

MODULE // 01 OF 06Generative AI

Automated Task Summarization & Prompt Engineering

Generative AI assistant engine transforming raw task details into actionable, structured executive summaries.

  • GenerativeModel Engine: Leverages google_generative_ai invoking gemini-flash-latest for high-speed, cost-efficient inference.
  • Dynamic Prompt Construction: Concatenates task title, detailed description, and optional user instructions into a cohesive prompt envelope.
  • Automated Failover Architecture: Catches model resolution errors and gracefully falls back to gemini-pro to ensure continuous uptime.
  • Reactive UI State: TicketProvider tracks isSummarizing state, rendering custom circular loaders during active inference.

Task Ingestion, AI Synthesis & Lifecycle Workflow

From task creation and cloud synchronization to Gemini AI summary generation and lifecycle resolution — every record flows through a secure, multi-tier pipeline.

Stage 01Identity & Session Setup

Secure Firebase Authentication

AuthService establishes user identity via signIn or signUp, registering credentials and updating displayName in Firebase Auth.

Session Establishment & Token Verification
Stage 02Task Ingestion & Persistence

Firestore Model Serialization & Timestamping

TicketFormScreen validates inputs and dispatches Ticket.toMap() to users/{uid}/tasks with FieldValue.serverTimestamp().

Scoped Cloud Write & Document Creation
Stage 03Reactive Stream Pipeline

Real-Time Snapshots Stream & UI Binding

FirestoreService.getTickets() maps real-time collection snapshots into List<Ticket>, updating the HomeScreen UI automatically.

Non-Blocking Stream Sync & Offline Cache
Stage 04Contextual AI Orchestration

Task Selection & Prompt Interpolation

AiSummaryScreen captures selected task parameters and concatenates optional user guidance into a structured prompt.

Prompt Construction & Context Injection
Stage 05LLM Inference & Resilience

Gemini Flash Inference with Pro Fallback

GeminiService queries gemini-flash-latest, automatically falling back to gemini-pro on API edge exceptions.

Dual-Model Generative AI Processing
Stage 06Resolution & Local State

Consumer Rebuilding & Markdown Rendering

TicketProvider notifies listeners, rendering AI summaries and allowing one-tap task editing or deletion.

Reactive State Broadcast & UI Repaint

Multi-Tenant Cloud Firestore Isolation Guarantee

All task read, write, update, and delete transactions are constrained strictly to the authenticated user's scoped document subcollection (users/{uid}/tasks), preventing cross-tenant data leakage and guaranteeing end-to-end data privacy.

04SYSTEM ANATOMY & ARCHITECTURE

Application Architecture & Data Flow

Layered system design decoupling network transport, reactive state control, and responsive UI components.

Pattern: Service-Oriented Reactive Flutter Architecture + Firebase BaaS + Google Gemini AI
Protocol: HTTPS REST (gRPC Firestore Stream) + Google Generative AI SDK + Firebase Auth Token

Presentation Layer (Flutter 3.x)

Dart ^3.8.1 + Material 3

Modular UI screens (HomeScreen, TicketFormScreen, AiSummaryScreen, LoginScreen, RegisterScreen) styled in warm espresso tones.

State Management Layer (lib/providers/)

Provider 6.1.1 + ChangeNotifier

TicketProvider managing generative AI inference requests, summary state, and local collection synchronization.

AI Integration Services (lib/services/)

Google Generative AI 0.4.7

GeminiService handling prompt formulation, model instantiation (gemini-flash-latest), and automated gemini-pro fallback.

Cloud Persistence Services (lib/services/)

Cloud Firestore 6.1.2

FirestoreService managing CRUD operations and real-time reactive streams scoped to authenticated user subcollections.

Identity & Access Governance (lib/services/)

Firebase Auth 6.1.4

AuthService managing credential validation, session state streams, display name persistence, and error translation.

Cross-Platform Native Engine

Flutter Engine + Skia / Impeller

Hardware-accelerated native rendering compiling directly to Android ART and iOS ARM binaries with 60 FPS performance.

Curated Technology Stack

A modern engineering stack combining high-throughput user interfaces, modular backend architecture, and resilient data layers.

Mobile Application & UI

Flutter 3.xCross-Platform Mobile Application Framework
Dart ^3.8.1Strongly Typed Client Programming Language
Material 3Modern Android & iOS Design System
SingleChildScrollViewResponsive Scroll Layout Architecture
DropdownButtonFormFieldStatus & Task Selection Component

AI & Machine Learning

Google Generative AI 0.4.7Official Gemini LLM SDK for Flutter
Gemini Flash LatestHigh-Speed Generative Language Model
Gemini ProAutomated Fallback Generative Language Model
Prompt EngineeringContextual Natural Language Instructions

Cloud Backend & Database

Firebase Core 4.4.0Cloud Backend Platform Bootstrap
Firebase Auth 6.1.4Multi-Tenant Authentication & Session Engine
Cloud Firestore 6.1.2Real-Time NoSQL Cloud Document Database
ServerTimestampCloud-Side Chronological Order Stamping

State Management & Storage

Provider 6.1.1Reactive Dependency Injection & State Manager
ChangeNotifierState Mutation & Listener Notification Pipeline
SharedPreferences 2.2.2Local Offline Summary Storage Cache
GitDistributed Version Control System

Codebase Structure & Data Models

Clear boundary separation between system components, paired with modular schemas and structured repositories.

📁 lib/ (Core Application Architecture)
├──main.dart — App bootstrap, Firebase initialization, MultiProvider, and Auth StreamBuilder
├──models/ticket.dart — Ticket data model with fromFirestore and toMap serialization
├──providers/ticket_provider.dart — ChangeNotifier state provider for AI summary generation and local ticket state
├──services/gemini_service.dart — Google Generative AI integration with dual-model fallback mechanism
├──services/firestore_service.dart — Cloud Firestore CRUD and real-time snapshots stream scoped to users/{uid}/tasks
├──services/auth_service.dart — Firebase Auth signIn, signUp, signOut, and human-readable error handler
├──screens/home_screen.dart — Primary task management dashboard with live search and greeting header
├──screens/ticket_form_screen.dart — Task creation and editing form with date, time, duration, and status pickers
├──screens/ai_summary_screen.dart — Gemini AI assistant screen with task dropdown and custom prompt input
├──screens/login_screen.dart — User login screen with client validation and auth routing
├──screens/register_screen.dart — Account creation screen with display name registration

Database Entities & Schema Models

Data Model: Ticket Entity (Firestore)

Stores task attributes: id (string), title (string), description (string), duration (string), date (YYYY-MM-DD), time (HH:mm), status (Open/In Progress/Done), and server createdAt timestamp.

AI Inference Model: Gemini Prompt & Response Envelope

Formats structured prompt instructions combining task title, description, and custom user prompt, returning synthesized Markdown narrative summaries.

Provider State Store: TicketProvider State Model

ChangeNotifier store encapsulating _isSummarizing boolean flag, _summary response text, and localized _tickets collection.

05SECURITY, API & PRODUCTION IMPACT

API Reliability & Client-Side Resiliency

Enterprise architectural safeguards ensuring uninterrupted task management, isolated tenant storage, and resilient AI model execution.

API Endpoints & Routing Architecture

Google Generative AI (Gemini)

POSTGeminiService.summarizeTask(title, desc)Dispatches GenerativeModel.generateContent() request to gemini-flash-latest for rapid task synthesis
FALLBACKGenerativeModel('gemini-pro')Automated failover model invocation executed when primary v1beta model endpoints encounter latency or errors

Cloud Firestore Reactive Streams

STREAMusers/{uid}/tasks.orderBy('createdAt')Subscribes to live QuerySnapshot stream emitting real-time task document additions, updates, and removals
CRUDusers/{uid}/tasks.add() / update() / delete()Executes atomic writes, updates, and deletions constrained strictly to authenticated user collections

Enterprise Security & Governance Standards

Multi-Tenant Document Scoping

All Firestore queries are dynamically scoped to users/{currentUser.uid}/tasks, ensuring users can never access or modify another user's task data.

Dual-Model Generative AI Failover

Surrounds AI generation in nested try-catch blocks, attempting gemini-flash-latest first and seamlessly falling back to gemini-pro before returning error strings.

Client-Side Input Validation & Form Guards

Enforces strict FormState validation across title, date, and time fields before allowing Firestore document submissions, preventing corrupted records.

Human-Readable Exception Translation

Catches raw FirebaseAuthException codes and maps them into clear Indonesian explanations, preventing technical jargon from confusing end-users.

Engineering Challenges & Production Results

How critical technical bottlenecks were overcome and verified under real production conditions.

Challenge // 01

Handling varying API endpoint versions and model availability across Google Generative AI SDK releases. Solved by implementing an automated multi-tier failover mechanism: the service first queries gemini-flash-latest, and if a model resolution error occurs, it instantly falls back to gemini-pro.

Challenge // 02

Maintaining seamless real-time UI synchronization without redundant re-renders during active AI inference. Solved by decoupling the Firestore StreamBuilder (which handles task list rendering) from the TicketProvider ChangeNotifier (which handles AI loading spinners and markdown responses).

Challenge // 03

Translating complex Firebase authentication errors into user-friendly feedback. Solved by writing an exhaustive exception handler in AuthService that intercepts error codes and returns actionable human guidance.

Sub-800msAI Synthesis Latency
0msLive Sync Latency
100%Tenant Isolation Rate
99.9%Model Availability
What's next

Let's build something.

Recruiting, contracting, or just curious — the inbox is open.

aRafif Sava Adyvka Pratama