Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

πŸ” Open-source Lost & Found community app for Sri Lanka with AI-powered matching, offline support, and trust-driven ecosystem

License

Notifications You must be signed in to change notification settings

pirinthaban/findback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lost & Found Community App πŸ”

Flutter License: MIT PRs Welcome

Production-Ready Lost & Found Ecosystem for Sri Lanka & Global Markets

⚠️ This is a FREE, open-source project. You can fork, customize, and deploy it for FREE using Firebase Spark Plan.

🎯 Problem Statement

Critical Pain Points:

  • 15,000+ items lost daily in Sri Lanka (NICs, wallets, phones, documents)
  • No centralized trusted recovery system
  • Social media posts are unstructured, unsafe, and ineffective
  • Police manual processes take weeks
  • High risk of scams and fake claims
  • Language barriers (Sinhala, Tamil, English)

πŸš€ Quick Start (5 Minutes)

Prerequisites

Installation

# Clone the repository
git clone https://github.com/pirinthaban/FindBack.git
cd FindBack

# Install dependencies
flutter pub get

# Run on web (no Firebase needed for demo)
flutter run -d chrome

# Or run on Android emulator
flutter run

Set Up Firebase (Required for Production)

  1. Create FREE Firebase project: FIREBASE_SETUP.md
  2. Copy environment variables:
    cp .env.example .env
  3. Add your Firebase keys to .env
  4. Generate firebase_options.dart:
    flutterfire configure

πŸ“– Full setup guide: FIREBASE_SETUP.md


πŸ’‘ Solution Overview

A location-based, trust-driven, AI-powered Lost & Found ecosystem that connects:

  • Citizens (item losers & finders)
  • Police departments (verification authority)
  • Universities (campus recovery hubs)
  • Transport hubs (airports, bus stands, train stations)

Key Differentiators:

  • AI-powered automatic matching between lost and found items
  • Offline-first architecture (works without internet)
  • Government NIC/Passport secure recovery flow
  • Community trust & reputation system
  • Multi-language support (Si/Ta/En)

πŸš€ Core Features

User Management

  • Phone + Email registration with OTP
  • Social login (Google, Facebook)
  • User profiles with reputation scores
  • Role-based access (Citizen, Police, University Admin)

Item Management

  • Post Lost items (with urgency levels)
  • Post Found items (with current location)
  • Multiple image upload (up to 5 per item)
  • AI auto-blur sensitive details (NIC numbers, faces)
  • Item categories: NIC, Passport, Phone, Wallet, Bag, Keys, Documents, Other
  • Location tagging with Google Maps
  • Radius-based nearby item discovery (500m - 50km)

Matching & Discovery

  • AI-powered Lost ↔ Found auto-matching
  • Image similarity detection (TensorFlow Lite)
  • Text description NLP matching
  • Location proximity scoring
  • Match confidence score (0-100%)
  • Smart push notifications for high-confidence matches

Communication & Claims

  • In-app encrypted chat
  • Claim ownership workflow with verification
  • Ownership proof submission (IMEI, photos, security questions)
  • Police verification mode
  • Report & block abusive users
  • Case closure & recovery confirmation

Trust & Safety

  • User reputation system (0-1000 points)
  • Community ratings & reviews
  • Anti-fraud detection algorithms
  • Audit logs for all critical actions
  • Privacy controls for sensitive documents
  • Rate limiting & spam prevention

πŸ”¬ Advanced & Unique Features

AI & Machine Learning

  • Image Matching Engine: Detects similar items using neural networks
  • Auto-categorization: Identifies item type from photos
  • Sensitive Data Blurring: Auto-detects and blurs NIC numbers, faces
  • NLP Matching: Analyzes descriptions for semantic similarity
  • Fraud Detection: Identifies suspicious patterns

Offline & Emergency

  • Offline-first Architecture: Post items without internet, sync later
  • Bluetooth Nearby Broadcast: Found phones broadcast to nearby devices
  • Emergency/Disaster Mode: Special UI for natural disasters
  • SMS Fallback: Critical notifications via SMS when offline

Integration Ready

  • QR Code Generation: Every item gets a unique QR code
  • NFC Tag Support: Future integration with physical tags
  • Police API Integration: Direct case filing
  • University Systems: Campus lost & found integration

Localization

  • Multi-language support (Sinhala, Tamil, English)
  • District-wise categorization (25 districts of Sri Lanka)
  • Local time & date formats

πŸ› οΈ Tech Stack

Frontend (Mobile App)

Framework: Flutter 3.16+
State Management: Riverpod 2.0
Architecture: Clean Architecture + MVVM
UI Library: Material Design 3
Navigation: go_router
Local Database: Hive + drift

Key Packages:

  • google_maps_flutter - Location services
  • image_picker - Camera & gallery
  • firebase_auth - Authentication
  • cloud_firestore - Real-time database
  • firebase_messaging - Push notifications
  • flutter_riverpod - State management
  • cached_network_image - Image caching
  • geolocator - GPS services
  • connectivity_plus - Network detection
  • hive - Offline storage
  • tflite_flutter - AI inference

Backend

Platform: Firebase
Authentication: Firebase Auth
Database: Firestore
Storage: Firebase Storage + Cloudinary
Functions: Cloud Functions (Node.js/TypeScript)
Hosting: Firebase Hosting (Admin Panel)
Analytics: Firebase Analytics
Crashlytics: Firebase Crashlytics

AI/ML

Image Matching: TensorFlow Lite (MobileNetV3)
NLP: Firebase ML + Cloud Natural Language API
Image Processing: Cloudinary AI
OCR: ML Kit Text Recognition
Face Detection: ML Kit Face Detection

DevOps & Tools

CI/CD: GitHub Actions
Version Control: Git
Code Quality: Flutter Analyzer, ESLint
Testing: flutter_test, mockito
Monitoring: Firebase Performance Monitoring
Error Tracking: Sentry

πŸ“Š System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     MOBILE APP (Flutter)                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Presentation Layer (UI Screens)                            β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ Splash & Onboarding                                     β”‚
β”‚  β”œβ”€ Authentication Screens                                  β”‚
β”‚  β”œβ”€ Home Feed (Nearby Items)                                β”‚
β”‚  β”œβ”€ Post Lost/Found Flow                                    β”‚
β”‚  β”œβ”€ Item Details & Matching                                 β”‚
β”‚  β”œβ”€ Claims & Verification                                   β”‚
β”‚  β”œβ”€ Encrypted Chat                                          β”‚
β”‚  └─ Profile & Reputation                                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Application Layer (Business Logic)                         β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ State Management (Riverpod)                             β”‚
β”‚  β”œβ”€ Use Cases / Interactors                                 β”‚
β”‚  └─ View Models                                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Domain Layer (Core Business)                               β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ Entities (User, Item, Claim, Chat)                      β”‚
β”‚  β”œβ”€ Repositories (Interfaces)                               β”‚
β”‚  └─ Business Rules                                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Data Layer (External Services)                             β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ Firebase Repository Implementation                      β”‚
β”‚  β”œβ”€ Local Database (Hive)                                   β”‚
β”‚  β”œβ”€ AI Service (TFLite)                                     β”‚
β”‚  └─ Image Service (Cloudinary)                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   FIREBASE BACKEND                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Authentication                                              β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ Phone Auth (OTP)                                        β”‚
β”‚  β”œβ”€ Email/Password                                          β”‚
β”‚  └─ OAuth (Google, Facebook)                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Firestore Database                                          β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ users/                                                  β”‚
β”‚  β”œβ”€ items/                                                  β”‚
β”‚  β”œβ”€ matches/                                                β”‚
β”‚  β”œβ”€ claims/                                                 β”‚
β”‚  β”œβ”€ chats/                                                  β”‚
β”‚  β”œβ”€ messages/                                               β”‚
β”‚  β”œβ”€ reports/                                                β”‚
β”‚  β”œβ”€ police_verifications/                                   β”‚
β”‚  └─ audit_logs/                                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Cloud Functions (Triggers & APIs)                          β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ onItemCreated() - AI matching trigger                   β”‚
β”‚  β”œβ”€ processImageUpload() - Blur sensitive data              β”‚
β”‚  β”œβ”€ calculateMatchScore() - AI matching algorithm           β”‚
β”‚  β”œβ”€ sendMatchNotification() - Push notifications            β”‚
β”‚  β”œβ”€ verifyClaim() - Ownership verification                  β”‚
β”‚  β”œβ”€ moderateContent() - Auto moderation                     β”‚
β”‚  └─ generateReports() - Analytics                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Firebase Storage                                            β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ item_images/                                            β”‚
β”‚  β”œβ”€ proof_documents/                                        β”‚
β”‚  └─ user_avatars/                                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Firebase Cloud Messaging                                    β”‚
β”‚  β”‚                                                            β”‚
β”‚  β”œβ”€ Match Notifications                                     β”‚
β”‚  β”œβ”€ Claim Updates                                           β”‚
β”‚  └─ Chat Messages                                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  EXTERNAL SERVICES                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”œβ”€ Cloudinary (Image Processing & CDN)                     β”‚
β”‚  β”œβ”€ Google Maps API (Geocoding & Maps)                      β”‚
β”‚  β”œβ”€ Twilio (SMS Notifications)                              β”‚
β”‚  └─ SendGrid (Email Notifications)                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—„οΈ Database Design

Firestore Collections Structure

firestore/
β”œβ”€β”€ users/
β”‚   └── {userId}
β”‚       β”œβ”€β”€ email: string
β”‚       β”œβ”€β”€ phone: string
β”‚       β”œβ”€β”€ displayName: string
β”‚       β”œβ”€β”€ photoURL: string
β”‚       β”œβ”€β”€ role: enum (citizen, police, university_admin, admin)
β”‚       β”œβ”€β”€ reputation: number (0-1000)
β”‚       β”œβ”€β”€ itemsPosted: number
β”‚       β”œβ”€β”€ itemsReturned: number
β”‚       β”œβ”€β”€ successRate: number (%)
β”‚       β”œβ”€β”€ location: geopoint
β”‚       β”œβ”€β”€ district: string
β”‚       β”œβ”€β”€ verifiedPolice: boolean
β”‚       β”œβ”€β”€ createdAt: timestamp
β”‚       β”œβ”€β”€ lastActive: timestamp
β”‚       └── fcmToken: string
β”‚
β”œβ”€β”€ items/
β”‚   └── {itemId}
β”‚       β”œβ”€β”€ type: enum (lost, found)
β”‚       β”œβ”€β”€ category: enum (nic, passport, phone, wallet, bag, keys, documents, other)
β”‚       β”œβ”€β”€ title: string
β”‚       β”œβ”€β”€ description: string
β”‚       β”œβ”€β”€ images: array<string> (URLs)
β”‚       β”œβ”€β”€ blurredImages: array<string>
β”‚       β”œβ”€β”€ location: geopoint
β”‚       β”œβ”€β”€ locationName: string
β”‚       β”œβ”€β”€ district: string
β”‚       β”œβ”€β”€ radius: number (meters)
β”‚       β”œβ”€β”€ geohash: string
β”‚       β”œβ”€β”€ userId: string (ref)
β”‚       β”œβ”€β”€ userName: string
β”‚       β”œβ”€β”€ userPhone: string (encrypted)
β”‚       β”œβ”€β”€ status: enum (active, claimed, verified, closed, expired)
β”‚       β”œβ”€β”€ urgency: enum (low, medium, high, emergency)
β”‚       β”œβ”€β”€ matchCount: number
β”‚       β”œβ”€β”€ viewCount: number
β”‚       β”œβ”€β”€ reportCount: number
β”‚       β”œβ”€β”€ features: object (AI extracted features)
β”‚       β”œβ”€β”€ embedding: array<number> (image embedding)
β”‚       β”œβ”€β”€ createdAt: timestamp
β”‚       β”œβ”€β”€ updatedAt: timestamp
β”‚       └── expiresAt: timestamp
β”‚
β”œβ”€β”€ matches/
β”‚   └── {matchId}
β”‚       β”œβ”€β”€ lostItemId: string (ref)
β”‚       β”œβ”€β”€ foundItemId: string (ref)
β”‚       β”œβ”€β”€ confidenceScore: number (0-100)
β”‚       β”œβ”€β”€ imageSimilarity: number
β”‚       β”œβ”€β”€ textSimilarity: number
β”‚       β”œβ”€β”€ locationProximity: number
β”‚       β”œβ”€β”€ timeDifference: number (hours)
β”‚       β”œβ”€β”€ matchedBy: enum (ai, manual)
β”‚       β”œβ”€β”€ status: enum (pending, viewed, claimed, dismissed)
β”‚       β”œβ”€β”€ createdAt: timestamp
β”‚       └── notificationSent: boolean
β”‚
β”œβ”€β”€ claims/
β”‚   └── {claimId}
β”‚       β”œβ”€β”€ itemId: string (ref)
β”‚       β”œβ”€β”€ claimantUserId: string (ref)
β”‚       β”œβ”€β”€ itemOwnerId: string (ref)
β”‚       β”œβ”€β”€ status: enum (pending, under_review, verified, rejected, completed)
β”‚       β”œβ”€β”€ proofDocuments: array<string> (URLs)
β”‚       β”œβ”€β”€ proofAnswers: object
β”‚       β”œβ”€β”€ verificationQuestions: array<object>
β”‚       β”œβ”€β”€ verifiedBy: string (userId - police/admin)
β”‚       β”œβ”€β”€ verificationNotes: string
β”‚       β”œβ”€β”€ meetupLocation: geopoint
β”‚       β”œβ”€β”€ meetupTime: timestamp
β”‚       β”œβ”€β”€ handoverConfirmed: boolean
β”‚       β”œβ”€β”€ handoverCode: string (6-digit)
β”‚       β”œβ”€β”€ createdAt: timestamp
β”‚       └── completedAt: timestamp
β”‚
β”œβ”€β”€ chats/
β”‚   └── {chatId}
β”‚       β”œβ”€β”€ itemId: string (ref)
β”‚       β”œβ”€β”€ participants: array<string> (userIds)
β”‚       β”œβ”€β”€ participantNames: object
β”‚       β”œβ”€β”€ lastMessage: string
β”‚       β”œβ”€β”€ lastMessageTime: timestamp
β”‚       β”œβ”€β”€ unreadCount: object {userId: count}
β”‚       β”œβ”€β”€ createdAt: timestamp
β”‚       └── archived: boolean
β”‚
β”œβ”€β”€ messages/
β”‚   └── {messageId}
β”‚       β”œβ”€β”€ chatId: string (ref)
β”‚       β”œβ”€β”€ senderId: string (ref)
β”‚       β”œβ”€β”€ text: string (encrypted)
β”‚       β”œβ”€β”€ type: enum (text, image, location, system)
β”‚       β”œβ”€β”€ mediaUrl: string
β”‚       β”œβ”€β”€ readBy: array<string> (userIds)
β”‚       β”œβ”€β”€ createdAt: timestamp
β”‚       └── deleted: boolean
β”‚
β”œβ”€β”€ reports/
β”‚   └── {reportId}
β”‚       β”œβ”€β”€ reporterUserId: string (ref)
β”‚       β”œβ”€β”€ reportedUserId: string (ref)
β”‚       β”œβ”€β”€ itemId: string (ref)
β”‚       β”œβ”€β”€ reason: enum (spam, fraud, inappropriate, fake)
β”‚       β”œβ”€β”€ description: string
β”‚       β”œβ”€β”€ evidence: array<string> (URLs)
β”‚       β”œβ”€β”€ status: enum (pending, investigating, resolved, dismissed)
β”‚       β”œβ”€β”€ reviewedBy: string (admin userId)
β”‚       β”œβ”€β”€ actionTaken: string
β”‚       β”œβ”€β”€ createdAt: timestamp
β”‚       └── resolvedAt: timestamp
β”‚
β”œβ”€β”€ police_verifications/
β”‚   └── {verificationId}
β”‚       β”œβ”€β”€ itemId: string (ref)
β”‚       β”œβ”€β”€ claimId: string (ref)
β”‚       β”œβ”€β”€ officerId: string (ref)
β”‚       β”œβ”€β”€ stationName: string
β”‚       β”œβ”€β”€ caseNumber: string
β”‚       β”œβ”€β”€ verificationStatus: enum (pending, verified, rejected)
β”‚       β”œβ”€β”€ officerNotes: string
β”‚       β”œβ”€β”€ documents: array<string>
β”‚       β”œβ”€β”€ createdAt: timestamp
β”‚       └── verifiedAt: timestamp
β”‚
β”œβ”€β”€ notifications/
β”‚   └── {notificationId}
β”‚       β”œβ”€β”€ userId: string (ref)
β”‚       β”œβ”€β”€ type: enum (match, claim, message, system)
β”‚       β”œβ”€β”€ title: string
β”‚       β”œβ”€β”€ body: string
β”‚       β”œβ”€β”€ data: object
β”‚       β”œβ”€β”€ read: boolean
β”‚       β”œβ”€β”€ actionUrl: string
β”‚       └── createdAt: timestamp
β”‚
└── audit_logs/
    └── {logId}
        β”œβ”€β”€ userId: string (ref)
        β”œβ”€β”€ action: string
        β”œβ”€β”€ entityType: string
        β”œβ”€β”€ entityId: string
        β”œβ”€β”€ changes: object
        β”œβ”€β”€ ipAddress: string
        β”œβ”€β”€ deviceInfo: object
        └── timestamp: timestamp

Indexing Strategy

Composite Indexes (Firestore):

# Items collection
- collection: items
  fields:
    - status: ASC
    - geohash: ASC
    - createdAt: DESC

- collection: items
  fields:
    - type: ASC
    - category: ASC
    - status: ASC
    - createdAt: DESC

- collection: items
  fields:
    - userId: ASC
    - status: ASC
    - createdAt: DESC

# Matches collection
- collection: matches
  fields:
    - lostItemId: ASC
    - confidenceScore: DESC
    - status: ASC

- collection: matches
  fields:
    - foundItemId: ASC
    - confidenceScore: DESC
    - status: ASC

# Claims collection
- collection: claims
  fields:
    - itemId: ASC
    - status: ASC
    - createdAt: DESC

# Messages collection
- collection: messages
  fields:
    - chatId: ASC
    - createdAt: ASC

πŸ” Security & Trust

Authentication & Authorization

Multi-factor Authentication:
  - Phone OTP (Primary)
  - Email verification (Secondary)
  - Biometric (Face ID / Fingerprint)

Role-Based Access Control:
  - Citizen: Post, claim, chat
  - Police: Verify, investigate
  - University Admin: Manage campus items
  - Super Admin: Full access, moderation

Session Management:
  - JWT tokens with 30-day expiry
  - Auto-refresh tokens
  - Device tracking
  - Force logout on suspicious activity

Data Protection

Encryption:
  - End-to-end chat encryption (AES-256)
  - PII encryption at rest
  - Phone numbers hashed
  - Sensitive documents encrypted

Privacy Controls:
  - Auto-blur NIC numbers
  - Face detection and blur
  - Location fuzzing (show area, not exact point)
  - Phone number masking (94XX XXX XX12)

Anti-Fraud Mechanisms

Rate Limiting:
  - Max 5 items per user per day
  - Max 3 claims per item
  - Max 50 messages per hour

Fraud Detection:
  - Duplicate item detection
  - Suspicious pattern analysis
  - IP tracking
  - Device fingerprinting
  - Velocity checks

Trust Scoring:
  - Reputation points (0-1000)
  - Success rate tracking
  - Community ratings
  - Time-based trust building

Firebase Security Rules

See: firestore.rules and storage.rules


🎨 UI/UX Design

Screen Flow

[Splash Screen]
    ↓
[Onboarding] β†’ (First time users)
    ↓
[Phone Verification]
    ↓
[OTP Entry]
    ↓
[Profile Setup]
    ↓
[Home Feed]
    β”œβ”€ [Post Lost Item]
    β”‚   β”œβ”€ Select Category
    β”‚   β”œβ”€ Add Photos
    β”‚   β”œβ”€ Add Description
    β”‚   β”œβ”€ Set Location
    β”‚   └─ Submit
    β”‚
    β”œβ”€ [Post Found Item]
    β”‚   β”œβ”€ Select Category
    β”‚   β”œβ”€ Add Photos
    β”‚   β”œβ”€ Add Description
    β”‚   β”œβ”€ Set Location
    β”‚   └─ Submit
    β”‚
    β”œβ”€ [Item Details]
    β”‚   β”œβ”€ View Images
    β”‚   β”œβ”€ View Matches (AI suggested)
    β”‚   β”œβ”€ Contact Owner (Chat)
    β”‚   └─ Claim Item
    β”‚
    β”œβ”€ [Claim Flow]
    β”‚   β”œβ”€ Submit Proof
    β”‚   β”œβ”€ Answer Questions
    β”‚   β”œβ”€ Wait Verification
    β”‚   └─ Arrange Meetup
    β”‚
    β”œβ”€ [Chat Screen]
    β”‚   β”œβ”€ Send Messages
    β”‚   β”œβ”€ Share Location
    β”‚   └─ Report User
    β”‚
    β”œβ”€ [Profile]
    β”‚   β”œβ”€ My Items
    β”‚   β”œβ”€ My Claims
    β”‚   β”œβ”€ Reputation Score
    β”‚   β”œβ”€ Settings
    β”‚   └─ Logout
    β”‚
    └─ [Police Dashboard]
        β”œβ”€ Verification Queue
        β”œβ”€ Active Cases
        └─ Reports

Design System

Color Palette:

Primary: #1976D2 (Blue - Trust)
Secondary: #FF6B35 (Orange - Found)
Accent: #4CAF50 (Green - Success)
Warning: #FFA726 (Orange - Lost)
Error: #EF5350 (Red - Danger)
Background: #F5F5F5
Surface: #FFFFFF
Text Primary: #212121
Text Secondary: #757575

Typography:

Font Family: Poppins (Primary), Noto Sans Sinhala, Noto Sans Tamil
Heading 1: 24px, Bold
Heading 2: 20px, SemiBold
Body: 16px, Regular
Caption: 14px, Regular
Button: 16px, Medium

Components:

  • Bottom Navigation (Home, Search, Post, Chats, Profile)
  • Floating Action Button (Quick Post)
  • Item Cards (Grid/List view)
  • Match Confidence Badge
  • Reputation Stars
  • Category Chips
  • Map View with Clusters

πŸ’° Monetization Strategy

Revenue Streams

1. Freemium Model

Free Tier:
  - Post 3 items per month
  - Basic AI matching
  - Standard notifications
  - 24-hour support

Premium ($2.99/month):
  - Unlimited item posts
  - Priority AI matching
  - Instant notifications
  - Featured listings
  - 24/7 priority support
  - Advanced analytics

2. Institutional Subscriptions

Universities ($99/month):
  - Campus-wide lost & found system
  - Custom branding
  - Admin dashboard
  - Student verification integration
  - Analytics & reports

Transport Hubs ($199/month):
  - Airport/bus stand integration
  - Staff accounts
  - Digital lost property office
  - Monthly reports

Police Departments (Free):
  - Verification tools
  - Case management
  - Public service partnership

3. Sponsored Services

Insurance Partnerships:
  - Promoted recovery services
  - Quick claim processing
  - Insurance claim integration

Recovery Agents:
  - Professional recovery services
  - Verified agent listings
  - Commission-based model

4. Advertising (Non-intrusive)

Sponsored Items:
  - Lost pet recovery services
  - Document recovery agencies
  - Locksmiths, phone repair shops

5. Government Partnerships

NIC/Passport Recovery:
  - Official government integration
  - Streamlined replacement process
  - Verification services

Projected Revenue (Year 1)

Users: 50,000 (Sri Lanka)
Premium Conversion: 5% = 2,500 users
Premium Revenue: 2,500 Γ— $2.99 Γ— 12 = $89,700

Institutions: 20 universities + 10 transport hubs
Institutional Revenue: (20 Γ— $99 + 10 Γ— $199) Γ— 12 = $47,640

Advertising: $500/month = $6,000

Total Year 1: ~$143,340

πŸš€ Deployment Guide

Prerequisites

flutter --version  # 3.16.0+
node --version     # 18.0.0+
firebase --version # 12.0.0+

Firebase Setup

1. Create Firebase Project

firebase login
firebase projects:create lost-found-lk
firebase use lost-found-lk

2. Enable Services

  • Authentication (Phone, Email, Google)
  • Firestore Database
  • Cloud Storage
  • Cloud Functions
  • Cloud Messaging
  • Analytics
  • Crashlytics

3. Add Firebase to Flutter

flutterfire configure

Cloudinary Setup

1. Create Account

  • Sign up at cloudinary.com
  • Get Cloud Name, API Key, API Secret

2. Configure Transformations

Auto-blur preset: ai_blur_sensitive
Image optimization: f_auto,q_auto
Responsive: w_auto,c_scale

Environment Configuration

Create .env files:

# .env
FIREBASE_PROJECT_ID=lost-found-lk
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
GOOGLE_MAPS_API_KEY=your_maps_key

Build & Release

Android:

flutter build apk --release
flutter build appbundle --release

iOS:

flutter build ios --release

Deployment Checklist

  • Firebase security rules deployed
  • Cloud Functions deployed
  • Environment variables set
  • App signed with release key
  • Privacy policy published
  • Terms of service published
  • Google Play Store listing
  • App Store Connect listing
  • Analytics configured
  • Crashlytics enabled
  • Push notifications tested
  • Payment integration tested

πŸ“ˆ Scalability Plan

Phase 1: Sri Lanka Launch (0-10K users)

Infrastructure:
  - Firebase Spark Plan (Free)
  - Single region (asia-south1)
  - Basic AI matching

Capacity:
  - 10K concurrent users
  - 50K items
  - 100K messages/day

Phase 2: National Scale (10K-100K users)

Infrastructure:
  - Firebase Blaze Plan (Pay-as-you-go)
  - CDN enabled (Cloudinary)
  - Advanced AI matching
  - Multi-language support

Capacity:
  - 100K concurrent users
  - 500K items
  - 1M messages/day
  - Auto-scaling cloud functions

Phase 3: Regional Expansion (100K-1M users)

Infrastructure:
  - Multi-region deployment
  - Microservices architecture
  - Dedicated AI inference servers
  - Redis caching layer
  - Elasticsearch for search

Capacity:
  - 1M concurrent users
  - 5M items
  - 10M messages/day
  - 99.9% uptime SLA

Performance Optimization

Database:
  - Query optimization with indexes
  - Data partitioning by district
  - Read replicas for heavy queries

Images:
  - Cloudinary CDN
  - WebP format
  - Lazy loading
  - Progressive image loading

Caching:
  - Client-side caching (Hive)
  - Server-side caching (Redis)
  - CDN caching
  - API response caching

πŸ§ͺ Testing Strategy

Unit Tests

Coverage Target: 80%
Test Cases:
  - Business logic
  - Data models
  - Utilities
  - Validators

Integration Tests

Test Cases:
  - API integration
  - Database operations
  - Authentication flows
  - Image upload & processing

UI Tests

Test Cases:
  - Critical user flows
  - Form validation
  - Navigation
  - Error states

Performance Tests

Metrics:
  - App launch time < 2s
  - Screen load time < 1s
  - API response time < 500ms
  - Image load time < 1s

Security Tests

Test Cases:
  - Authentication bypass attempts
  - SQL injection (N/A - NoSQL)
  - XSS attacks
  - Rate limiting
  - Data encryption

πŸ“š Project Structure

lost_and_finder/
β”œβ”€β”€ android/                 # Android native code
β”œβ”€β”€ ios/                     # iOS native code
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   β”œβ”€β”€ theme/
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ error/
β”‚   β”‚   └── network/
β”‚   β”œβ”€β”€ features/
β”‚   β”‚   β”œβ”€β”€ authentication/
β”‚   β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”‚   β”œβ”€β”€ domain/
β”‚   β”‚   β”‚   └── presentation/
β”‚   β”‚   β”œβ”€β”€ items/
β”‚   β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”‚   β”œβ”€β”€ domain/
β”‚   β”‚   β”‚   └── presentation/
β”‚   β”‚   β”œβ”€β”€ matching/
β”‚   β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”‚   β”œβ”€β”€ domain/
β”‚   β”‚   β”‚   └── presentation/
β”‚   β”‚   β”œβ”€β”€ claims/
β”‚   β”‚   β”œβ”€β”€ chat/
β”‚   β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   └── police/
β”‚   └── main.dart
β”œβ”€β”€ functions/               # Cloud Functions
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ triggers/
β”‚   β”‚   β”œβ”€β”€ ai/
β”‚   β”‚   └── utils/
β”‚   └── package.json
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ images/
β”‚   β”œβ”€β”€ fonts/
β”‚   └── models/             # TFLite models
β”œβ”€β”€ test/
β”œβ”€β”€ firebase.json
β”œβ”€β”€ firestore.rules
β”œβ”€β”€ storage.rules
└── pubspec.yaml

πŸŽ“ Academic Project Components

Abstract

See: docs/ACADEMIC_ABSTRACT.md

Full Documentation

See: docs/ folder for:

  • System Requirements Specification (SRS)
  • Software Design Document (SDD)
  • Test Plan
  • User Manual
  • Technical Report

🌟 Future Enhancements

Phase 2 Features:

  • Video testimonials
  • Blockchain-based ownership proof
  • Augmented Reality item preview
  • Voice search
  • Real-time translation
  • Dark mode

Phase 3 Features:

  • International expansion
  • Multi-currency support
  • Shipping integration
  • Insurance claim integration
  • Reward system for finders
  • Community events

πŸ“ License

MIT License - See LICENSE file


🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

How to Contribute

  1. Fork this repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Areas We Need Help

  • 🎨 UI/UX improvements
  • 🌐 Sinhala/Tamil translations
  • πŸ§ͺ Unit & integration tests
  • πŸ“š Documentation
  • β™Ώ Accessibility features
  • ⚑ Performance optimization

πŸ‘₯ Contributors

This is an open-source community project.

Original Author: pirinthaban
Project Type: Final Year Project / Community Initiative
University: [Your University] (Optional)

Want to be listed here? Contribute!


πŸ“ž Support & Community


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

TL;DR: You can freely use, modify, and distribute this project for personal or commercial use.


πŸ™ Acknowledgments

  • Flutter & Firebase communities
  • Open-source contributors
  • Sri Lanka Police (inspiration)
  • Universities & transport hubs
  • Everyone who loses things πŸ˜„

⭐ Star This Project

If this project helped you, please give it a ⭐ on GitHub!


Made with ❀️ for Sri Lanka and the world


πŸ“Š Project Stats

GitHub stars GitHub forks GitHub issues GitHub license