Customer Shopping Apps
Relevant source files
The following files were used as context for generating this wiki page:
- README.md
- packages/shop-web-angular/src/app/app.routes.ts
- packages/shop-mobile-ionic/src/app/app-routing.module.ts
- packages/shop-mobile-expo/src/router/index.tsx
- packages/shop-web-gatsby/src/pages/index.tsx
- packages/shop-mobile-expo/README.md
- packages/shop-web-angular/package.json
- packages/shop-mobile-expo/src/screens/app/ProductDetails.tsx
- packages/shop-mobile-flutter/README.md
The Ever Demand platform provides multiple customer-facing shopping applications, demonstrating its "Headless Commerce" architecture. These applications serve as different storefront implementations, consuming the platform's central GraphQL, REST, and WebSocket APIs. This multi-frontend approach allows for tailored user experiences across various platforms, including web and mobile, using different technology stacks.
The repository contains several distinct packages for these customer apps, each built with a different framework. This includes web applications using Angular and Gatsby, and mobile applications built with Ionic (for hybrid iOS/Android), React Native (via Expo), and Flutter. While some are fully-featured, others are currently a work in progress (WIP), showcasing the platform's flexibility.
Sources: README.md
Architecture Overview
The customer shopping applications are clients of the headless backend. They are responsible for the presentation layer and user interaction, while the core business logic, data, and state management are handled by the server.
This diagram illustrates the relationship between the backend and the various customer-facing applications.
Sources: README.md
Application Summary
The platform includes several customer-facing app implementations, each at different stages of development.
| Application | Package | Technology | Status |
|---|---|---|---|
| Shopping Website | @ever-platform/shop-web-angular | Angular 9.1 | Active |
| Shopping Mobile App | @ever-platform/shop-mobile-ionic | Ionic 5 | Active |
| Shopping Mobile App | @ever-platform/shop-mobile-expo | React Native (Expo) | Work in Progress |
| Shopping Mobile App | @ever-platform/shop-mobile-flutter | Flutter / Dart | Work in Progress |
| Shopping Website | @ever-platform/shop-web-gatsby | Gatsby | Work in Progress |
Sources: README.md, packages/shop-mobile-expo/README.md, packages/shop-mobile-flutter/README.md, packages/shop-web-gatsby/README.md
Web Applications
Angular Web App (shop-web-angular)
This is the primary web-based shopping experience, built with Angular. It provides a full-featured storefront for customers.
Sources: README.md, packages/shop-web-angular/package.json
Key Dependencies
The application relies on several key libraries to function:
@apollo/client&apollo-angular: For communication with the backend GraphQL API.@angular/material: For UI components.@ngx-translate/core: For internationalization (i18n).ngx-toastr: For user notifications.bootstrap: For CSS framework and layout.ngx-infinite-scroll: For implementing infinite scrolling on product lists.
Sources: packages/shop-web-angular/package.json:115-149
Routing
The application uses lazy loading for its feature modules to improve initial load performance. Routes are defined for authentication, user profiles, products, orders, and more.
| Path | Lazy-loaded Module | Description |
|---|---|---|
auth | app/pages/+auth/auth.module#AuthModule | Handles user login, registration, and password reset. |
profile | app/pages/+profile/profile.module#ProfileModule | User profile management pages. |
products-by-category/:id | app/pages/+products-by-category/products-by-category.module#ProductsByCategoryModule | Displays products filtered by a specific category. |
product/:id | app/pages/+product/product.module#ProductModule | Shows the details for a single product. |
cart | app/pages/+cart/cart.module#CartModule | The shopping cart page. |
checkout | app/pages/+checkout/checkout.module#CheckoutModule | The order checkout process. |
orders | app/pages/+orders/orders.module#OrdersModule | Displays the user's order history. |
order/:id | app/pages/+order/order.module#OrderModule | Shows details for a specific order. |
Sources: packages/shop-web-angular/src/app/app.routes.ts:10-74
Gatsby Web App (shop-web-gatsby)
A starter application for a shopping website built with Gatsby. This project is currently a work in progress. It uses Material-UI for components and Apollo Client for data fetching.
Sources: packages/shop-web-gatsby/README.md, packages/shop-web-gatsby/package.json
The main entry point simply renders a Layout component, indicating a basic structure is in place.
Sources: packages/shop-web-gatsby/src/pages/index.tsx
Mobile Applications
React Native (Expo) App (shop-mobile-expo)
This is a mobile shopping app built with React Native and Expo. It is currently a work in progress.
Sources: README.md, packages/shop-mobile-expo/README.md
Navigation Structure
The app's navigation is managed using @react-navigation/native. It is structured into three main stacks: Auth, App, and a root Drawer navigator.
This diagram shows the conditional rendering of authentication and main app screens.
Sources: packages/shop-mobile-expo/src/router/index.tsx:18-101
Screen Example: Product Details
The ProductDetails screen showcases how data is fetched and displayed for a single product.
- Data Fetching: It uses the
useQueryhook from@apollo/clientto execute theWAREHOUSE_PRODUCT_QUERY. This query retrieves product details, including title, description, images, and price, based onwarehouseIdandproductIdpassed as route parameters. - UI Components: It uses components from
react-native-paperlikeActivityIndicator,Avatar, andTextto render the UI. - User Interaction: A
BuyProductBtncomponent is included, which likely handles adding the product to the cart.
The following sequence diagram illustrates the data flow for the ProductDetails screen.
Ionic Mobile App (shop-mobile-ionic)
A hybrid mobile app for iOS and Android built using Ionic 5 and Angular. It provides a mobile-optimized shopping experience.
Sources: README.md
Routing
Similar to the Angular web app, the Ionic app uses lazy-loading for its pages. The routing is configured in app-routing.module.ts.
| Path | Lazy-loaded Module |
|---|---|
auth | ./pages/auth/auth.module#AuthPageModule |
cart | ./pages/cart/cart.module#CartPageModule |
checkout | ./pages/checkout/checkout.module#CheckoutPageModule |
orders | ./pages/orders/orders.module#OrdersPageModule |
order-info/:id | ./pages/order-info/order-info.module#OrderInfoPageModule |
product-view/:id | ./pages/product-view/product-view.module#ProductViewPageModule |
profile | ./pages/profile/profile.module#ProfilePageModule |
Sources: packages/shop-mobile-ionic/src/app/app-routing.module.ts:11-49
Flutter Mobile App (shop-mobile-flutter)
This is another mobile app implementation using Flutter and Dart. It is currently a work in progress and serves as a placeholder for a future Flutter-based storefront. The project structure is defined with assets and lib directories, typical for a Flutter project.