Skip to content

Creyas/union_shop

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

336 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Union Shop - Flutter E-Commerce Application

A Flutter-based e-commerce application recreating the University of Portsmouth Student Union shop. This project demonstrates modern mobile app development practices with Firebase integration, state management, and comprehensive testing.

πŸš€ Features

Implemented Features

Basic Features

  • βœ… Homepage: Responsive homepage with featured products and collections
  • βœ… Navigation: Full navigation system with working navbar and routing
  • βœ… Product Pages: Dynamic product detail pages with images, descriptions, and pricing
  • βœ… Collections: Browse products by category/collection
  • βœ… About Page: Company information and mission statement
  • βœ… Footer: Consistent footer across all pages with links

Intermediate Features

  • βœ… Shopping Cart: Full cart functionality with add/remove items and quantity management
  • βœ… Authentication: User login/signup with Firebase Authentication
  • βœ… State Management: Provider pattern for cart and user state
  • βœ… Responsive Design: Optimized for both mobile and desktop views
  • βœ… Sale Collection: Special promotional pages with discounted items

Advanced Features

  • βœ… Firebase Integration: Real-time database and authentication
  • βœ… User Accounts: Account management with order history
  • βœ… Search Functionality: Product search across collections
  • βœ… Cart Persistence: Cart data persists across sessions

πŸ“± Screenshots

Homepage

Homepage Mobile View Mobile view of the homepage with featured products

Homepage Desktop View Desktop responsive layout

Product Pages

Product Detail Product detail page with size/color options

Shopping Cart

Shopping Cart Shopping cart with item management

Authentication

Login Page User login interface

Signup Page User registration form

Collections

Collections Grid Product collections overview

Collection Detail Individual collection with filters

Additional Pages

About Page About us page

Sale Items Freshers sale promotional page

πŸ› οΈ Installation & Setup

Prerequisites

  • Flutter SDK (3.0 or higher)
  • Dart SDK (3.0 or higher)
  • Git
  • A code editor (VS Code recommended)
  • Chrome browser (for web testing)

Getting Started

  1. Clone the repository

    git clone https://github.com/Creyas/union_shop.git
    cd union_shop
  2. Install dependencies

    flutter pub get
  3. Run the application

    flutter run -d chrome
  4. View in mobile mode

    • Open Chrome DevTools (F12)
    • Click "Toggle device toolbar"
    • Select a mobile device preset (e.g., iPhone 12 Pro)

πŸ§ͺ Testing

This project includes comprehensive widget tests for all major pages and components.

Run all tests

flutter test

Run specific test file

flutter test test/product_test.dart

Run tests with coverage

flutter test --coverage

Test Files

  • test/home_test.dart - Homepage tests
  • test/product_test.dart - Product page tests
  • test/about_test.dart - About page tests
  • test/all_products_page_test.dart - All products page tests
  • test/cart_page_test.dart - Shopping cart tests
  • test/collection_detail_test.dart - Collection detail tests
  • test/freshers_sale_test.dart - Sale page tests
  • test/login_signup_test.dart - Authentication tests

πŸ—οΈ Project Structure

union_shop/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ main.dart                    # App entry point and routing
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ about.dart              # About page
β”‚   β”‚   β”œβ”€β”€ all_products_page.dart  # All products listing
β”‚   β”‚   β”œβ”€β”€ cart_page.dart          # Shopping cart
β”‚   β”‚   β”œβ”€β”€ collection_detail.dart  # Collection detail view
β”‚   β”‚   β”œβ”€β”€ freshers_sale.dart      # Sale/promotional page
β”‚   β”‚   β”œβ”€β”€ login_signup.dart       # Authentication page
β”‚   β”‚   └── product_page.dart       # Product detail page
β”‚   β”œβ”€β”€ providers/
β”‚   β”‚   └── cart_provider.dart      # Cart state management
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── auth_service.dart       # Firebase authentication
β”‚   └── widgets/
β”‚       β”œβ”€β”€ header_widget.dart      # Reusable header component
β”‚       └── footer_widget.dart      # Reusable footer component
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ about_test.dart
β”‚   β”œβ”€β”€ all_products_page_test.dart
β”‚   β”œβ”€β”€ cart_page_test.dart
β”‚   β”œβ”€β”€ collection_detail_test.dart
β”‚   β”œβ”€β”€ freshers_sale_test.dart
β”‚   β”œβ”€β”€ home_test.dart
β”‚   β”œβ”€β”€ login_signup_test.dart
β”‚   └── product_test.dart
β”œβ”€β”€ screenshots/                     # App screenshots for README
β”œβ”€β”€ pubspec.yaml                     # Project dependencies
└── README.md                        # This file

πŸ”₯ Firebase Integration

This application uses Firebase for backend services:

Services Used

  1. Firebase Authentication - User registration and login
  2. Cloud Firestore - User data and order storage

Setup Instructions

  1. Create a Firebase project at console.firebase.google.com
  2. Add a web app to your Firebase project
  3. Enable Authentication (Email/Password)
  4. Enable Cloud Firestore Database
  5. Add your Firebase configuration to the app

Firebase Security

  • Authentication required for cart persistence
  • User data protected with Firestore security rules
  • Secure password reset functionality

🌐 Live Demo

[Include link to hosted version if deployed]

Example: The application is hosted on Firebase Hosting and can be accessed at: https://union-shop-xxxxx.web.app

πŸ“¦ Dependencies

Key packages used in this project:

dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^latest
  firebase_auth: ^latest
  cloud_firestore: ^latest
  provider: ^latest

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^latest

🎯 Development Practices

Version Control

  • Regular, meaningful commits throughout development
  • Clear, descriptive commit messages
  • Feature branches for major functionality

Code Quality

  • Properly formatted code (using dart format)
  • No errors, warnings, or lints
  • Well-structured and refactored codebase
  • Minimal code repetition

Testing

  • Comprehensive widget tests
  • All tests passing
  • High code coverage

πŸ‘₯ Author

Your Name

πŸ“ Course Information

Module: Programming Applications and Programming Languages (M30235) / User Experience Design and Implementation (M32605)

Institution: University of Portsmouth

Academic Year: 2024/2025

πŸ™ Acknowledgments

πŸ“„ License

This project is created for educational purposes as part of university coursework.


Note: This is a student project recreating the UPSU shop for educational purposes. It is not affiliated with or endorsed by the University of Portsmouth Students' Union.

About

The repository for the coursework of the Flutter Course (first term of Programming Applications and Programming Languages (M30235) and User Experience Design and Implementation (M32605) modules)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Dart 82.7%
  • C++ 8.6%
  • CMake 6.9%
  • Swift 0.8%
  • C 0.5%
  • HTML 0.5%