- Project Overview
- Resources
- Features
- App Screenshots
- Technical Specifications
- Installation
- Running the App
TR Store is a Flutter-based lightweight mobile application designed to deliver a seamless shopping experience for users on low-end mobile devices, especially in rural areas. The app ensures user state persistence across app closures and crashes, offering a good user experience despite potential network issues.
Dummy data for the TR Store application is sourced from https://www.jsonplaceholder.org/ . This allows for the simulation of product listings and details within the app.
- Product Listing: Explore a list of products that TR Store offers.
- Product Details: Access detailed information about products, including names, descriptions, and prices.
- Shopping Cart: Add products to a shopping cart, accessible from any part of the app through a cart icon.
- Architecture: Adopts Clean Architecture principles to ensure the project is scalable, maintainable, and decoupled. This approach aids in separating concerns, organizing the codebase, and facilitating easier testing and future enhancements.
- Development Approach: Although the project intended to fully implement Test-Driven Development (TDD) principles, time constraints limited comprehensive test coverage. Initial steps toward unit testing were established, focusing on critical functionalities and a robust application architecture.
- Database: Utilizes
sqflite
for local data storage, ensuring data persistence across network issues or app restarts. - State Management: Implements
flutter_bloc
for efficient and scalable state management across the app. - Dependency Injection: Uses
Get It
for dependency injection, enhancing modularity and testability. - Networking: Employs
Dio
for network requests, with a retry mechanism andcached_network_image
for efficient image loading and caching. - Routing: Manages navigation using
go_router
, enabling a clear and concise routing setup. - Pagination: Implements client-side pagination for products to enhance user experience on low-end devices.
- Flavor Configuration: Incorporates flavors for different version configurations, allowing for multiple build variants to accommodate various development and production needs. This setup facilitates testing across different environments without affecting the production build.
- The app checks for internet connectivity and fetches data from the API using
Dio
, caching it locally. - In the absence of an internet connection, it retrieves data from the local
sqflite
database. - Local database schema includes
product
andcart
tables, with foreign key relationships to maintain data integrity and efficiency.
- Clone the repository:
git clone https://github.com/voidAnik/tr-store-demo
- Navigate to the project directory and install dependencies:
flutter pub get
- Open the project in Android Studio, where launch configurations for different flavors (development and production) are saved.
- Select the appropriate configuration and run the app.
- Also Select Run All Tests to run the tests.
-
For development flavor:
flutter run --flavor development -t lib/app/env/main_development.dart
-
For production flavor:
flutter run --flavor production -t lib/app/env/main_production.dart
-
For test:
flutter test
-
For Building Apk
flutter run --flavor development -t lib/app/env/main_development.dart
flutter build apk --flavor production -t lib/app/env/main_production.dart