How rashidsadeed/kitadostu works
Project type and purpose
• This is a cross‑platform mobile application built with Flutter (“Kitap Dostu”).
• Purpose: allow book lovers to list books for sale/donation and search for second readers by geolocation.
File structure
• Top‑level “android” and “ios” folders hold the native wrappers, build files, and configuration (google‑services.json/Info.plist).
• “lib/” is the Dart code:
• main.dart – app entry point
• models/ – domain entities (Book, User)
• providers/ – state‑management classes (AuthProvider, BookProvider)
• services/ – business logic & Firebase access (AuthService, BookService)
• screens/ – UI pages (login, signup, splash, book listing, details, profile, wishlist, home)
• widgets/ – reusable UI components (BookCard, CustomButton)
• Firebase setup: firebase_options.dart, firebase.json
• Assets: app logo, screenshots
Architectural patterns
• Flutter + Provider = a light MVVM (View ←→ ViewModel(provider) ←→ Model(Service/Repository))
• Services wrap Firebase Auth and Firestore calls
• Providers expose service methods & hold UI state
• Screens and widgets consume providers for reactive updates
Main components
• Mobile Device (Android / iOS)
– Flutter Engine
· UI Layer: Screens & Widgets
· State Layer: Providers (AuthProvider, BookProvider)
· Service Layer: AuthService, BookService
– Platform Channels (native wrappers)
· Android (gradle, Manifest, google‑services.json)
· iOS (Xcode project, Info.plist, GoogleService‑Info.plist)
• External Backend
– Firebase Authentication
– Firebase Firestore
· “users” collection
· “books” collection
• Optional External APIs
– Geolocation / Maps API (for location‑based search)
Relationships & data flow
1. User interacts with UI (Screen → Widget)
2. Widget invokes Provider API (e.g., BookProvider.addBook())
3. Provider calls Service (BookService)
4. Service uses Firebase SDK to read/write Firestore or Auth
5. Firebase returns data/result → Service → Provider → UI
Architectural patterns & principles
• Separation of concerns (UI vs. state vs. data)
• Single Responsibility (each provider/service handles one domain)
• Reactive data flow via ChangeNotifier/Stream
Technologies & frameworks
• Flutter & Dart
• Provider (state management)
• Firebase Auth, Firestore
• Gradle (Android), Xcode (iOS)