How isaacpater31/pyp_platform works
Project Type and Purpose
• This is a full-stack, cross-platform mobile application (Android, iOS, Web, Desktop) built with Flutter.
• It connects two user roles (Clients and Professionals) through on-demand home services, using Firebase as the backend and various external services (OpenStreetMap, geolocation, payments, chat).
File Structure
• lib/ directory shows a clean-architecture pattern with separation into “controladores” (controllers) and “vistas” (views).
• platform folders (android/, ios/, linux/, macos/, windows/, web/) house native shells generated by Flutter.
• pubspec.yaml declares dependencies on Firebase, geolocator, OpenStreetMap, Flutter Chat UI, etc.
a. Mobile App (Flutter Client)
– UI Layer: views (login_view.dart, client_register_view.dart, etc.)
– Controller/Domain Layer: client_register_controller.dart, negotiation logic, scheduling, chat handler
– Data Layer: service classes that interact with Firebase and external APIs
b. Firebase Backend
– Authentication (Email/Password + Verification)
– Firestore Database (users, service_requests, messages, reviews, schedules, payments)
– Cloud Functions (business logic: negotiation, reminders, safety PIN)
– Storage (profile images, documents)
c. External Services
– OpenStreetMap / Geolocator: for address lookup and real-time location tracking
– Payment Gateway (e.g., Stripe/PayPal) for processing online payments
– Push Notification Service (Firebase Cloud Messaging)
d. Optional Future Component
– Web Admin Dashboard (to be built later)
Relationships and Data Flows
• The Flutter Client UI sends user events to Controllers -> Controllers invoke Data Services.
• Data Services call Firebase Auth for login/registration and Firestore for CRUD operations.
• Cloud Functions enforce business rules (e.g., bargaining, scheduling reminders) and trigger FCM.
• For location: Data Services call Geolocator/OpenStreetMap APIs and feed results back up to UI.
• Payment flows outbound to the Payment Gateway; transaction result is stored in Firestore.
• Chat messages flow bi-directionally via Firestore or a real-time chat service.
Architectural Patterns and Design Principles
• Clean Architecture: clear separation of UI, domain (controllers/use-cases), and data layers.
• Modular Code: controllers and views are grouped by feature (registration, login, chat).
• Reactive Streams or BLoC-style updates (UI observes data layer for real-time updates).
• Single Source of Truth: Firestore as centralized state management for shared data.