How yassirscreed/pharmacist works
Main Components
A. Client-Side (Mobile App)
• UI Layer (Jetpack Compose)
• View Models Layer
• Repository Layer
• Local Database (Room)
• Utils & Helpers
B. Backend Services (Firebase)
• Authentication Service
• Firestore Database
• Firebase Storage
• Real-time Sync Service
┌─ Mobile Application ──────────────────────────────────────┐
• ┌─ UI Layer (Screens) ─────────────────────────┐ │
• Main Screen - Login/Register │ │
• Pharmacy Panel - Medicine Panel │ │
• Search Screens - Location Screens │ │
• ┘ │
• ▲ │
• ┌─ ViewModels ─────────┴────────────────────────┐ │
• PharmaciesViewModel - UserViewModel │ │
• LoginViewModel - RegisterViewModel │ │
• NetworkStateViewModel - PhotoCacheViewModel │ │
• ┘ │
• ▲ │
• ┌─ Repository Layer ────┴────────────────────────┐ │
• MedicineRepository │ │
• PharmacyRepository │ │
• ┘ │
• ▲ ▲ │
• ┌─ Local Cache ───┴─┐ ┌────────┴──────────┐ │
• Room Database │◄─────►│ Network Services │ │
• Medicine Cache │ │ - API Clients │ │
• Pharmacy Cache │ │ - Data Sync │ │
• ┘ └─────────────────────┘ │
• ┘
• ▲
┌─ Firebase Backend ──────┴───────────────────────────┐
• ┌─ Authentication ─┐ ┌─ Firestore DB ─┐ │
• User Management │ │ - Users │ │
• ┘ │ - Pharmacies │ │
• Medicines │ │
• ┌─ Storage ───────┐ └───────────────┘ │
• Photos/Images │ │
• ┘ │
• ┘
Important Relationships to Highlight
a. Data Flow:
• Bi-directional flow between UI and ViewModels
• One-way flow from repositories to ViewModels
• Sync between local cache and backend
b. Dependencies:
• Direct dependencies between components
• Cross-cutting concerns (NetworkStateListener)
Additional Elements
• Notes about offline capabilities
• Critical security paths
• Where resource optimization occurs
Implementation Details
• Use standardized UML notation where applicable
• Component versions/technologies
• Notes about scalability points
• Authentication flow paths