How dhruva-n-l-choudhary/quit_for_good works
Project Type and Purpose
• This is a full-stack, cross-platform mobile application built with Flutter (Dart) for the front-end and Firebase for the back-end.
• Purpose: Help users quit smoking by tracking progress, facilitating community chat, scheduling doctor appointments, and donating saved cigarette money to charities.
File Structure
• Top-level “android”, “ios”, “linux”, “macos”, “windows”, “web”: Platform-specific embedding of the Flutter app.
• “assets”: Fonts & images used by the UI.
• “lib/” directory:
• controllers/ — business-logic layer (ChatController, DonationController, etc.)
• models/ — data structures (ChatMessage, DonationPaymentModel, etc.)
• services/ — API/data-persistence layer interacting with Firebase (auth_services.dart, data_base_service.dart, db.dart)
• views/ — UI screens organized by feature (login, dashboard, chat, donation, profile, doctor appointments)
• widgets/ — reusable UI components (buttons, input fields, cards, tiles)
• Configuration:
• firebase_options.dart — Firebase project settings
• pubspec.yaml — dependencies (Flutter SDK, Firebase packages)
Insights from README
• Features include Registration/Login, Dashboard, Chat, Profile, Donation, Graphs, Doctor Appointment.
• Back-end: Firebase Authentication, Firestore (or Realtime DB), Cloud Messaging.
• No custom server; all data and messaging flows through Firebase services.
a. Main Components
• Mobile Front-end (Flutter app)
• UI Layer (Views & Widgets)
• Business Logic Layer (Controllers)
• Data Layer (Services & Models)
• Firebase Back-end
• Authentication Service
• Firestore Database
• Cloud Messaging (chat push notifications)
• (Optional) Cloud Functions for payment/email triggers
• External Payment/Donation Gateway (if used)
b. Relationships and Interactions
• UI → invokes Controllers
• Controllers → call Services
• Services ↔ Firebase Auth & Firestore
• Firestore ↔ Controllers (data stream for Dashboard, Chat)
• Cloud Messaging → delivers chat notifications to Flutter app
• Donation flow: Service → Payment Gateway → Service → Firestore
c. Architectural Patterns/Design Principles
• Layered architecture: Presentation → Business Logic → Data Access
• MVC-like separation: Views (UI), Controllers (logic), Models (data)
• Dependency injection (via passing services into controllers)
• Reactive streams: Firestore snapshots update UI automatically
d. Key Technologies/Frameworks
• Flutter (Dart)
• Firebase Auth, Firestore, Cloud Messaging, optionally Cloud Functions
• State management via Controllers (e.g., GetX, Provider, or you may choose another)