A modern Android application built with Kotlin and Jetpack Compose that allows users to design custom T-shirts with an intuitive interface. The app features Firebase authentication, real-time database integration, and a rich design toolkit for creating personalized apparel.
- Custom T-shirt Design: Interactive design canvas for creating unique T-shirt designs
- User Authentication: Secure login/signup with Firebase Authentication and Google Sign-In
- Real-time Database: Store and sync designs with Firebase Realtime Database
- Material Design 3: Modern and intuitive user interface
- Design Tools: Rich set of tools for customizing T-shirt designs
- Image Integration: Support for adding custom images and graphics
- Design Gallery: Browse and manage your saved designs
- Responsive UI: Optimized for different screen sizes
- Language: Kotlin
- UI Framework: Jetpack Compose
- Architecture: MVVM with Dagger Hilt
- Authentication: Firebase Auth + Google Sign-In
- Database: Firebase Realtime Database
- Dependency Injection: Dagger Hilt
- Navigation: Navigation Compose
- Image Loading: Coil
- Design System: Material Design 3
- Min SDK: 24 (Android 7.0)
- Target SDK: 34
- Compile SDK: 35
Before running this application, make sure you have:
- Android Studio (Latest version recommended)
- JDK 11 or higher
- An Android device or emulator with API level 24+
- Firebase project setup
- Google Services configuration
git clone https://github.com/Shivamtawar/Design_your_Tshirt.git
cd Design_your_Tshirt- Create a new Firebase project at Firebase Console
- Enable Authentication and Realtime Database
- Download
google-services.jsonfile - Place it in the
app/directory
- In Firebase Console, go to Authentication โ Sign-in method
- Enable Email/Password and Google sign-in providers
- For Google Sign-In, add your app's SHA-1 fingerprint
- Go to Google Cloud Console
- Create credentials for your Android app
- Add the Web client ID to your Firebase project
- Open the project in Android Studio
- Sync Gradle files
- Build and run on your device/emulator
app/
โโโ src/
โ โโโ main/
โ โ โโโ java/com/example/designyourt_shirt/
โ โ โ โโโ ui/
โ โ โ โ โโโ auth/ # Authentication screens
โ โ โ โ โโโ design/ # Design canvas and tools
โ โ โ โ โโโ gallery/ # Design gallery
โ โ โ โ โโโ profile/ # User profile
โ โ โ โ โโโ theme/ # App theme and styling
โ โ โ โโโ data/
โ โ โ โ โโโ repository/ # Data repositories
โ โ โ โ โโโ remote/ # Firebase data sources
โ โ โ โ โโโ model/ # Data models
โ โ โ โโโ di/ # Dependency injection modules
โ โ โ โโโ navigation/ # Navigation setup
โ โ โ โโโ utils/ # Utility classes
โ โ โ โโโ MainActivity.kt # Main activity
โ โ โโโ res/
โ โ โ โโโ values/ # App resources
โ โ โ โโโ drawable/ # Images and icons
โ โ โ โโโ layout/ # Layout files (if any)
โ โ โโโ AndroidManifest.xml
โ โโโ androidTest/ # Instrumented tests
โ โโโ test/ # Unit tests
โโโ build.gradle.kts # App-level Gradle build file
โโโ google-services.json # Firebase configuration
- Interactive T-shirt design interface
- Drag and drop design elements
- Text customization (fonts, colors, sizes)
- Shape and graphic tools
- Layer management
- Undo/Redo functionality
- Email/Password registration and login
- Google Sign-In integration
- User profile management
- Secure session handling
- Save designs to Firebase
- Load previous designs
- Share designs with others
- Export designs as images
// Core Android libraries
implementation("androidx.core:core-ktx")
implementation("androidx.lifecycle:lifecycle-runtime-ktx")
implementation("androidx.activity:activity-compose")
// Jetpack Compose
implementation(platform("androidx.compose:compose-bom"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.material:material-icons-extended")
// Navigation
implementation("androidx.navigation:navigation-compose")
// Firebase
implementation("com.google.firebase:firebase-auth")
implementation("com.google.firebase:firebase-database-ktx")
// Authentication
implementation("androidx.credentials:credentials")
implementation("androidx.credentials:credentials-play-services-auth")
implementation("com.google.android.libraries.identity.googleid:googleid")
// Dependency Injection
implementation("com.google.dagger:hilt-android")
implementation("androidx.hilt:hilt-navigation-compose")
// Image Loading
implementation("io.coil-kt:coil-compose"){
"users": {
"userId": {
"email": "user@example.com",
"displayName": "User Name",
"profilePicture": "url_to_image"
}
},
"designs": {
"designId": {
"userId": "user_id",
"title": "My Design",
"designData": "serialized_design_data",
"thumbnail": "thumbnail_url",
"createdAt": "timestamp",
"updatedAt": "timestamp"
}
}
}{
"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
},
"designs": {
".read": "auth != null",
".write": "auth != null",
"$designId": {
".validate": "newData.child('userId').val() === auth.uid"
}
}
}
}- Splash screen with app branding
- Login/Register options
- Google Sign-In or Email/Password
- Profile setup for new users
- Main dashboard with design options
- T-shirt template selection
- Design canvas with tools
- Save and preview functionality
- Browse saved designs
- Edit existing designs
- Share or delete designs
- Search and filter options
# Run unit tests
./gradlew test
# Run instrumented tests
./gradlew connectedAndroidTest
# Run all tests with coverage
./gradlew jacocoTestReport- Unit tests for ViewModels and repositories
- UI tests for critical user flows
- Integration tests for Firebase operations
- Text Tool: Add customizable text with various fonts
- Shape Tool: Insert geometric shapes and patterns
- Image Tool: Upload and manipulate custom images
- Color Picker: Full color palette for all elements
- Transform Tool: Resize, rotate, and position elements
- High-resolution PNG export
- PDF format for printing
- Share directly to social media
- Email design attachments
android {
buildTypes {
debug {
applicationIdSuffix = ".debug"
isDebuggable = true
}
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
}
}
}<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />The app includes comprehensive error handling for:
- Network connectivity issues
- Firebase authentication errors
- Database operation failures
- File upload/download errors
- Invalid design data
- MVVM Architecture: Clear separation of concerns
- Repository Pattern: Centralized data management
- Dependency Injection: Improved testability and modularity
- State Management: Reactive UI updates with StateFlow
-
Firebase Authentication fails
- Check google-services.json placement
- Verify SHA-1 fingerprint in Firebase Console
- Ensure correct client ID configuration
-
Database permission denied
- Review Firebase Security Rules
- Check user authentication status
- Verify user permissions
-
Google Sign-In not working
- Confirm Web client ID in Firebase
- Check Google Cloud Console credentials
- Verify package name and SHA-1
- Enable Firebase debug logging
- Use Android Studio's Network Inspector
- Check Logcat for detailed error messages
- Test on different devices and Android versions
This project is open source and available under the MIT License.
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Follow Kotlin coding conventions and Material Design guidelines
- Write tests for new features
- Update documentation as needed
- Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
If you encounter any issues:
- Check the Issues section
- Create a new issue with detailed information
- Contact: @Shivamtawar
- AI-powered design suggestions
- 3D T-shirt preview
- Collaborative design editing
- Design marketplace integration
- Print-on-demand service integration
- Augmented reality try-on
- Design templates library
- Vector graphics support
- Animation and effects
- Multi-language support
- Firebase team for backend services
- Jetpack Compose community
- Material Design guidelines
- Open source contributors
Made with โค๏ธ by Shivam Tawar
Design Your Style, Wear Your Creativity! ๐จ
This project includes a basic integration with Razorpay Android SDK for handling in-app payments.
Setup:
- Add your Razorpay API key to
app/src/main/res/values/strings.xmlreplacingrazorpay_key. - The app uses
MainActivityto receive Razorpay callbacks and logs transactions to Firebase Realtime Database undertransactions/{userId}.
Notes:
- Replace
rzp_test_placeholderwith your test/live key before releasing. - For production use, generate and verify payment signatures on a secure server. This project uses a client-only flow suitable for testing.
Testing payment flows:
- Add items to cart and navigate to Checkout.
- Select "Pay with Card" and press Place Order.
- Complete payment in the Razorpay checkout UI. On success, the app records a transaction and shows the order confirmation screen. On failure, an error message is displayed.