Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PI Chatbot Mobile - Frontend

Overview

PI Chatbot Mobile is a cross-platform mobile application built with Flutter that enables users to interact with an intelligent chatbot for restaurant ordering. Users can browse menus, place orders, and manage their interactions through a conversational interface. The application provides a seamless experience across iOS, Android, and web platforms, integrated with Supabase for real-time data synchronization and user authentication.

Context

This repository contains the frontend component of the PI Chatbot project, developed as part of the Interdisciplinary Integrating Project (PII) by Computer Science students at Instituto Mauá de Tecnologia (IMT). The frontend communicates with a backend chatbot API service and Supabase database to deliver a complete ordering and chat experience. This is one part of a larger system that includes backend services, AI/chatbot engines, and database infrastructure.

Technologies

Core Frameworks & Languages

  • Flutter 3.0+ - Cross-platform mobile framework
  • Dart - Programming language
  • FlutterFlow - Low-code platform for Flutter development

Backend Integration

  • Supabase - Backend-as-a-Service for authentication and database
  • PostgreSQL - Database (via Supabase)
  • HTTP - REST API communication

State Management & Navigation

  • Provider - State management solution
  • GoRouter - Navigation and deep linking

UI & Styling

  • Google Fonts - Typography library
  • Font Awesome Flutter - Icon library
  • Flutter Animate - Animation framework
  • Auto Size Text - Responsive text scaling

Data & Storage

  • Shared Preferences - Local key-value storage
  • Hive - Lightweight local database
  • SQLite - Local relational database
  • Cached Network Image - Image caching

External Services

  • Custom Bot API - External chatbot service endpoint
  • Sign in with Apple - Authentication provider
  • App Links - Deep linking support

Additional Libraries

  • Intl - Internationalization support
  • TimeAgo - Relative time formatting
  • Page Transition - Page navigation animations
  • WebView Flutter - Web content display
  • URL Launcher - External URL handling

Architecture

Project Structure

lib/
├── backend/                    # Backend integration layer
│   ├── api_requests/          # HTTP API communication
│   │   ├── api_manager.dart   # API request management
│   │   ├── api_calls.dart     # Specific API endpoint definitions
│   │   └── get_streamed_response.dart  # Streaming response handling
│   └── supabase/              # Supabase integration
│       ├── supabase.dart      # Supabase client initialization
│       └── database/          # Database layer
│           ├── database.dart  # Database exports
│           ├── table.dart     # Base table class
│           ├── row.dart       # Base row class
│           └── tables/        # Data models
│               ├── mensagens.dart        # Chat messages table
│               ├── pedidos.dart          # Orders table
│               ├── cardapio_pratos.dart  # Menu dishes table
│               └── cardapio_bebidas.dart # Menu drinks table
├── flutter_flow/              # FlutterFlow utilities and components
│   ├── flutter_flow_theme.dart      # Theme management (light/dark mode)
│   ├── flutter_flow_widgets.dart    # Reusable UI components
│   ├── flutter_flow_util.dart       # Utility functions
│   ├── flutter_flow_model.dart      # Base model class
│   ├── custom_functions.dart        # Custom business logic
│   ├── form_field_controller.dart   # Form handling
│   ├── lat_lng.dart                 # Location data structures
│   ├── place.dart                   # Place information
│   ├── uploaded_file.dart           # File upload handling
│   └── nav/                         # Navigation helpers
├── pages/                     # Page components
│   ├── chat_page/            # Chat interface
│   │   ├── chat_page_widget.dart
│   │   └── chat_page_model.dart
│   └── home_page/            # Home page
│       ├── home_page_widget.dart
│       └── home_page_model.dart
├── main.dart                  # Application entry point
└── index.dart                 # Export barrel file

assets/                         # Static resources
├── images/                     # Images and icons
├── fonts/                      # Custom fonts
├── videos/                     # Video assets
├── audios/                     # Audio files
├── pdfs/                       # PDF documents
├── rive_animations/            # Rive animation files
└── jsons/                      # JSON data files

Data Models

The application manages the following key entities through Supabase:

  • Mensagens (Messages) - Stores chat conversation history with fields for message text, sender email, timestamp, and bot indicator
  • Pedidos (Orders) - Maintains order records including dish selection, drink selection, total price, and status
  • Cardápio Pratos (Menu - Dishes) - Restaurant menu items for main courses
  • Cardápio Bebidas (Menu - Drinks) - Available beverages

API Integration

The application communicates with an external chatbot API service (https://chatbot-161v.onrender.com/mensagem) to process user messages and generate bot responses. Responses are parsed for XML-formatted content extraction.

Authentication

User authentication is managed through Supabase Auth with email-based validation specific to the Poliedro education domain (@p4ed.com). The app supports Sign in with Apple as an additional authentication method.

Features

  • Interactive Chat Interface - Real-time messaging with bot responses
  • Menu Browsing - View available dishes and drinks with details
  • Order Management - Place orders through the chat interface with tracking
  • Message History - Persistent storage of conversation history
  • Cross-Platform Support - Optimized experience on iOS, Android, and web
  • Dark Mode Support - Theme switching between light and dark modes
  • Local Caching - Improved performance through image and data caching
  • Deep Linking - Direct navigation to specific pages via links
  • Offline Storage - Local data persistence with SQLite and Hive

Repository Structure

Key Directories

  • lib/backend/ - Backend service integrations (Supabase, APIs)
  • lib/flutter_flow/ - FlutterFlow framework components and utilities
  • lib/pages/ - UI screens and their associated models
  • android/ - Android-specific native code and configuration
  • ios/ - iOS-specific native code and configuration
  • web/ - Web platform configuration and bootstrap
  • assets/ - Static resources including images, fonts, and animations

Configuration Files

  • pubspec.yaml - Flutter project dependencies and configuration
  • analysis_options.yaml - Dart analyzer configuration
  • android/build.gradle - Android build configuration
  • ios/Podfile - iOS dependency management

Installation

Prerequisites

  • Flutter SDK (version 3.0 or higher)
  • Dart SDK (included with Flutter)
  • Git
  • iOS: Xcode (for iOS development)
  • Android: Android Studio or Android SDK command-line tools

Setup Steps

  1. Clone the repository

    git clone <repository-url>
    cd frontend-chatbot
  2. Install Flutter dependencies

    flutter pub get
  3. Generate code from build runner (if needed)

    flutter pub run build_runner build
  4. Run the application

    # For Android
    flutter run -d android
    
    # For iOS
    flutter run -d ios
    
    # For web
    flutter run -d web
    
    # For all connected devices
    flutter run

Platform-Specific Setup

iOS:

cd ios
pod install
cd ..
flutter run -d ios

Android: No additional setup required beyond Flutter configuration.

Web:

flutter run -d web --release

Usage

Running the Application

# Development mode with hot reload
flutter run

# Profile mode (performance analysis)
flutter run --profile

# Release mode (optimized production build)
flutter run --release

Building for Distribution

Android:

flutter build apk --release
# or for App Bundle
flutter build appbundle --release

iOS:

flutter build ios --release

Web:

flutter build web --release

Code Style & Linting

# Run Dart analyzer
dart analyze

# Format code
dart format lib/

My Contributions

Based on repository analysis, this project demonstrates:

  • Frontend Architecture Design - Modular structure separating concerns (backend, UI, models)
  • API Integration - RESTful communication with external chatbot service
  • Database Integration - Supabase schema design and ORM-like abstractions
  • State Management - Provider-based architecture for reactive UI updates
  • Cross-Platform Development - Supporting iOS, Android, and web from single codebase
  • Custom Functions - Specialized business logic (email validation, XML parsing, formatting)
  • UI/UX Implementation - FlutterFlow-based component development with theme support
  • Authentication Flow - Secure user authentication and authorization
  • Performance Optimization - Image caching and lazy loading strategies

Future Improvements

  • Enhanced AI Capabilities - Implement advanced NLP for more context-aware responses
  • Payment Integration - Add in-app payment processing
  • Push Notifications - Real-time order status updates
  • Multi-Language Support - Expand beyond Portuguese interface
  • Advanced Analytics - User behavior tracking and insights
  • Image Recognition - Photo-based menu item identification
  • Voice Commands - Hands-free interaction through speech recognition
  • Order History Analytics - User preferences and recommendation engine
  • Real-Time Collaboration - Group ordering features
  • Performance Optimization - Reduce bundle size and improve startup time

Team

PI Chatbot Mobile was developed by a team of Computer Science students from Instituto Mauá de Tecnologia (IMT) as part of the Interdisciplinary Integrating Project (PII) for the 3rd semester. The project represents collaborative effort combining mobile development, backend integration, and user experience design principles.


Instituto Mauá de Tecnologia          Poliedro Sistema de Ensino

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages