How patriciomelor/calendarreserv works
Project Type and Purpose
• This is a full-stack, cross-platform booking application (“AgendApp”) built with Flutter for iOS, Android, Web and Desktop.
• It uses Firebase as its backend (Firestore, Authentication, Cloud Functions, FCM) plus Node.js Cloud Functions for email notifications and business logic.
File Structure Analysis
• Top-level “app_agendamiento” folder contains:
– lib/ : Flutter client code (screens, widgets, services, main.dart)
– android/, ios/, web/, macos/, linux/, windows/ : platform-specific Flutter project files & native configs
– functions/ : Node.js Cloud Functions (index.js, package.json)
– firebase.json, .firebaserc : Firebase hosting and project configuration
• Patterns: a single Flutter client UI layer communicating via Firebase SDKs; a serverless backend layer of Cloud Functions; a NoSQL database layer (Firestore).
README Insights
• Role-based modules: Super-Admin, Salon-Admin, Professional, Client.
• Core flows: salon CRUD, professional/service management, appointment booking, calendar views, anonymous auth, email notifications.
• Technology stack spelled out (Flutter, Dart, JS, Firebase).
a. Main Components
• Client Apps (Flutter UI) – single codebase deployed on mobile, web, desktop
• Authentication Layer – Firebase Auth (email/password + anonymous)
• Database Layer – Firestore (NoSQL collections: salons, professionals, services, appointments, users)
• Business Logic Layer – Cloud Functions (Node.js) for triggers, email notifications, appointment side-effects
• Notification Services – FCM for in-app push; SMTP or third-party via Cloud Functions for email
• External Services – Email provider (e.g., SendGrid, Gmail SMTP) if applicable
b. Relationships and Data Flows
1. User opens Flutter app → Firebase Auth → receives ID token
2. Authenticated client reads/writes Firestore directly for real-time CRUD
3. On write to appointments collection → Firestore trigger → Cloud Function executes → sends email via SMTP/API → posts to FCM
4. Client subscribes to FCM topic → receives push notification
c. Architectural Patterns and Principles
• Client-Server (thin client + serverless backend)
• Event-driven functions (Cloud Functions as triggers on Firestore writes)
• Role-based access control (enforced via Firebase Security Rules and front-end routing)
• Single codebase UI (DRY principle) across platforms
d. Key Technologies/Frameworks
• Flutter / Dart
• Firebase SDKs (Auth, Firestore, Functions, Messaging)
• Node.js (Cloud Functions)
• Native build tools (Gradle, Xcode, CMake for desktop)
Details to Capture
• Role-based modules: indicate which screens or services are used by each role.
• Configuration files (firebase.json, .firebaserc) as part of deployment pipeline.
• Platform-specific build pipelines (Gradle, Xcode, CMake) can be noted on the outer perimeter if relevant.