A modern, full-featured e-commerce Android application built with Jetpack Compose, Firebase, and following Clean Architecture principles with MVVM pattern.
-
User Authentication
- Email/Password registration and login
- Secure Firebase Authentication
- Password validation and error handling
- Session management
-
Product Management
- Upload products with multiple images (minimum 3) "due to some charges of firebase i cant use storage"
- View all products in a scrollable list
- Search products by title, description, or category
- Filter products by category
- Real-time product updates
-
Product Details
- View complete product information
- Image gallery with swipe navigation
- Seller contact information
- Add/Remove from favorites
- Back navigation
-
Favorites System
- Add products to favorites
- Local storage using Room Database
- Persistent across app sessions
- Remove from favorites
- View all saved favorites
-
Upload Products
- Multi-image picker (up to 5 images)
- Image preview with remove option
- Form validation
- Category selection
- Price and description fields
- Upload progress indicator
- Recommended Products - Integrated FakeStore API for product recommendations
- Pull-to-Refresh - Refresh product listings
- Search Functionality - Real-time product search
- Category Filters - Filter by product categories
- Shimmer Loading - Skeleton loading placeholders
- Empty States - User-friendly empty state designs
- Error Handling - Comprehensive error handling with retry options
Presentation Layer (UI)
β
Domain Layer (Use Cases)
β
Data Layer (Repositories)
β
Data Sources (Remote/Local)
- Model: Data classes and business logic
- View: Composable UI components
- ViewModel: UI state management and business logic
- Hilt/Dagger: Provides compile-time dependency injection
- Modular architecture with separate modules for different concerns
- Language: Kotlin 1.9.20
- Minimum SDK: API 24 (Android 7.0)
- Target SDK: API 34 (Android 14)
- Build System: Gradle (Kotlin DSL)
- Jetpack Compose: Modern declarative UI toolkit
- Material Design 3: Latest Material Design components
- Coil: Image loading and caching
- Navigation Compose: Type-safe navigation
- Firebase Authentication: User authentication
- Firebase Firestore: Real-time NoSQL database
- Firebase Storage: Image and file storage
- Room Database: Local SQLite database for favorites
- Retrofit: REST API client
- OkHttp: HTTP client with logging interceptor
- Gson: JSON serialization/deserialization
- Hilt: Dependency injection framework
- Dagger: Compile-time dependency injection
- Kotlin Coroutines: Asynchronous programming
- Kotlin Flow: Reactive data streams
- StateFlow: UI state management
com.example.ecommerce/
β
βββ data/
β βββ local/
β β βββ dao/ # Room DAOs
β β βββ database/ # Room Database
β β βββ entity/ # Room Entities
β βββ remote/
β β βββ api/ # Retrofit API interfaces
β β βββ firebase/ # Firebase managers
β β βββ model/ # Data models
β βββ repository/ # Repository implementations
β
βββ di/ # Dependency Injection modules
β βββ AppModule.kt
β βββ DatabaseModule.kt
β βββ NetworkModule.kt
β βββ RepositoryModule.kt
β
βββ ui/
β βββ auth/ # Login & Registration
β βββ home/ # Home screen with products
β βββ productdetail/ # Product details
β βββ upload/ # Upload products
β βββ favorites/ # Favorites screen
β βββ components/ # Reusable UI components
β βββ navigation/ # Navigation setup
β βββ theme/ # App theming
β
βββ util/ # Utility classes
β βββ Constants.kt
β βββ Resource.kt # Sealed class for API states
β
βββ MainActivity.kt # Entry point
βββ ECommerceApplication.kt # Application class
- Android Studio Hedgehog (2025.2.1) or newer
- JDK 17 or higher
- Android SDK (API 24+)
- Firebase account
- Internet connection
git clone https://github.com/yourusername/ecommerce-android.git
cd ecommerce-androida. Create Firebase Project
- Go to Firebase Console
- Click "Add Project"
- Enter project name and follow setup wizard
b. Add Android App
- Click Android icon in Firebase project
- Register app with package name:
com.example.ecommerce - Download
google-services.json - Place file in
app/directory
c. Enable Firebase Services
Authentication:
- Go to Authentication β Sign-in method
- Enable Email/Password
- Save
Firestore:
- Go to Firestore Database β Create database
- Start in test mode
- Update rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.auth.uid == userId;
}
match /products/{productId} {
allow read: if request.auth != null;
allow create: if request.auth != null;
allow update, delete: if request.auth != null &&
request.auth.uid == resource.data.uploaderId;
}
}
}Storage:
- Go to Storage β Get Started
- Update rules:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /product_images/{allPaths=**} {
allow read: if true;
allow write: if request.auth != null;
}
}
}- Open Android Studio
- File β Open β Select project folder
- Wait for Gradle sync
- Connect device or start emulator
- Click Run
βΆοΈ button - Wait for app to install
- App should launch successfully
| Login | Register |
|---|---|
![]() |
![]() |
| Home | Product Detail | Upload |
|---|---|---|
![]() |
![]() |
![]() |
| Favorites | Search | Filter |
|---|---|---|
![]() |
![]() |
![]() |
dependencies {
// Core Android
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.8.1")
// Compose
implementation(platform("androidx.compose:compose-bom:2023.10.01"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
implementation("androidx.navigation:navigation-compose:2.7.5")
// Hilt
implementation("com.google.dagger:hilt-android:2.48")
kapt("com.google.dagger:hilt-android-compiler:2.48")
implementation("androidx.hilt:hilt-navigation-compose:1.1.0")
// Room
implementation("androidx.room:room-runtime:2.6.0")
implementation("androidx.room:room-ktx:2.6.0")
kapt("androidx.room:room-compiler:2.6.0")
// 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")
// Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
// Coil
implementation("io.coil-kt:coil-compose:2.5.0")
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3")
}Located in app/src/test/
Run tests:
./gradlew testLocated in app/src/androidTest/
Run UI tests:
./gradlew connectedAndroidTestIssue 1: Build Fails
Solution:
- File β Invalidate Caches β Restart
- Check google-services.json is in app/ folder
- Verify internet connection
Issue 2: App Crashes on Launch
Solution:
- Check @HiltAndroidApp is on Application class
- Check @AndroidEntryPoint is on MainActivity
- Verify AndroidManifest references .ECommerceApplication
Issue 3: Upload Fails
Solution:
- Update Firebase Storage rules
- Check user is logged in
- Verify internet connection
Issue 4: Can't Click Products
Solution:
- Verify ProductCard has .clickable(onClick = onClick)
- Check NavGraph has ProductDetail route
- Rebuild project
External API for recommended products: https://fakestoreapi.com/
Endpoint:
GET https://fakestoreapi.com/products
Response:
[
{
"id": 1,
"title": "Product Name",
"price": 109.95,
"description": "Product description",
"category": "electronics",
"image": "https://...",
"rating": {
"rate": 3.9,
"count": 120
}
}
]- β Firebase Authentication for user management
- β Firestore Security Rules for data protection
- β Storage Rules for file access control
- β Input validation on all forms
- β Secure password handling (minimum 6 characters)
- β No hardcoded API keys (using google-services.json)
- Implement email verification
- Add password strength requirements
- Implement rate limiting
- Add user roles and permissions
- Enable App Check for Firebase
- Implement proper error logging (Crashlytics)
- User profiles with avatars
- Product reviews and ratings
- Shopping cart functionality
- Order management system
- Payment integration (Stripe/PayPal)
- Push notifications
- Chat between buyers and sellers
- Product wishlist
- Order history
- Multiple images per product with zoom
- Social media sharing
- Dark mode support
- Multi-language support
- Offline mode with sync
Contributions are welcome! Please follow these steps:
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow Kotlin Coding Conventions
- Use meaningful variable and function names
- Add comments for complex logic
- Write unit tests for new features
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Your Name
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Satya prakash verma
- GitHub: @satya7667444593
- LinkedIn: satya prakash verma
- Email: satya766744@gmail.com
- Firebase - Backend services
- Jetpack Compose - UI Framework
- Material Design 3 - Design system
- FakeStore API - Recommended products
- Coil - Image loading
- Hilt - Dependency injection
- Total Files: 50+
- Lines of Code: 5000+
- Screens: 6 main screens
- Components: 15+ reusable components
- Development Time: 40+ hours
- Last Updated: november 2025
If you have any questions or issues:
- Check the Troubleshooting section
- Search existing issues
- Create a new issue
- Email:satya766744@gmail.com
If you find this project useful, please consider giving it a star! β
- Jetpack Compose Basics
- Firebase for Android
- MVVM Architecture
- Kotlin Coroutines
- Hilt Dependency Injection
Coming soon! Check the Releases page.
Coming soon!
Made with β€οΈ using Kotlin and Jetpack Compose
β If you like this project, please give it a star! β







