How yerass11/umitapp works
Project type and high-level purpose
• UMitApp is a full-stack iOS mobile application (SwiftUI + UIKit)
• Purpose: allow users to register, book doctor appointments, order medicines (with Stripe payments), and chat with medical professionals.
• Architecture: MVVM on the client; Django REST + Firebase + Stripe on the server side.
Main components
A. Mobile Client (iOS App)
1. UI Layer
– SwiftUI Views (ContentView, Feature Views in Features/…)
– UIKit integrations where needed
2. Presentation Layer (MVVM)
– ViewModels in each feature (e.g. DoctorsViewModel, ChatViewModel, PaymentViewModel)
3. Service/Network Layer
– Core services: UserService, AppointmentService, DoctorService, HospitalService, DocumentService
– Feature services: ChatService (WebSocketManager), MedicineOrderService, AuthService
4. Core Modules
– CustomTabBar, CustomTextField, other reusable components
B. Backend Services
1. Django REST Framework API
– Endpoints for users, appointments, doctors, hospitals, documents, reviews, pharmacy orders
– Business logic, authentication hooks (JWT if used alongside Firebase)
– PostgreSQL (or other) database
2. Firebase
– Authentication (Email/Apple ID/Social)
– Real-time Database or Firestore for chat messages & notifications
– Cloud Messaging for push notifications
– Storage (if any media is stored)
3. Stripe
– Stripe iOS SDK integration on client
– Stripe webhooks on backend for payment confirmation
Relationships and data flows
• UI → ViewModel: two-way binding (SwiftUI @StateObject/@Published)
• ViewModel → Service: method calls for network actions
• Service → Django API: REST over HTTPS (JSON)
• Service → Firebase SDK: Auth calls, Database/Firestore reads & writes, Messaging subscriptions
• Service → Stripe SDK: payment token generation → backend → webhook → update order status
• ChatService → WebSocketManager: persistent socket connection to chat endpoint (could be Django Channels or Firebase RT-DB)
• Push Notifications: Django or Firebase Cloud Functions → FCM → device
Architectural patterns & design principles
– MVVM: clear separation of Views, ViewModels, and Services
– Modular “Features” directory: each feature encapsulates its models, views, and services
– Core reusable modules in Core/ (TabBar, TextField)
– Dependency injection of services into view models (via initializers or environment objects)
– Single source of truth for network configuration (base URL, headers)