How surajpatel24-r/transfer_certificate_generator works
Project Type and Purpose
• This is a cross-platform Flutter mobile/desktop/web application whose sole purpose is to allow college staff to enter student data, persist or sync it (via Google Sheets), then generate and export a PDF transfer certificate and an Excel summary.
Main Architectural Layers & Components
a. Presentation Layer (Flutter UI)
– lib/screens: individual screens (Home, Forms, About, Faculty-specific screens)
– lib/main.dart: entry point and MaterialApp/router setup
b. Domain/Logic Layer
– lib/service/data_controller.dart: orchestrates data operations (CRUD, generate exports)
– lib/models: domain entities (Student, User)
c. Data Layer
– lib/service/data_store.dart: local in-memory or on-device caching logic
– lib/api/sheets/tc_sheets_api.dart: integration with Google Sheets REST API (read/write)
d. Template/Export Layer
– lib/templates/template_*.dart: PDF certificate templates, layout logic
– (You likely use packages such as pdf or excel)
e. Platform Embedder & Runtime
– android/, ios/, linux/, macos/, windows/, web/: Flutter engine integration & native launchers
– Pubspec.yaml / build scripts: dependency and build configuration
External Services & Outputs
• Local File System:
– PDF certificate files (.pdf)
– Excel workbook (.xlsx)
Data Flow & Component Interactions
1. User taps “New Certificate” in Flutter UI
2. UI invokes DataController.createCertificate(studentData)
3. DataController:
• Validates and updates Student model
• Calls DataStore.saveLocal(...) to cache data (optional)
• Calls SheetsAPI.upsertRecord(...) to sync with Google Sheets
4. Upon success, DataController invokes TemplateEngine.generatePDF(...)
5. PDF file written to Local File System
6. DataController invokes TemplateEngine.generateExcelReport(allRecords)
7. Excel file written to Local File System
8. UI displays share/preview options
Architectural Patterns & Principles
• Layered (Clean) Architecture: clear separation between UI, business logic, data, and external integrations
• Dependency Flow: UI depends on Controller → Controller depends on Data & Template modules → Data modules depend on external service interfaces
• Single Responsibility: each folder (api, service, templates, models) contains cohesive code
• Cross-platform Embedding: native host layers (Android/iOS/etc.) only handle app initialization