How dxavsoul/barberdule works
Main Components
• Frontend (Flutter UI): Represented by the lib/presentation directory which contains screens (e.g., login, registration, home, barber-specific screens, customer-specific screens) and widgets. This component includes separate views for different user roles (barbers, barbershops, customers, and admin).
• Business Logic Layer (BLoC): Found under lib/logic/blocs. This layer manages state transitions, event handling, and business rules using distinct blocs for authentication, registration, appointment scheduling, profile management, map integration, and service management.
• Data Layer: Located in lib/data, it includes models (e.g., appointment, barber, customer, service), repositories (for auth, appointment, etc.), and constants. This encapsulates API calls and any Firebase interactions.
• Platform-Specific Configurations: Separate native code bases are in android, ios, and web directories. They include configuration files (Gradle, Xcode project files) for deploying the app on different platforms.
• Firebase Backend: While not physically present in the file structure, the project integrates Firebase (e.g., via lib/firebase_options.dart) to handle authentication, real-time data sync, and possibly cloud functions. Represent this as an external service.
Relationships and Interactions
• The UI components (presentation layer) send user events to the BLoC components.
• BLoCs process these events and rely on the Data Layer (via repositories) to fetch or update data.
• The data repositories interact with Firebase (and any RESTful APIs if applicable) to persist and retrieve information.
• Data flows from Firebase into repositories then propagate up through the BLoC layer to update UI components.
Technologies and Frameworks
• Flutter is the primary framework, serving as the cross-platform UI solution.
• Firebase provides backend services (e.g., authentication, real-time database or Firestore).
• The BLoC pattern is pivotal for state management.
• Native configurations for Android, iOS, and Web emphasize the multi-platform nature of the application.