A modern Android blogging platform built with Jetpack Compose, Firebase, and MVVM architecture.
app/
โโโ src/
โ โโโ main/
โ โ โโโ java/com/blogapp/
โ โ โ โโโ BlogApplication.kt
โ โ โ โโโ di/
โ โ โ โ โโโ AppModule.kt
โ โ โ โ โโโ FirebaseModule.kt
โ โ โ โโโ data/
โ โ โ โ โโโ model/
โ โ โ โ โ โโโ User.kt
โ โ โ โ โ โโโ BlogPost.kt
โ โ โ โ โ โโโ Like.kt
โ โ โ โ โ โโโ Favorite.kt
โ โ โ โ โโโ repository/
โ โ โ โ โ โโโ AuthRepository.kt
โ โ โ โ โ โโโ BlogRepository.kt
โ โ โ โ โ โโโ UserRepository.kt
โ โ โ โ โโโ remote/
โ โ โ โ โโโ FirebaseService.kt
โ โ โ โโโ ui/
โ โ โ โ โโโ MainActivity.kt
โ โ โ โ โโโ navigation/
โ โ โ โ โ โโโ NavGraph.kt
โ โ โ โ โโโ theme/
โ โ โ โ โ โโโ Color.kt
โ โ โ โ โ โโโ Theme.kt
โ โ โ โ โ โโโ Type.kt
โ โ โ โ โโโ screens/
โ โ โ โ โ โโโ auth/
โ โ โ โ โ โ โโโ LoginScreen.kt
โ โ โ โ โ โ โโโ SignUpScreen.kt
โ โ โ โ โ โ โโโ AuthViewModel.kt
โ โ โ โ โ โโโ home/
โ โ โ โ โ โ โโโ HomeScreen.kt
โ โ โ โ โ โ โโโ HomeViewModel.kt
โ โ โ โ โ โโโ create/
โ โ โ โ โ โ โโโ CreatePostScreen.kt
โ โ โ โ โ โ โโโ CreatePostViewModel.kt
โ โ โ โ โ โโโ detail/
โ โ โ โ โ โ โโโ PostDetailScreen.kt
โ โ โ โ โ โ โโโ PostDetailViewModel.kt
โ โ โ โ โ โโโ profile/
โ โ โ โ โ โ โโโ ProfileScreen.kt
โ โ โ โ โ โ โโโ ProfileViewModel.kt
โ โ โ โ โ โโโ favorites/
โ โ โ โ โ โโโ FavoritesScreen.kt
โ โ โ โ โ โโโ FavoritesViewModel.kt
โ โ โ โ โโโ components/
โ โ โ โ โโโ BlogPostCard.kt
โ โ โ โ โโโ MarkdownEditor.kt
โ โ โ โ โโโ LoadingIndicator.kt
โ โ โ โโโ util/
โ โ โ โโโ Constants.kt
โ โ โ โโโ Resource.kt
โ โ โ โโโ MarkdownRenderer.kt
โ โ โโโ res/
โ โ โโโ values/
โ โ โ โโโ strings.xml
โ โ โ โโโ themes.xml
โ โ โโโ drawable/
โ โโโ build.gradle.kts
โโโ build.gradle.kts
โโโ google-services.json
โ User Authentication (Firebase Auth)
- Email/password sign-up
- Email/password login
- Password reset
- Session persistence
โ Blog Post Management
- Create posts with title, content, images
- Edit existing posts
- Delete posts
- Markdown support for rich text
- Draft saving
- Publish/unpublish functionality
โ Blog Feed & Discovery
- Recent posts display
- Category filtering
- Search functionality
- Pull-to-refresh
- Post previews
โ Blog Interaction
- View full posts
- Like/unlike posts
- Favorite/unfavorite posts
- View liked/favorited posts
- Like count display
โ Data Management
- Firestore integration
- Real-time updates
- Offline support
โ Architecture
- MVVM pattern
- Jetpack Compose UI
- Hilt dependency injection
๐ Comment System ๐ Push Notifications ๐ Dark Mode ๐ Share Functionality ๐ Reading Time Estimate
- Language: Kotlin
- UI Framework: Jetpack Compose
- Architecture: MVVM
- Dependency Injection: Hilt
- Authentication: Firebase Auth
- Database: Cloud Firestore
- Storage: Firebase Storage
- Markdown: Markwon
- Image Loading: Coil
- Async: Coroutines & Flow
// Firebase
implementation(platform("com.google.firebase:firebase-bom:32.7.0"))
implementation("com.google.firebase:firebase-auth-ktx")
implementation("com.google.firebase:firebase-firestore-ktx")
implementation("com.google.firebase:firebase-storage-ktx")
// Jetpack Compose
implementation("androidx.compose.ui:ui:1.5.4")
implementation("androidx.compose.material3:material3:1.1.2")
implementation("androidx.navigation:navigation-compose:2.7.5")
// Hilt
implementation("com.google.dagger:hilt-android:2.48")
kapt("com.google.dagger:hilt-compiler:2.48")
implementation("androidx.hilt:hilt-navigation-compose:1.1.0")
// Markdown
implementation("io.noties.markwon:core:4.6.2")
implementation("io.noties.markwon:editor:4.6.2")
// Coil for image loading
implementation("io.coil-kt:coil-compose:2.5.0")- Android Studio Hedgehog or later
- JDK 17 or later
- Android SDK 24+
- Create a Firebase project at Firebase Console
- Add an Android app to your Firebase project
- Download
google-services.jsonand place it inapp/directory - Enable Email/Password authentication in Firebase Console
- Create a Firestore database
- Set up Firebase Storage
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth.uid == userId;
}
match /posts/{postId} {
allow read: if resource.data.isPublished == true || request.auth.uid == resource.data.authorId;
allow create: if request.auth != null;
allow update, delete: if request.auth.uid == resource.data.authorId;
}
match /likes/{likeId} {
allow read: if request.auth != null;
allow create, delete: if request.auth.uid == request.resource.data.userId;
}
match /favorites/{favoriteId} {
allow read: if request.auth != null;
allow create, delete: if request.auth.uid == request.resource.data.userId;
}
}
}# Clone the repository
git clone https://github.com/yourusername/blogapp.git
# Open in Android Studio
# Sync Gradle files
# Run on emulator or device- Login Screen
- Sign Up Screen
- Password Reset
- Home Feed with blog posts
- Create/Edit Post Screen
- Post Detail View
- User Profile
- Favorites Collection
View (Composables) โ ViewModel โ Repository โ Data Source (Firebase)
- User interacts with UI (View)
- View calls ViewModel methods
- ViewModel calls Repository methods
- Repository interacts with Firebase
- Data flows back through LiveData/StateFlow
- UI updates automatically
data class User(
val userId: String = "",
val email: String = "",
val displayName: String = "",
val profileImageUrl: String = "",
val createdAt: Timestamp = Timestamp.now(),
val updatedAt: Timestamp = Timestamp.now()
)data class BlogPost(
val postId: String = "",
val authorId: String = "",
val authorName: String = "",
val title: String = "",
val content: String = "",
val excerpt: String = "",
val imageUrl: String = "",
val categories: List<String> = emptyList(),
val tags: List<String> = emptyList(),
val likeCount: Int = 0,
val isPublished: Boolean = false,
val createdAt: Timestamp = Timestamp.now(),
val updatedAt: Timestamp = Timestamp.now()
)- Image upload may take time on slow connections
- Markdown preview updates with slight delay
- Search is case-sensitive
- Offline mode with sync
- Rich media embeds (YouTube, Twitter)
- Multi-language support
- Advanced analytics
- Social sharing improvements
MIT License
Your Name - GitHub
For issues and questions, please open an issue on GitHub.