🌐 3.1 High-Level Structure

IMG_4527.jpeg

🧩 3.2 Main Components

GeoGuide follows a layered architecture.

The application is divided into several layers:

  1. Presentation Layer Handles screens, widgets, user interface, and navigation.
  2. State Management Layer Handles user state, places state, loading states, success states, and error states.
  3. Services Layer Handles Firebase operations, HTTP requests, AI APIs, search logic, planner logic, and external services.
  4. Repository Layer Coordinates data access and separates UI from data sources.
  5. Backend and Cloud Layer Includes Firebase Authentication, Firestore, hosted APIs, AI services, and external APIs.

This architecture improves code organization, readability, scalability, and maintainability.

Layer Responsibility
Presentation (lib/presntation/) Screens: onboarding, login/signup, home, places, favorites, profile, settings, chatbot, AI image details, planner sub-screens. Widgets and shared UI pieces.
State management flutter_bloc: UserCubit, PlacesCubit; local StatefulWidget state on complex screens such as Home.
Services (lib/services/) AuthService (Firebase Auth + Google), FirebaseService (Firestore landmarks, users, saved AI images), PlaceRepository, GooglePlacesService, SearchEngine, PlannerService, ChatbotService, LandmarkImageAiService, weather, nearby, image pipeline, etc.
Core (lib/core/) AppConfig (compile-time Gemini key/model via --dart-define), category normalization, shared configuration.
Models (lib/models.dart/) Landmarks, cities, users, chat responses, API DTOs.
Caching shared_preferences via CacheHelper; optional landmark caching helpers.

πŸ”₯ 3.3 Firebase Usage

Firebase is used as the main backend service for GeoGuide.

GeoGuide uses Firebase for: