Merchant Tablet App
Relevant source files
The following files were used as context for generating this wiki page:
- packages/merchant-tablet-ionic/src/app/app-routing.module.ts
- packages/merchant-tablet-ionic/src/pages/+warehouse/warehouse.ts
- packages/merchant-tablet-ionic/package.json
- packages/merchant-tablet-ionic/config.xml
- packages/merchant-tablet-ionic/src/global.scss
- packages/merchant-tablet-ionic/src/index.html
- README.md
The Merchant Tablet App is a component of the Ever Demand platform designed for stores, merchants, and warehouses. Its primary purpose is to provide a tablet-optimized interface for managing and tracking orders, organizing deliveries, and handling other merchant-specific operations in real-time.
Built as a hybrid application using Ionic and Angular, it is packaged with Cordova to access native device functionalities. This allows it to be deployed on both Android and iOS. The app communicates with the backend via a GraphQL API, utilizing Apollo Client for data management.
Sources: README.md:38-40, packages/merchant-tablet-ionic/package.json:3,20-22,70-71
Architecture and Technology Stack
The application is built on a modern web technology stack, packaged for mobile deployment. It is a single-page application (SPA) architecture powered by Angular and the Ionic framework.
Sources: README.md:58, packages/merchant-tablet-ionic/package.json:70-77
Key Technologies
The following diagram and table illustrate the main libraries and frameworks used in the Merchant Tablet App.
This diagram shows the high-level technology stack of the Merchant Tablet App.
Sources: packages/merchant-tablet-ionic/package.json:70-109, packages/merchant-tablet-ionic/config.xml:73-95
| Library/Framework | Version | Purpose |
|---|---|---|
@ionic/angular | ^5.8.4 | Core UI framework for building the hybrid mobile application. |
@angular/core | ^13.1.0 | The primary application framework for building components and services. |
apollo-angular | ^2.6.0 | Connects the Angular app to a GraphQL backend. |
rxjs | ^7.4.0 | Used extensively for managing asynchronous data streams and events. |
cordova-android | ^10.1.1 | The build target for the Android platform. |
@ngx-translate/core | ^13.0.0 | Provides internationalization (i18n) support. |
ng2-smart-table | ^1.7.2 | Used for creating data tables, likely for displaying orders or products. |
Sources: packages/merchant-tablet-ionic/package.json:70-109
Application Configuration
The project is configured through several key files, including package.json for scripts and dependencies, and config.xml for Cordova-specific settings.
Build & Run Scripts
The package.json file defines a set of npm scripts for common development tasks like starting, building, and testing the application.
| Script | Description |
|---|---|
start | Configures for development, builds, and serves the app on port 4202. |
build | Configures for development and builds the application. |
build:prod | Configures for production and creates a production build. |
test | Runs unit tests using Karma and Jasmine. |
lint | Lints the TypeScript code. |
cordova:build:prod | Creates a production release build for Android using Cordova. |
cordova:run:prod:device | Runs the production build on a connected Android device. |
Sources: packages/merchant-tablet-ionic/package.json:23-39
Cordova Configuration
config.xml is the central configuration file for the Cordova application. It defines the app's metadata, preferences, and the native plugins it requires.
- App ID:
co.ever.merchant - Version:
0.2.0 - Author: Ever Co. LTD
- Entry Point:
index.html - Android Min SDK Version: 19
The file also specifies icons and splash screens for different device resolutions on both Android and iOS platforms.
Sources: packages/merchant-tablet-ionic/config.xml:2-12, 14-29
Core Features and Modules
The application is structured into several modules that are lazy-loaded to improve initial load performance. The main features revolve around warehouse and order management.
Application Routing
Routing is managed by Angular's RouterModule. The application uses lazy loading for its feature modules, which means the code for a specific feature is only downloaded when the user navigates to it.
The main routing flow is defined in app-routing.module.ts.
This diagram illustrates the lazy-loading routing structure of the application.
Sources: packages/merchant-tablet-ionic/src/app/app-routing.module.ts:10-44
Warehouse Management (WarehousePage)
The WarehousePage is a central component for viewing and managing incoming orders. It displays orders in a card-based layout and provides functionality to interact with them.
This class diagram shows key properties and methods of the WarehousePage component, responsible for order management.
Sources: packages/merchant-tablet-ionic/src/pages/+warehouse/warehouse.ts
Order Status Visualization
The application uses distinct visual styles to represent the current status of an order. These styles are defined in global.scss and applied as CSS classes to the order cards in the warehouse view.
This state diagram shows the lifecycle of an order as reflected by the UI styles.
Sources: packages/merchant-tablet-ionic/src/global.scss:120-200
Native Device Integration
The app leverages Cordova to access native device features, enhancing its capabilities beyond what a standard web app can do. The required plugins are declared in config.xml and package.json.
| Plugin | Purpose |
|---|---|
cordova-plugin-camera | Access the device's camera to take pictures. |
cordova-plugin-geolocation | Get the device's location, likely for tracking or mapping. |
phonegap-plugin-barcodescanner | Scan barcodes and QR codes, useful for product or order identification. |
cordova-plugin-local-notification | Schedule and display local notifications to the user. |
call-number | Initiate a phone call directly from the app. |
cordova-plugin-dialogs | Display native dialogs like alerts, confirmations, and prompts. |
cordova-plugin-network-information | Check the device's network connection status. |
cordova-plugin-splashscreen | Show and hide a splash screen during app launch. |
Sources: packages/merchant-tablet-ionic/config.xml:73-95, packages/merchant-tablet-ionic/package.json:80-109
Conclusion
The Ever Demand Merchant Tablet App is a robust, cross-platform solution for merchants. By combining the power of Angular and Ionic with the native capabilities provided by Cordova, it delivers a feature-rich experience for real-time order management, delivery tracking, and inventory control. Its modular, lazy-loaded architecture ensures a performant and scalable application, central to the merchant-facing operations of the Ever Demand ecosystem.
Sources: README.md:38-40, packages/merchant-tablet-ionic/package.json