Skip to content

Petify 🐾 Android e-commerce app for pet supplies built with Java, XML, and Firebase (Authentication + Firestore). Includes Admin and User panels connected through a shared database.

Notifications You must be signed in to change notification settings

negarprh/Petify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐾 Petify, Android E-Commerce App for Pet Supplies

Android Firebase Firestore Storage Stripe Gradle UI

Petify is a complete Android e-commerce app built with Java + XML + Firebase Auth + Cloud Firestore + Firebase Storage, featuring real-time synchronization and two fully separated panels: User and Admin.

It includes Stripe API integration for real online payment processing.


πŸ“Έ Screenshots

🏠 Home Screen

πŸ›’ Shopping Cart

🐢 Product Detail

πŸ‘€ User Profile

πŸ›  Admin Dashboard


🧭 Project Overview

Petify includes two synchronized environments powered by Firestore:

Panel Capabilities
πŸ‘€ User Panel Browse products, search, add to cart, manage favorites, view product details, manage profile
πŸ§‘β€πŸ’Ό Admin Panel Add/edit/delete products, upload product images, view user orders, manage payments

Both panels communicate with:

  • Cloud Firestore for real-time database
  • Firebase Storage for hosting images
  • Firebase Authentication for secure login
  • Stripe API for payments

βš™οΈ Tech Stack

Languages & Tools

  • Java
  • XML UI
  • Android Studio
  • Gradle

Firebase Services

Service Usage
Authentication Role-based login (User/Admin)
Firestore NoSQL DB Products, users, orders, cart, favorites
Firestore Indexes Optimized search & queries
Firebase Storage Product images + Profile images
Firestore Rules Secure per-user access control

External APIs

API Purpose
Stripe API Secure online payment processing (credit cards and debit cards payment intents)

Stripe will handle:

  • Payment intents
  • Payment confirmation
  • Server-side verification
  • Firestore update on payment success

🧩 Key Features

πŸ” Authentication

  • Email/Password login via Firebase
  • Admin/User role mapping
  • Auto redirect based on role

πŸ‘€ User Features

🏠 Home Page

  • Firestore-powered product list
  • Search + instant filter
  • Real-time image loading via URL & Storage

❀️ Favorites System

  • Toggle heart icon

  • Stored in users/{uid}/favorites

  • Favorites screen includes:

    • Product title, category, price
    • Add to Cart button
    • Remove favorite

πŸ›’ Shopping Cart

  • Add/remove products
  • Modify quantity
  • Real-time syncing to Firestore

🧾 Product Details

  • Large image
  • Description
  • Favorite toggle
  • Add to Cart

πŸ‘€ Profile Section

  • Edit profile
  • Change password
  • Logout
  • View order history

πŸ§‘β€πŸ’Ό Admin Features

πŸ“¦ Product Management

  • Create new products
  • Edit product details
  • Delete products
  • Upload product images β†’ Firebase Storage

πŸ›’ Order & Payment Overview

  • See all user orders
  • Inspect payment details
  • Verify completed payments
  • Support for Stripe API

πŸ”₯ Firebase Architecture (Technical Deep Dive)

Firestore Structure

users/
   uid/
      name: "John"
      email: "[email protected]"
      role: "user"

products/
   productId/
      title: "Dog Toy"
      category: "Toys"
      price: 12.99
      description: "..."
      imageUrl: "..."
      createdAt: timestamp

users/{uid}/favorites/
   productId/
      productId: "..."
      title: "..."
      imageUrl: "..."
      price: 12.99
      createdAt: timestamp

users/{uid}/cartItems/
   productId/
      title: "..."
      quantity: 2
      price: 12.99
      imageUrl: "..."

orders/
   orderId/
      userId: "uid"
      items: [...]
      totalPrice: ...
      status: "pending" | "paid"

Firebase Storage Structure

product_images/
    productId.jpg

profile_images/
    uid.jpg

Used by:

  • Admin product creation
  • User profile updates

πŸ’³ Stripe API Integration

Stripe integration will introduce:

Client-Side (Android)

  • Initiate payment intents
  • Display Stripe’s payment sheet
  • Secure tokenization of card details

Server-Side

  • Cloud Function or backend service will:

    • Create payment intents

    • Verify success

    • Update Firestore:

      orders/orderId/status: "paid"
      

Benefits

  • PCI-compliant card handling
  • Strong authentication
  • Support for credit/debit
  • Automatic fraud detection

🧱 Architecture

  • Models β†’ represent Firestore documents
  • Adapters β†’ efficient RecyclerView bindings
  • FirebaseUtils β†’ shared Firestore/Auth instances
  • Activities β†’ UI + user interactions, no business logic inside
  • Subcollections β†’ for favorites, cart, payments

πŸ—‚οΈ Folder Structure

Petify/
 β”œβ”€β”€ app/
 β”‚   β”œβ”€β”€ java/com/example/petify/
 β”‚   β”‚    β”œβ”€β”€ User/
 β”‚   β”‚    β”œβ”€β”€ Admin/
 β”‚   β”‚    β”œβ”€β”€ Adapters/
 β”‚   β”‚    β”œβ”€β”€ Models/
 β”‚   β”‚    └── FirebaseUtils.java
 β”‚   β”œβ”€β”€ res/layout/
 β”‚   β”œβ”€β”€ res/drawable/
 β”‚   β”œβ”€β”€ res/values/
 β”‚   └── AndroidManifest.xml
 β”œβ”€β”€ google-services.json
 β”œβ”€β”€ build.gradle
 β”œβ”€β”€ README.md
 └── .gitignore

πŸš€ Running the Project

  1. Clone:
git clone https://github.com/negarprh/Petify.git
  1. Open in Android Studio
  2. Add your google-services.json under /app
  3. Connect Firebase
  4. Sync + Run

πŸ‘©β€πŸ’» Authors

Negar Pirasteh , Betty Dang

About

Petify 🐾 Android e-commerce app for pet supplies built with Java, XML, and Firebase (Authentication + Firestore). Includes Admin and User panels connected through a shared database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages