Your smart Arabic document companion Ψ±ΩΩΩΩ Ψ§ΩΨ°ΩΩ ΩΩΨ±Ψ§Ψ‘Ψ© Ψ§ΩΩ Ψ³ΨͺΩΨ―Ψ§Ψͺ
A mobile-first AI-powered document reader and assistant for Arabic and English documents, built with Flutter.
Qari2 is a mobile application designed to help users read, understand, and interact with documents in Arabic and English. It combines a powerful PDF reader with AI-driven features including:
- AI Document Summarization - Generate short or detailed summaries instantly
- Semantic Search - Find concepts and ideas, not just keywords
- Chat with Documents - Ask questions and get contextual answers
- Document Conversion - Convert between PDF, Word, and Text formats
- OCR Support - Extract text from scanned documents and images
- Bilingual Interface - Full Arabic and English support with RTL layout
- University students studying in Arabic or English
- Government and office employees dealing with documents
- Researchers and professionals in GCC & MENA regions
- Anyone reading Arabic PDFs on mobile devices
Color Palette:
- Primary (Ink Blue):
#1E3A5F- Trust, intelligence, professionalism - Accent (Emerald Green):
#00A676- Growth, success, AI features - Secondary (Soft Sand):
#F4E4C1- Warmth, accessibility - Background Light:
#F7F7FA - Background Dark:
#0B1020
Typography:
- Latin: Poppins (clean, modern, readable)
- Arabic: Cairo (designed for Arabic script, highly legible)
Logo Concept:
- Abstract open book with stylized Arabic letter "Ω" (Qaf)
- Gradient from Ink Blue to Emerald Green
- Rounded square app icon
- Framework: Flutter 3.2+
- Language: Dart
- State Management: Riverpod
- Navigation: GoRouter
- Local Storage: Hive
- Internationalization: flutter_localizations + intl
- UI Components: Material 3
lib/
βββ main.dart # App entry point
βββ core/ # Core functionality
β βββ theme/ # Colors, typography, themes
β βββ routing/ # GoRouter configuration
β βββ localization/ # i18n setup
β βββ constants/ # App-wide constants
β βββ di/ # Dependency injection (Riverpod providers)
βββ features/ # Feature modules
β βββ onboarding/ # Onboarding flow
β βββ auth/ # Authentication (placeholder)
β βββ library/ # Document library/home
β βββ document_viewer/ # PDF viewer + AI dock
β βββ search/ # Document search
β βββ ai_chat/ # Chat with document
β βββ conversion/ # Format conversion tools
β βββ billing/ # Subscription & paywall
β βββ settings/ # App settings
βββ domain/ # Business logic layer
β βββ entities/ # Core data models
β βββ usecases/ # Business use cases
βββ data/ # Data layer
β βββ models/ # Data transfer objects
β βββ repositories/ # Data repositories
β βββ services/ # External services (AI, OCR, etc.)
βββ widgets/ # Shared UI components
- Separation of Concerns: UI, business logic, and data are separated
- Dependency Rule: Inner layers don't depend on outer layers
- Testability: Each layer can be tested independently
- Scalability: Easy to add new features or modify existing ones
- 5 documents
- 150 pages/month
- 10 AI questions/day
- 5 conversions/month
- Basic summaries
Most Popular
- 100 documents
- 2,000 pages/month
- 50 AI questions/day
- 100 conversions/month
- All summary modes
- Priority AI queue
- No ads
- Multi-document chat
Best Value
- 1,000 documents
- 10,000 pages/month
- 200 AI questions/day
- Unlimited conversions
- All Subscriber features
- Advanced AI tools
- Auto-outline generator
- Study flashcards
- Priority support
- Flutter SDK 3.2 or higher
- Dart SDK 3.0 or higher
- iOS: Xcode 14+ (for iOS development)
- Android: Android Studio (for Android development)
-
Clone the repository
git clone https://github.com/your-org/qari2-reader-app.git cd qari2-reader-app -
Install dependencies
flutter pub get
-
Generate code (for Hive, Riverpod, JSON serialization)
flutter pub run build_runner build --delete-conflicting-outputs
-
Add font assets
Download and add these fonts to
assets/fonts/:- Cairo (Arabic): Regular, Bold, SemiBold, Light
- Poppins (Latin): Regular, Bold, SemiBold, Light
-
Add logo asset
Place the app logo at
assets/logo/qari2_logo.png -
Run the app
# Run on connected device/emulator flutter run # Run on specific device flutter devices flutter run -d <device-id> # Run in release mode flutter run --release
- Fonts added to
assets/fonts/ - Logo added to
assets/logo/ - Build runner executed
- Device/emulator connected
- App runs without errors
The app is currently configured with mock services for development. To connect to real backends:
-
Backend API Configuration
- Update
lib/data/services/with real API endpoints - Configure authentication tokens
- Set up environment variables for API keys
- Update
-
AI Service Integration
- Replace
MockDocumentAiServicewith actual AI backend - Options: OpenAI API, Anthropic API, custom LLM backend
- Configure document embedding generation
- Set up vector database for semantic search
- Replace
-
Payment Integration
- iOS: Configure StoreKit and add in-app purchase products
- Android: Configure Google Play Billing
- Or use RevenueCat for unified subscription management
- English (en)
- Arabic (ar) with full RTL support
-
Edit ARB files:
assets/l10n/intl_en.arbassets/l10n/intl_ar.arb
-
Add new keys following the pattern:
{ "keyName": "Translation text", "@keyName": { "description": "Description for translators" } } -
Use in code:
Text(AppLocalizations.of(context)!.keyName)
Arabic layout is automatically applied when the language is set to Arabic. The app uses Directionality widget to handle RTL.
- File:
lib/features/library/library_screen.dart - Import PDFs, Word docs, and images
- Organize with tags and favorites
- Filter by starred, recent, or tags
- Search documents by title
- File:
lib/features/document_viewer/document_viewer_screen.dart - PDF rendering (currently mocked, integrate with Syncfusion or PDFView)
- Page navigation and zoom controls
- Dark mode for reading
- AI Dock overlay for AI features
- File:
lib/features/document_viewer/widgets/ai_dock.dart - Three tabs: Summary, Ask, Search
- Generate short or detailed summaries
- Section-specific summaries
- Copy to clipboard functionality
- Chat interface with document
- Contextual Q&A
- Source page references
- Semantic search (concept-based, not keyword)
- Results with page numbers and relevance scores
- Navigate to search results
- File:
lib/features/billing/paywall_screen.dart - Display all three plans
- Feature comparison table
- Upgrade/downgrade functionality
- Usage limit enforcement
- File:
lib/features/settings/settings_screen.dart - Language selection (EN/AR)
- Theme mode (Light/Dark/System)
- Account management
- Subscription management
- About and legal links
-
User (
lib/domain/entities/user.dart)- User profile and authentication data
- Current subscription plan
- Account creation date
-
Document (
lib/domain/entities/document.dart)- Document metadata
- File path and type
- Tags, favorites, AI processing status
-
SubscriptionPlan (
lib/domain/entities/subscription_plan.dart)- Plan details (Free/Subscriber/Pro)
- Pricing and limits
- Feature lists
-
UsageStats (
lib/domain/entities/usage_stats.dart)- User's monthly/daily usage
- Documents imported, pages processed
- AI questions asked, conversions used
-
AI Entities
AiSummaryResult: Summary outputAiSearchHit: Search resultAiChatMessage: Chat message in conversation
# Run all tests
flutter test
# Run with coverage
flutter test --coverage
# Run specific test file
flutter test test/unit/services/ai_service_test.dart- Unit Tests: Services, repositories, use cases
- Widget Tests: Individual UI components
- Integration Tests: Complete user flows
- Golden Tests: UI consistency across platforms
- Mock authentication
- Local storage with Hive (unencrypted)
- No API security
- Authentication: Firebase Auth, OAuth, or custom JWT
- Data Encryption: Encrypt Hive boxes with
hive_flutterencryption - API Security: HTTPS, API keys, token refresh
- File Security: Secure file storage, access control
- Payment Security: Use official IAP libraries, validate receipts server-side
This is a proof-of-concept MVP with mock services. The following features are mocked and need real implementation:
- Real PDF viewer (using placeholder)
- Actual AI backend integration
- OCR service
- Document conversion services
- File upload/download
- User authentication
- Payment processing
- Cloud sync
- Push notifications
- Complete UI for all screens
- Navigation and routing
- Theme system (light/dark)
- Localization (EN/AR with RTL)
- Document library UI
- AI Dock interface
- Subscription plan screens
- Settings
- Mock services with realistic behavior
-
Integrate Real PDF Viewer
dependencies: syncfusion_flutter_pdfviewer: ^24.1.41 # or flutter_pdfview: ^1.3.2
-
Connect AI Backend
- Set up backend API (FastAPI, Node.js, etc.)
- Implement document embedding generation
- Integrate LLM for Q&A and summaries
- Set up vector database (Pinecone, Weaviate, Qdrant)
-
Implement File Handling
dependencies: file_picker: ^6.1.1 image_picker: ^1.0.5 path_provider: ^2.1.1
-
Add Real Authentication
dependencies: firebase_auth: ^4.15.0 # or custom auth solution
-
Integrate Payments
dependencies: in_app_purchase: ^3.1.11 # or revenue_cat: ^6.0.0
Endpoint Structure (Example)
POST /api/v1/documents/{docId}/process
POST /api/v1/documents/{docId}/summarize
POST /api/v1/documents/{docId}/search
POST /api/v1/documents/{docId}/chat
Replace Mock Implementation
In lib/data/services/document_ai_service.dart, replace the mock methods:
@override
Future<AiSummaryResult> summarizeDocument(
Document doc,
SummaryMode mode,
) async {
final response = await http.post(
Uri.parse('$baseUrl/documents/${doc.id}/summarize'),
headers: {'Authorization': 'Bearer $token'},
body: jsonEncode({'mode': mode.name}),
);
// Parse and return
return AiSummaryResult.fromJson(jsonDecode(response.body));
}Recommended Libraries
- PDF to Text:
pdf_text,syncfusion_flutter_pdf - OCR: Google ML Kit, Tesseract
- Image to PDF:
image+pdfpackages
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Effective Dart
- Use
flutter formatbefore committing - Add comments for complex logic
- Write unit tests for new features
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or feature requests:
- Email: support@qari2.app (placeholder)
- GitHub Issues: Create an issue
- Documentation: This README and in-code comments
- Flutter team for the amazing framework
- Google Fonts for Cairo and Poppins typefaces
- All open-source contributors whose packages made this possible
- UI/UX design and implementation
- Mock services
- Local document management
- Subscription model design
- Real authentication system
- Cloud document storage
- AI backend integration
- Payment gateway setup
- Offline AI features (on-device models)
- Collaborative document reading
- Advanced study tools (flashcards, quizzes)
- Desktop companion app
- Multi-device sync
- Team/organization accounts
- API for third-party integrations
- White-label solution
Built with β€οΈ for Arabic readers everywhere
Ψ¨ΩΩΩ Ψ¨ΨΨ¨ ΩΩΩΨ±Ψ§Ψ‘ Ψ§ΩΨΉΨ±Ψ¨ ΩΩ ΩΩ Ω ΩΨ§Ω