Skip to content

Modern Android coffee ordering app with Firebase authentication, reward missions, wallet system, and real-time shop discovery. Built with Java, Retrofit, and Material Design. Features include phone verification, product reviews, gift cards, order management, and profile customization. Complete MVC architecture with comprehensive API integration.

Notifications You must be signed in to change notification settings

Vanhoai/coffee_android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

332 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

β˜• Aurora Coffee

Android Java Firebase Gradle

A modern Android coffee ordering application with rewards, missions, and social features.

Features β€’ Installation β€’ Architecture β€’ Screenshots β€’ License


πŸ“± Overview

Aurora Android is a comprehensive mobile application that allows users to browse coffee shops, order products, earn rewards through missions, and manage their account. Built with modern Android development practices and integrated with Firebase for authentication and real-time features.

✨ Features

πŸ” Authentication & Authorization

  • Firebase Phone Authentication - Secure phone number verification
  • Email/Password Login - Traditional authentication method
  • Password Recovery - Email-based password reset with verification codes
  • User Registration - Complete onboarding flow with validation

πŸͺ Shop & Product Management

  • Shop Discovery - Browse nearby coffee shops with location-based filtering
  • Product Catalog - View detailed product information with images and ratings
  • Product Reviews - Read and write product reviews with star ratings
  • Bookmarks - Save favorite products for quick access
  • Search & Filter - Find products and shops easily

πŸ›’ Order Management

  • Shopping Cart - Add products and manage quantities
  • Checkout Flow - Complete order placement with address and payment details
  • Gift/Promo Codes - Apply discount codes at checkout
  • Order History - Track past and current orders
  • Order Cancellation - Cancel pending orders

🎁 Rewards & Missions

  • Mission System - Complete challenges to earn rewards
  • Gift Cards - Earn and redeem promotional gifts
  • Progress Tracking - Monitor mission completion progress
  • Expiration Management - Time-limited rewards and missions
  • XP System - Earn experience points for activities

πŸ’³ Wallet & Payments

  • Digital Wallet - Manage account balance
  • Top-Up - Add funds to wallet
  • Payment Card - Virtual card with unique code
  • Transaction History - View all wallet transactions

πŸ‘€ Profile Management

  • Avatar Upload - Customize profile with image upload
  • Account Settings - Update personal information
  • Gallery Integration - Select images from device gallery
  • Profile Viewing - View account details and balance

πŸ”” Notifications

  • FCM Integration - Receive push notifications
  • Order Updates - Get notified about order status changes
  • Mission Alerts - Notifications for new missions and rewards

πŸ› οΈ Tech Stack

Core Technologies

  • Language: Java
  • Min SDK: API 21 (Android 5.0 Lollipop)
  • Target SDK: Latest Android version
  • Build System: Gradle

Libraries & Dependencies

πŸ”₯ Firebase

implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-messaging'

🌐 Networking

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

πŸ–ΌοΈ Image Loading

implementation 'com.github.bumptech.glide:glide:4.15.1'

🎨 UI Components

implementation 'androidx.recyclerview:recyclerview'
implementation 'androidx.cardview:cardview'
implementation 'com.google.android.material:material'
implementation 'me.relex:circleindicator:2.1.6'

⚑ Reactive Programming

implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

πŸ“ Project Structure

app/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ java/com/example/coffee/
β”‚   β”‚   β”‚   β”œβ”€β”€ adapters/          # RecyclerView adapters
β”‚   β”‚   β”‚   β”œβ”€β”€ app/               # Application constants & data
β”‚   β”‚   β”‚   β”œβ”€β”€ callbacks/         # API callback interfaces
β”‚   β”‚   β”‚   β”œβ”€β”€ fcm/               # Firebase Cloud Messaging
β”‚   β”‚   β”‚   β”œβ”€β”€ interfaces/        # Retrofit API interfaces
β”‚   β”‚   β”‚   β”œβ”€β”€ models/            # Data models
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Order/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Others/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Product/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Shop/
β”‚   β”‚   β”‚   β”‚   └── User/
β”‚   β”‚   β”‚   β”œβ”€β”€ screens/           # Activities & Fragments
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ auth/          # Authentication screens
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ bottom/        # Bottom navigation screens
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Gift/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Home/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Product/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Profile/
β”‚   β”‚   β”‚   β”‚   β”‚   └── Shop/
β”‚   β”‚   β”‚   β”‚   └── others/        # Splash & onboarding
β”‚   β”‚   β”‚   β”œβ”€β”€ services/          # API service classes
β”‚   β”‚   β”‚   └── utils/             # Helper utilities
β”‚   β”‚   └── res/
β”‚   β”‚       β”œβ”€β”€ layout/            # XML layouts
β”‚   β”‚       β”œβ”€β”€ drawable/          # Images & icons
β”‚   β”‚       β”œβ”€β”€ font/              # Custom fonts
β”‚   β”‚       └── menu/              # Menu resources
β”‚   β”œβ”€β”€ androidTest/               # Instrumented tests
β”‚   └── test/                      # Unit tests
└── build.gradle

πŸ—οΈ Architecture

Design Pattern

The app follows MVC (Model-View-Controller) pattern with clear separation of concerns:

  • Models (models/) - Data structures with Gson serialization
  • Views (screens/) - Activities and Fragments
  • Controllers (services/) - Business logic and API communication

Key Components

πŸ”Œ API Integration

  • Base URL Configuration: BaseAPI
  • Retrofit Interfaces: Separate interfaces for different features
    • AuthInterfaceAPI - Authentication endpoints
    • GiftInterfaceAPI - Rewards & missions
    • Product, Shop, Order interfaces

πŸ“¦ Data Models

  • Serializable Classes: All models implement Serializable for Intent passing
  • Gson Annotations: @SerializedName for JSON mapping
  • Response Wrappers: HttpResponse base class for API responses

🎯 Services Layer

Services handle API calls and business logic:

  • AuthService - User authentication
  • UserService - User profile management
  • GiftService - Rewards and missions
  • ProductService, ShopService, OrderService

πŸ› οΈ Utilities

  • UserInformation - User session management
  • LayoutLoading - Loading state UI
  • Validation - Input validation
  • HelperFunction - Common utilities
  • Logger - Debugging helper

πŸš€ Installation

Prerequisites

  • Android Studio Arctic Fox or later
  • JDK 11 or higher
  • Android SDK with API level 21+
  • Firebase project setup

Setup Steps

  1. Clone the repository
git clone https://github.com/yourusername/coffee_android.git
cd coffee_android
  1. Configure Firebase

    • Create a Firebase project at Firebase Console
    • Add Android app to your Firebase project
    • Download google-services.json
    • Place it in app directory
  2. Update API Configuration

    • Open BaseAPI.java
    • Update BASE_URL with your backend server URL
  3. Sync Gradle

./gradlew sync
  1. Build and Run
./gradlew assembleDebug
./gradlew installDebug

Or use Android Studio's Run button ▢️

πŸ“Έ Screenshots

Authentication Flow

Splash Screen Login Register Phone Verification
🌟 πŸ” πŸ“ πŸ“±

Main Features

Home Shop Gifts Profile
🏠 πŸͺ 🎁 πŸ‘€

Product & Orders

Product List Product Detail Checkout Payment
πŸ“‹ πŸ“± πŸ›’ πŸ’³

πŸ”§ Configuration

Gradle Configuration

The project uses Gradle for dependency management. Key configurations in build.gradle:

android {
    compileSdk 33
    defaultConfig {
        applicationId "com.example.coffee"
        minSdk 21
        targetSdk 33
        versionCode 1
        versionName "1.0"
    }
}

ProGuard Rules

ProGuard rules are defined in proguard-rules.pro for code obfuscation in release builds.

πŸ§ͺ Testing

Unit Tests

Located in app/src/test/

./gradlew test

Instrumented Tests

Located in app/src/androidTest/

./gradlew connectedAndroidTest

πŸ“š Key Features Implementation

πŸ”₯ Firebase Phone Authentication

Implementation in VerityActivity.java:

  • Phone number validation
  • OTP verification
  • Auto-verification callbacks
  • Resend code functionality

🎁 Mission System

Mission registration in RecyclePromoAdapter.java:

  • Mission listing with progress
  • Register for missions
  • Track completion status
  • Reward distribution

πŸ’³ Wallet System

Wallet management in CardActivity.java:

  • Display balance and card code
  • Top-up functionality
  • Transaction history

πŸ“± Image Upload

Avatar upload in ProfileFragment.java:

  • Gallery permission handling
  • Image selection
  • File path resolution with RealPathUtil
  • Multipart upload

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

⭐ Star this repo if you find it helpful!

Made with ❀️ and β˜•

About

Modern Android coffee ordering app with Firebase authentication, reward missions, wallet system, and real-time shop discovery. Built with Java, Retrofit, and Material Design. Features include phone verification, product reviews, gift cards, order management, and profile customization. Complete MVC architecture with comprehensive API integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages