How dat0309/manga-project works
Project Type and Purpose
• This is a native Android mobile application (“MangarReader”) whose primary purpose is to let users browse, read, rate, and comment on manga.
• There is no custom backend code in the repo; the app relies on Firebase (Realtime Database, Storage, Auth) and third-party SDKs (Google Sign-In, Facebook Login) for all server-side functionality.
High-Level Architectural Components
a. Android Client
• UI Layer: Activities (in package viewmodel/) + XML layouts + Adapters for RecyclerViews.
• Data Layer: Plain-old-Java model classes (model/) representing BannerManga, Manga, Chapter, User, Rating, etc.
• Utility Layer: AppUtil, BookFlipPageTransformer, plus resource files (drawables, fonts, animations).
• Third-Party Libraries: Glide (image loading), Android-SpinKit (loading indicators), PhotoView/EasyFlipView (image interactions), SpotsDialog, CircleImageView.
b. External Services
• Firebase Auth: user sign-in, Google & Facebook integration.
• Firebase Realtime Database: manga metadata, chapters, comments, ratings.
• Firebase Storage: storing and retrieving chapter images.
• Google Play Services Auth & Facebook SDK: social login flows.
c. Local Resources
• Raw JSON (readabook.json) for offline data or initial seed.
• UI assets (drawables, layouts, strings, themes).
Relationships and Data Flow
1. User opens app → SplashScreen → navigates to LoginAct / RegisterAct.
2. On login/register, Activity invokes Firebase Auth SDK; successful callback returns a FirebaseUser.
3. After auth, Activities (e.g., MangaAct, CategoryAct, FavoriteAct, MangaDetailsAct) query Realtime Database via the Firebase SDK.
4. Data snapshots are mapped into model objects.
5. Adapters (e.g., MangaAdapter, ChapterAdapter, CommentAdapter) bind model data to RecyclerView items.
6. Image URLs are handed to Glide/PhotoView/EasyFlipView to load and render chapter pages.
7. User actions (rating, commenting, favoriting) write back to Realtime Database and/or Storage.
Architectural Patterns and Design Principles
• Layered Architecture:
• Presentation (Activities & Adapters)
• Domain/Data (Model classes + Firebase SDK calls)
• Utility & Resources (common functions, animations)
• Separation of Concerns: UI logic lives in Activities, data-binding in Adapters, raw data definition in Model classes, Firebase interactions isolated to where they are invoked.
Final Checklist
• Separate the system into at least these components: UI, Business Logic, Data Layer, External Services, Local Resources.
• Names of critical libraries and SDKs where they integrate.