How ulp-ugd/moviltpi works
Project Type and Main Purpose
• MovilTPI is a mobile Android application.
• Its main functions include user authentication, creating and viewing posts, commenting, real-time chatting, and managing images.
• The application leverages Parse Server (hosted on Back4App) for backend services such as data storage, user authentication, and push notifications.
Main Components
• Frontend – Android App:
• UI Layer: Activities (e.g., MainActivity, HomeActivity, PostActivity), Fragments (e.g., ChatFragment, HomeFragment, PerfilFragment)
• Presentation Layer: ViewModels (e.g., AuthViewModel, ChatViewModel, PostViewModel, RegisterViewModel) that follow an MVVM design pattern.
• Domain/Model Layer: Data models in the "models" package (e.g., Post, User, Comentario, Mensaje)
• Utility and Core Services: Classes in the "core/utils" folder (e.g., ImageUtils, Validaciones, EfectoTransformer) and MyApplication for global configuration (including Parse initialization).
• Backend – External Services:
• Parse Server (Back4App) for:
• Data management (using Parse Database for posts, users, comments, messages).
• Authentication services.
• Real-time data updates and push notifications, with Cloud Code handling before-save events.
• Third-party image libraries (Picasso, Glide) and UI libraries (Material Components, ShapeOfView).
Relationships and Interactions
• User Interaction:
• A user starts at the authentication screens (Login/Register) which interface with AuthViewModel and AuthProvider.
• After authentication, navigation occurs to various feature screens where the UI (consisting of Activities and Fragments) communicates with their respective ViewModels.
• Data Flow:
• The application’s ViewModels call Provider classes (like ChatProvider, PostProvider) to interact with the Parse Server.
• Data from the backend is received, parsed into model objects, and used by the ViewModels to update the UI.
• Real-time Chat Integration:
• Chat components use Parse LiveQuery (or fallback polling) to update conversations in real time.
• Cloud Code on Back4App sends push notifications to alert users of new messages.
• Image Handling:
• ImageAdapters along with third-party libraries manage the display and caching of images for posts and profiles.
Architectural Patterns and Components
• MVVM Pattern: Separate concerns between the UI (Activities/Fragments), the business logic (ViewModels), and data/model layers.
• Separation of Concerns:
• The “core” package contains base classes, initialization logic (MyApplication), and utility functions.
• The “features” package organizes code by functionality (auth, chat, posts, users) which encapsulates:
• UI code (Activities, Fragments, Layouts)
• ViewModels for business logic
• Providers for handling the connection with Parse backend.
• External Service Integration: Clearly show the connection to Parse Server via network calls and real-time updates (with Cloud Code and push notifications).
Elements
• Labels: Clearly label sections such as “Authentication”, “Posts”, “Chat”, “User Profiles”, “Image Management” and “External Parse Server”.
• Distinguishing Components: