GePP — Modernizing the GST E-Invoice Preparation & Printing System
Teqani Blogs
Writer at Teqani
GePP - Modernizing the GST E-Invoice Preparation & Printing System A Case Study on Migrating a Government Legacy App to Flutter 3.24 + Dart 3.9 (Null Safety). This article explains the modernization of the GePP (GST E-Invoice Preparation & Printing System), a critical tool for generating and printing e-Invoices aligned with India’s GSTN standards, using Flutter 3.24 and Dart 3.9.
Originally built with older technologies and desktop dependencies, the goal of this modernization was to create a cross-platform, secure, and responsive application that runs seamlessly on:
- Web
- Android / iOS
Objective
Re-engineer the legacy GePP desktop system into a unified, maintainable Flutter application—secure, offline-ready, and optimized for multi-platform deployment. Key outcomes:
- Modern Tech Stack: Migrate to Flutter 3.24 (Dart 3.9 Null Safety)
- Data Security: Encrypted local caching using Flutter Secure Storage
- Offline Support: Integrated Hive DB for caching & quick sync
- State Management: Provider → BLoC pattern migration for scalable logic
- Reports & Printing: Custom PDF templates using pdf + printing package
- Modular Code Base: Repository pattern + Dependency injection with GetIt
- User Experience: Animated transitions using flutter_animate
Tech Stack
- Layer: Technology, Framework
- Flutter: Flutter 3.24 (Dart 3.9 — Null Safety)
- State Management: Provider + BLoC
- Local DB: Hive
- Storage: Flutter Secure Storage
- Dependency Injection: GetIt
- Networking: HTTP Client + Interceptor
- Printing: PDF / Printing Plugin
- UI/UX: Material 3 + Custom Theme (Adaptive Light/Dark)
- Platform Targets: Android • iOS • Web
Architecture
A clean-architecture approach ensures scalability and testability.
lib/
├── core/
│ ├── theme/
│ ├── utils/
│ └── services/
├── data/
│ ├── datasources/
│ │ ├── remote/
│ │ └── local/
│ ├── repositories/
│ └── models/
├── presentation/
│ ├── blocs/
│ ├── screens/
│ └── widgets/
└── main.dart
Each layer communicates through abstract repositories, separating logic from UI.
Implementation Highlights
- Authentication Flow (BLoC): Implemented AuthBloc for managing login, OTP verify, resendOTP, and logout. Used event-state pattern for predictable transitions. Integrated secure storage to persist tokens offline.
- Dependency Injection with GetIt: This pattern eliminates tight coupling and improves testability.
- Dynamic PDF Generation: Invoices and student verification certificates are generated using the pdf + printing package.
- Offline Sync with Hive: Data such as user profiles, reports, and cached invoices are persisted locally. Offline-first design ensures the app remains usable during poor connectivity.
- UI & Theming: Implemented adaptive theming through a centralized AppTheme class. Each module (Login, Dashboard, Verification, Reports) adheres to Flutter’s responsive design for tablet and mobile layouts.
- Dashboard & Reporting: Visual summary of invoices generated, verified, and printed CSV export of queued logs for audit Backend link launcher to open trace IDs directly in Sentry or ELK dashboard Real-time performance snapshots (FPS + memory stats)
- Security & Audit: FeatureImplementationSecure StorageFlutter Secure Storage + AES EncryptionSensitive Data ProtectionHTTPs only + JWT Token AuthError LoggingCustom ErrorLogger wrapper with Trace IDsAccess ControlRole-based Auth + Offline Session Expiry
Each network call carries a Trace ID, allowing backend-to-frontend log correlation during debugging.
Performance Optimization
- Lazy loading for reports and student lists
- Deferred widgets for large screens
- Image compression for face matching module
- Reduced build repaints using ValueListenableBuilder
Key Challenges & Solutions
- Challenge: Migrating legacy code
- Solution: Complete rewrite in Dart 3.9 (Null Safety)
- Challenge: Offline storage consistency
- Solution: Hive DB + secure sync service
- Challenge: Theme and routing conflicts
- Solution: Centralized ThemeBloc + RouteGenerator
- Challenge: Dynamic PDF layouts
- Solution: Modular template system using pdf widgets
- Challenge: Integration with external GST APIs
- Solution: Async HTTP wrapper + error retries
Outcome
- ✅ Unified Flutter codebase
- ✅ 40 % faster load times (compared to legacy app)
- ✅ Simplified deployment via single CI/CD pipeline
- ✅ Consistent look & feel across web and mobile
- ✅ Secure offline operation for field officers
Next Enhancements
- Integration with real GST IRP APIs for direct IRN fetching
- Push notifications for IRN status updates
- Multi-tenant support for district-level offices
- Automated analytics dashboards in Firebase/ELK
All blogs are certified by our company and reviewed by our specialists
Issue Number: #e5002488-4a28-41b7-8eb9-7a5f9d338f38