Skip to content

A comprehensive Flutter mobile application that mirrors your MEAN stack e-commerce website functionality. This app provides a complete shopping experience with user authentication, product browsing, cart management, order processing, and admin capabilities.

Notifications You must be signed in to change notification settings

apdo978/E-commerce_Flutter

Repository files navigation

E-Commerce Flutter Mobile App

A comprehensive Flutter mobile application that mirrors your MEAN stack e-commerce website functionality. This app provides a complete shopping experience with user authentication, product browsing, cart management, order processing, and admin capabilities.

Features

πŸ” Authentication

  • User registration and login
  • JWT-based authentication
  • Persistent sessions with SharedPreferences
  • Role-based access control (User/Admin)

πŸ›οΈ Product Management

  • Product listing with search and filtering
  • Category-based navigation
  • Product detail views with image galleries
  • Product ratings and reviews display
  • Real-time stock status

πŸ›’ Shopping Cart

  • Add/remove items from cart
  • Quantity management
  • Real-time price calculations
  • Persistent cart data
  • Cart badge with item count

πŸ“¦ Order Management

  • Comprehensive checkout process
  • Multiple payment method support
  • Order confirmation and tracking
  • Order history with detailed views
  • Order status updates

πŸ‘€ User Profile

  • Profile management and editing
  • Order history access
  • Account settings
  • User avatar support

πŸ”§ Admin Dashboard

  • User management and oversight
  • Order management and status updates
  • Real-time analytics
  • Email notifications to customers
  • Print order functionality

🎨 UI/UX Features

  • Material Design principles
  • Responsive design for all screen sizes
  • Smooth animations and transitions
  • Loading states and error handling
  • Pull-to-refresh functionality
  • Image caching and optimization

Technical Stack

  • Flutter 3.0+
  • Dart 3.0+
  • Provider for state management
  • HTTP for API communication
  • SharedPreferences for local storage
  • CachedNetworkImage for image optimization
  • Intl for internationalization

Project Structure

lib/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ app.dart                 # Main app configuration
β”‚   β”œβ”€β”€ models/                  # Data models
β”‚   β”‚   β”œβ”€β”€ user_model.dart
β”‚   β”‚   └── product_model.dart
β”‚   β”œβ”€β”€ providers/               # State management
β”‚   β”‚   β”œβ”€β”€ auth_provider.dart
β”‚   β”‚   β”œβ”€β”€ cart_provider.dart
β”‚   β”‚   └── product_provider.dart
β”‚   └── services/                # API services
β”‚       └── api_service.dart
β”œβ”€β”€ screens/                     # UI screens
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ login_screen.dart
β”‚   β”‚   └── register_screen.dart
β”‚   β”œβ”€β”€ home/
β”‚   β”‚   └── home_screen.dart
β”‚   β”œβ”€β”€ product/
β”‚   β”‚   └── product_detail_screen.dart
β”‚   β”œβ”€β”€ cart/
β”‚   β”‚   └── cart_screen.dart
β”‚   β”œβ”€β”€ checkout/
β”‚   β”‚   └── checkout_screen.dart
β”‚   β”œβ”€β”€ orders/
β”‚   β”‚   └── orders_screen.dart
β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   └── profile_screen.dart
β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   └── admin_dashboard.dart
β”‚   └── splash_screen.dart
└── main.dart                    # App entry point

API Integration

The app integrates with your existing MEAN stack backend API:

  • Base URL: https://abdelrhman-dev.me/api
  • Authentication: JWT Bearer tokens
  • Endpoints: Users, Products, Cart, Orders

Supported API Endpoints:

  • POST /users/login - User authentication
  • POST /users/register - User registration
  • GET /products - Fetch all products
  • GET /products/:id - Get product details
  • POST /cart - Add item to cart
  • GET /cart - Get cart items
  • POST /orders - Create new order
  • GET /orders/myorders - Get user orders

Setup Instructions

Prerequisites

  • Flutter SDK 3.0 or higher
  • Android Studio / VS Code
  • Android/iOS device or emulator

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd E-commerce-Flutter
  2. Install dependencies

    flutter pub get
  3. Add assets

    • Place your logo in assets/images/logo.png
    • Add any additional images to assets/images/
  4. Update API configuration

    • Verify the base URL in lib/core/services/api_service.dart
    • Ensure your backend API is running
  5. Run the app

    flutter run

Configuration

Environment Setup

  • Development: Uses https://abdelrhman-dev.me/api
  • Production: Update base URL in api_service.dart

Authentication

The app supports the same credentials as your web application:

  • Regular User: apdo@apdo.com / 0123456789
  • Admin User: admin@ceo.apdo / 123456789

Features Roadmap

βœ… Completed

  • User authentication and registration
  • Product listing and search
  • Shopping cart functionality
  • Order management
  • User profile management
  • Admin dashboard
  • Responsive design

🚧 In Progress

  • Push notifications
  • Offline support
  • Advanced filtering
  • Wishlist functionality

πŸ“‹ Planned

  • Social media login
  • Multiple language support
  • Advanced analytics
  • Product reviews and ratings
  • Live chat support

Testing

Running Tests

# Run all tests
flutter test

# Run with coverage
flutter test --coverage

Test Credentials

Use the same test accounts as your web application:

  • Regular user: apdo@apdo.com / 0123456789
  • Admin user: admin@ceo.apdo / 123456789

Deployment

Android

  1. Build APK: flutter build apk
  2. Build App Bundle: flutter build appbundle

iOS

  1. Build iOS: flutter build ios
  2. Archive in Xcode for App Store

Contributing

  1. Fork the repository
  2. Create a 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

Support

For support or questions:

  • Create an issue in the repository
  • Contact: [Your contact information]

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built to complement the MEAN stack e-commerce website
  • Designed with Material Design principles
  • Optimized for performance and user experience

Note: This Flutter app is designed to work seamlessly with your existing MEAN stack backend. Ensure your API server is running and accessible for full functionality.

About

A comprehensive Flutter mobile application that mirrors your MEAN stack e-commerce website functionality. This app provides a complete shopping experience with user authentication, product browsing, cart management, order processing, and admin capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published