TradeHub is a Flutter + Firebase peer-to-peer marketplace app where users can list items, discover products, chat with sellers in real time, and review each other after interactions.
This repository contains a full mobile project foundation with Firebase integration, Riverpod state management, GoRouter navigation, offline cache support, chat notifications, and marketplace-ready UI flows.
- Authentication (Email/Password)
- Marketplace listing feed with categories and shimmer loading
- Listing create/edit/detail flows with image upload to Firebase Storage
- Real-time in-app chat (Firestore-based)
- User profile with ratings and reviews
- Search with debouncing, filters, and recent searches cache
- Offline listing cache using Hive + connectivity awareness
- Bottom navigation with unread chat badge
- Firestore security rules included
- Flutter (Material)
- Firebase:
- Firebase Auth
- Cloud Firestore
- Firebase Storage
- Firebase Messaging
- Riverpod (
flutter_riverpod) - GoRouter (
go_router) - Hive (
hive,hive_flutter) cached_network_image,image_picker,connectivity_plus,timeago,intl,uuid,shimmer
lib/
core/
constants/
router/
theme/
models/
providers/
screens/
auth/
home/
listing/
chat/
profile/
search/
orders/
services/
firebase_options.dart
main.dart
- Splash auth-state check and redirect
- Login + Register screens with validation and loading/error handling
- User document creation in Firestore on registration
- Category chips and listing grid
- Listing cards with image, title, price, seller, and relative time
- Pull-to-refresh and shimmer loading
- Offline mode banner and cached listings fallback
- Create listing with up to 5 images
- Edit listing with sold toggle
- Listing detail with seller card and chat CTA
- Owner controls for edit/delete
- Debounced title search (
lowercaseTitle) - Filters: category, price range, sort order
- Recent searches saved in Hive (max 10)
- Chat list with unread count
- Chat screen with real-time messages
- Mark messages as read
- Firebase Cloud Function trigger for FCM message notifications
- User profile with avatar, rating, review count
- Tabs for active listings, sold listings, and reviews received
- Leave review bottom sheet with star rating and optional comment
- Create Firebase project.
- Add Android app with package name:
com.example.tradehub
- Place
google-services.jsonin:
android/app/google-services.json
- Enable services:
- Authentication (Email/Password)
- Cloud Firestore
- Firebase Storage
- Firebase Cloud Messaging
- Deploy rules from this repo:
firebase deploy --only firestore:rulesflutter pub get
flutter analyze
flutter runThe repository includes a Firestore trigger for new chat messages:
functions/index.js
Deploy with:
firebase deploy --only functionsRules are included in:
firestore.rules
Current policy includes:
- Users: only owner can update/delete
- Listings: only seller can modify
- Chats: only participants can access
- Reviews: read all, write for authenticated users
- Google Sign-In is intentionally not implemented in this build.
- Payments are intentionally excluded.
Built for MAD Internal Practical Exam.