Udayam-Trial-Balance-App
Open source software development project.
Technology Stack
Udayam Trial Balance App
Flutter mobile application for viewing trial balance reports from multiple companies.
Security Note: This README uses example values. Replace all placeholders with your actual API endpoints and credentials. Never commit actual secrets or production URLs to version control.
Prerequisites
- Install Flutter: Follow instructions at https://flutter.dev/docs/get-started/install
- Backend API: Deployed on AWS Lambda (see
../trial_balance_api/README.md)
Setup
- Install dependencies:
flutter pub get
-
Add app icon: Place your app icon at
assets/icon/app_icon.png(1024x1024 recommended) -
Configure API endpoint: Update
lib/services/api_service.dartwith your API URL:
baseUrl = 'https://your-api-id.execute-api.region.amazonaws.com'
For local development:
- Android emulator:
http://10.0.2.2:8000 - iOS simulator:
http://localhost:8000 - Physical device:
http://YOUR_COMPUTER_IP:8000
Running the App
# Check connected devices
flutter devices
# Run on connected device
flutter run
# Run in debug mode with hot reload
flutter run --debug
# Build release APK (Android)
flutter build apk --release
# Build iOS app
flutter build ios --release
Features
- ✅ User authentication with JWT tokens
- ✅ Persistent auto-login with secure token storage
- ✅ Multi-company selection
- ✅ Date range picker with presets
- ✅ Trial balance report view
- ✅ Daily sales reports with detailed breakdowns
- ✅ Sales detail view with customer information
- ✅ Manager and salesman contact integration with phone dialing
- ✅ PDF invoice generation and WhatsApp sharing
- ✅ Expandable company reports
- ✅ Pull-to-refresh functionality
- ✅ Formatted currency display
- ✅ User-friendly error handling
- ✅ Network connectivity detection
- ✅ Responsive design with animations
- ✅ Production-ready with AWS integration
- ✅ Comprehensive reusable utility functions
Project Structure
lib/
├── main.dart # App entry point
├── models/ # Data models
│ ├── company.dart
│ ├── trial_balance.dart
│ ├── daily_sales_summary.dart
│ └── sales_detail.dart
├── services/ # API & storage services
│ ├── api_service.dart
│ ├── auth_interceptor.dart
│ ├── storage_service.dart
│ ├── connectivity_service.dart
│ ├── export_services.dart
│ └── token_refresh_service.dart
├── providers/ # State management (Riverpod)
│ ├── auth_provider.dart
│ ├── company_provider.dart
│ ├── trial_balance_provider.dart
│ ├── daily_sales_provider.dart
│ └── sales_detail_provider.dart
├── screens/ # UI screens
│ ├── splash_screen.dart
│ ├── login_screen.dart
│ ├── company_selection_screen.dart
│ ├── home_screen.dart
│ ├── trial_balance_screen.dart
│ ├── daily_sales_screen.dart
│ └── sales_detail_screen.dart
├── widgets/ # Reusable widgets
│ ├── trial_balance_table.dart
│ ├── error_snackbar.dart
│ ├── common_widgets.dart # Reusable UI components
│ ├── responsive_container.dart
│ └── comparison_view.dart
└── utils/ # Utilities
├── error_handler.dart
├── responsive_helper.dart
├── phone_utils.dart # Phone call utilities
├── format_utils.dart # Number & date formatting
├── dialog_utils.dart # Dialogs & snackbars
├── pdf_utils.dart # PDF generation
├── share_utils.dart # File & WhatsApp sharing
├── QUICK_REFERENCE.md # Quick utility lookup
├── UTILITY_FUNCTIONS_GUIDE.md # Comprehensive guide
└── EXAMPLE_USAGE.md # Code examples
Utility Functions
The app includes comprehensive utility functions to reduce code duplication:
- PhoneUtils: Make phone calls, format & validate phone numbers
- FormatUtils: Format currency, dates, quantities, profit/loss displays
- DialogUtils: Show loading dialogs, snackbars, confirmation dialogs
- CommonWidgets: Reusable UI components (chips, cards, empty states)
- PdfUtils: Generate professional PDF invoices with styling
- ShareUtils: Share via WhatsApp, email, or generic sharing
📖 Detailed documentation: See lib/utils/QUICK_REFERENCE.md and lib/utils/UTILITY_FUNCTIONS_GUIDE.md
Testing
Login with your configured credentials:
- Email:
your-email@example.com - Password:
your-secure-password
The app includes:
- Auto-login on subsequent launches
- Error handling for network issues
- Offline detection and user feedback
Production Build
Android APK
# Build release APK
flutter build apk --release
# APK location: build/app/outputs/flutter-apk/app-release.apk
iOS App
flutter build ios --release
Before releasing to production:
- Update package name in
android/app/build.gradle - Configure release signing keystore
- Add internet permissions to
AndroidManifest.xml - Update app label to "Udayam TB"
- Generate and set app icon (see
flutter_launcher_iconspackage)
Refer to FLUTTER_PRODUCTION_READINESS_REPORT.md for complete checklist.
Troubleshooting
Can't connect to API:
- Check internet connection
- Verify production API is accessible
- Check error messages for specific issues
Build errors:
- Run
flutter clean - Run
flutter pub get - Check Flutter version:
flutter --version
Token expiration:
- App automatically handles token refresh
- If issues persist, logout and login again
Documentation
- Utility Functions Quick Reference - Quick lookup for all utilities
- Utility Functions Guide - Comprehensive guide with examples
- Utility Usage Examples - Code examples for all utilities
- AWS Security Guide - AWS Secrets Manager setup
- Production Readiness Report - Pre-release checklist
- Secrets List - AWS secrets configuration
Privacy Policy
This repository hosts the privacy policy for the Udayam Trial Balance mobile application.
📄 View the Privacy Policy
- privacy_policy.md
🌐 How to Publish on GitHub Pages
- Fork or clone this repository.
- Make sure
privacy_policy.mdis in the root or/docsfolder. - Go to Settings > Pages in your GitHub repository.
- Set the source branch (e.g.,
main) and folder (root or/docs). - After a few minutes, your policy will be live at:
https://<your-github-username>.github.io/<repo-name>/privacy_policy.md
📲 Use in App Store / Play Store
- Copy the public URL and paste it in the Privacy Policy field of your app listing.
For questions, contact: your@email.com