CHAPTER 13
Prototyping J&S Food's Smart Shopping Bag Using Innovation as a Service

The design process is about designing and prototyping and making. When you separate those, I think the final result suffers.

—Jonathan Ive

The successful adoption of the smart shopping bag specification and design agile processes (Chapter 11, “Specifying J&S Food’s Smart Shopping Bag Digital Product” and Chapter 12, “Designing J&S Food’s Smart Shopping Bag Digital Product”) has enabled J&S Food to equip itself with a solid digital product and service design capability.

J&S Food's digital products and services development staff is now able to organize itself into an agile team and take advantage of the Unified Modeling Language (UML) methodology to convert any product or service idea into an actionable digital product and service architecture.

As the task force leader, your satisfaction is evident. Nonetheless, you're thinking: “I'll only be fully satisfied when I can see how the AWS innovation as a service tools (Chapter 1, “The Digital Economy’s Challenges, Opportunities, and Relevance of AWS”) help to deliver the tangible digital products and services that our customers expect.”

This is another goal of the digital products and services prototyping process. To make an informed validation decision about the new J&S Food's digital products and services prototyping process, you have decided to become part of it as an observer.

This chapter answers all of your questions about how to use the AWS IoT platform and how the prototyping process works using AWS Amplify and its impact on J&S Food's digital food experience in terms of time to market, team productivity, product and service quality, and customer satisfaction.

Transformation Journey's Fourth Stage: Prototyping the Smart Shopping Bag's Application

This third step of the smart shopping bag development process of the experiment with the digital business phase is part of J&S Food's digital products and services design approach; it's a key element of the architectural spike session. The goal is to identify and mitigate the technological and technical risks of the AWS innovation services like Internet of Things (IoT) and microservices architectures while developing the smart shopping bag prototype that will serve as the baseline for implementing the final product.

Figure 13.1 shows where the team currently stands in the company's digital transformation journey.

Schematic illustration of J and S Food's prototyping using AWS Amplify.

Figure 13.1: J&S Food's prototyping using AWS Amplify

As Figure 13.1 illustrates, the digital product and service prototyping process includes the following steps:

  • Sharing the goal and approach of the prototyping process using AWS Amplify
  • Prototyping the smart shopping bag application
  • Prototyping J&S Food's business logic, technological, and user interface (UI) microservices

Let's pay attention to the key aspects of J&S Food's prototyping process, which helped to increase the team's productivity and accelerate the company's time to market while simplifying the use of AWS IoT and Radio Frequency Identification (RFID) technologies.

Sharing the Prototyping Process Goal and Approach

The first thing that will attract your attention is the pivotal role played by the AWS Amplify framework in the company's prototyping process; J&S Food's smart shopping bag development team takes full advantage of its features.

Prototyping Using AWS Amplify Defined

The Scrum master asks for the team's attention as follows:

The Prototyping Iterations Using AWS Amplify

The Scrum master draws the team's attention to the iterative prototyping process represented in Figure 13.2.

Schematic illustration of J and S Food's digital product and service prototyping process.

Figure 13.2: J&S Food's digital products and services prototyping process

J&S Food's digital products and services prototyping approach is a three-step iterative process including setting up the development environment, creating and testing full stack web application prototypes, and adding back-end and front-end elements.

Let's first pay attention to what the Scrum master has to say about the smart shopping bag development environment.

Defining the Smart Shopping Bag Development Environment

The Scrum master clicks to move to the presentation's next page, as represented in Figure 13.3.

Schematic illustration of J and S Food's AWS Amplify development platform.

Figure 13.3: J&S Food's AWS Amplify development platform

Then the development team's leader enthusiastically draws the team's attention to an important point:

Single-page applications (SPAs) are apps that work inside a browser and do not require page reloading during use.

As you can see, J&S Food's new digital products and services development platform is made up of two components including the full-stack web applications development environment and the continuous integration and continuous delivery (CICD) pipeline.

The full-stack web applications development environment refers to the logical four-layer platform used for the development of both front-end (client side) and back-end (server side) portions of web applications. Let's discuss these layers.

  • Node.js  The first layer is Node.js (also known as Node). It's an open source development platform for executing JavaScript code on the server side. It's useful for developing applications requiring persistent connections from the browser to the server. It's suited for applications such as chat, news feeds, and web push notifications.

    Node is intended to run on dedicated HTTP servers and to employ a single thread with one process at a time. Node.js applications are event-based and run asynchronously.

  • Node Package Manager  The second layer is Node Package Manager (npm). npm has two purposes: The first is to serve as an online repository for the publishing of open source Node.js projects. Examples of such projects include Angular, React, and jQuery. The second purpose is to act as a command-line utility for interacting with this repository, which aids in package installation, version management, and dependency management. npm is a package manager for the JavaScript programming language maintained by npm, Inc.
  • AWS Amplify Command Line Interface  The AWS Amplify command-line interface (CLI) is the third layer. It's a rich set of commands that are included in a unified toolchain used to create, integrate, and manage the AWS cloud services for applications.

    Amplify CLI makes it easy to create and configure AWS cloud services as needed on applications directly from local environments. Amplify CLI uses AWS CloudFormation (AWS infrastructure as code capability) to allow developers to add or modify configurations locally before they push them for execution.

  • Amplify Project   The Amplify project organizes application resources into folders. Folders are the locations where utilities including Amplify CLI and NPM store application resources. React applications are stored in the react-amplified folder, while the application sources are stored in the Amplify folder, respectively, in the subfolders src and backend.

    The back-end subfolder's purpose is to store the back-end component sources such as GraphQL APIs and Lambda function sources, while the src subfolder stores the front-end element sources.

The other key element of J&S Food's digital products and services development platform is the AWS Amplify deployment workflow. It's integrated to the company's Git repository.

Each time a new release of the back-end, front-end, and application elements is pushed to the Git repository, it automatically triggers the build and staging test processes and then deploys the recent version of the prototype.

The Scrum master next focuses the conversation on more strategic concerns that are closer to the CIO's interests:

The Scrum master is right. What the organization gets is strongly modularized software that is easy to maintain, update, upgrade, and deploy. This has a strong impact on the team's productivity and, by extension, on the company's time to market.

Prototyping the Smart Shopping Bag

After two hours discussing their technical features, sharing tips and advice about AWS Amplify's framework, augmenting the generated code templates with smart shopping bag–specific code pieces, and performing unit tests, the microservices prototypes as well as the smart shopping bag application prototype are ready. The microservices and the smart shopping bag application will serve as the basis for validating whether the implemented architecture is suited for developing innovative digital products and services in record time.

Prototyping software based on the AWS Amplify framework allowed the Princeton team to cut in one-third the development time of similar applications.

Table 13.1 outlines the different iterations that resulted in the microservices and application prototypes.

Table 13.1: Iterations That Led to the Microservices and Application Prototypes

ITERATION # ITERATION PURPOSE CODE AND AMPLIFY CLI COMMAND EXAMPLES
1 Set up the development environment by installing Node.js and npm and Amplify CLI. Configure Amplify. In order of precedence:
  1. sudo yum install -y nodejs
  2. npm install -g @aws-amplify/cli
  3. amplify configure
2 Installed necessary libraries for using Amplify on the client side of the application. Npm install aws-amplify @aws-amplify/ui-react
3 Initialized Amplify and created a new Amplify project. amplify init
4 Made the smart shopping bag application aware of the AWS cloud resources by editing the file App.js whose purpose is to act as a basic HTTP web server to handle your web app startup, routing, and other functions. Add the following lines in the App.js file:
  1. Import Amplify from ‘aws-amplify’
  2. Import config from ‘./aws-exports’
  3. Amplify.configure (config)
5 Created the smart shopping bag application's GraphQL APIs, answered related questionnaire, and deployed the APIs. In order of precedence until expected scalability and reusability objectives are achieved:
  1. amplify add api (select GraphQL)
  2. amplify push
6 Added Lambda functions (microservices) to the smart shopping bag back-end elements, answered the related questionnaire, and pushed the function to the AWS cloud and tested it. In order of precedence until expected scalability and reusability objectives are achieved:
  1. amplify add function
  2. amplify push -y
  3. amplify console function
7 Connected front-end elements to the API to enable interactions between the user interface and the API. See references “Connect frontend to API.”

The Scrum master elaborates on the pivotal role of AWS Amplify in the new prototyping process:

Approving the Smart Shopping Bag Prototype

In the validation meeting involving the development team including the Scrum master and the product owner, participants attend a demonstration of the smart shopping bag application development process using the microservices.

The development team then rates the microservices architecture based on the criteria defined in Table 13.2 inspired from Martin Fowler's principles. Martin Fowler is a noted authority on software techniques and an early proponent of microservices-based development.

Table 13.2: Microservices Architecture Validation Criteria

CRITERIA DESCRIPTION APPROVAL RATE
Componentization via services The software is composed of small independent services that communicate over well-defined APIs. These small components are divided so that each of them does just one thing—and does it well—while cooperating to deliver a full-featured application. 100%
Organized around business capabilities When architecture and capabilities are organized around atomic business functions, dependencies between components are loosely coupled. As long as there is a communication contract between services and teams, each team can run at its own speed. 100%
Products not projects To stay healthy, simplify operations, and increase efficiency, your engineering organization should treat software components as products that can be iteratively improved and that are constantly evolving. 90%
Smart endpoints and dumb pipes Use message brokers. Microservice architectures favor these tools because they enable a decentralized approach in which the endpoints that produce and consume messages are smart, but the pipe between the endpoints is dumb. 90%
Decentralized governance Decentralized governance means that each team can use its expertise to choose the best tools to solve their specific problem. Forcing all teams to use the same tools isn't reasonable because the problems they're solving aren't uniform. 25%
Decentralized data management Decentralized data management enhances application design by allowing the best data store for the job to be used. Since each service team owns its own data, its decision-making becomes more independent. 25%
Infrastructure automation Microservices not only need disposable infrastructure as code, but they also need to be built, tested, and deployed automatically. Continuous integration and continuous delivery are indispensable for microservices. Each service needs its own pipeline, one that can accommodate the various and diverse technology choices made by the team. 100%
Design for failure Similarly, as microservices interact with each other over the network more than they do locally and synchronously, connections need to be monitored and managed. Latency and timeouts should be assumed and gracefully handled. More generally, microservices need to apply the same error retries and exponential backoff principles as advised with applications running in a networked environment. 100%
Evolutionary design As a result of the evolutionary design principle, a service team can build the minimum viable set of features needed to stand up the stack and roll it out to users. The development team doesn't need to cover edge cases to roll out features. Instead, the team can focus on the needed pieces and evolve the design as customer feedback comes in. At a later stage, the team can decide to refactor after they feel confident that they have enough feedback. 100%

The Prototyping Team

As to the prototyping team, remarkable changes occurred in the team's overall behavior. These changes included individual and collective enthusiasm, a constant search for consensus, a problem-solving spirit, and a collaboration mindset.

Table 13.3 outlines the prototyping team's structure, roles, and responsibilities.

Table 13.3: The Prototyping Team's Structure, Roles, and Responsibilities

ROLES RESPONSIBILITIES
Product owner Defined and refined the smart shopping bag's overall UI. Detailed business rules and approved the overall smart shopping bag prototype.
Scrum master Facilitated the prototyping effort. Enforced the agile rules of the game. When needed, clarified misunderstandings.
AWS solutions architect Provided AWS Amplify and Node.js expertise. Clarified AWS modern application development framework misunderstandings.
Development team's leader Developed business logic, technological, and user interface microservices. Assembled the smart shopping bag application using microservices.

The Scrum master explains this success as follows:

The Team's Feedback

The Princeton development team favorably rated (see Table 13.2) the new digital products and services prototyping process. Figure 13.4 confirms the general satisfaction.

Schematic illustration of J and S Food's Princeton development team's satisfaction with the prototyping process.

Figure 13.4: J&S Food's Princeton development team's satisfaction with the prototyping process

The majority of J&S Food's implementation team is satisfied with the prototyping process. The entire team (100 percent) thinks that the prototyping process's ability to meet the componentization, organization around business capabilities, infrastructure automation, and design for failure requirements is likely to allow the company to deliver repeatedly any digital product and service prototype in record time.

Ninety percent of the team (that's significant!) think that the new prototyping process is likely to help them tackle digital products and services development as business initiatives and not as IT development projects.

However, only 25 percent of the team think that the new prototyping process helps enough to decentralize the digital products and services development and management effort. The reason why is that the Princeton team is small, and it is dealing with a single digital product and service.

Let's discuss the application and related microservices that resulted from the prototyping session.

The Smart Shopping Bag Application Prototype

The use case and sequence diagrams defined in Chapter 11 and the package diagrams assembled in Chapter 12 were a solid foundation for identifying the functions and data that would support the smart shopping bag's operations.

The challenge in this prototyping session was to identify among these functions those that are suited to become microservices.

Table 13.4 illustrates the microservices discovery table along with the class functions identified as potential microservices.

The following sections detail the business logic, UI, and technological microservices identified by the development team.

Table 13.4: Microservices Discovery Table

USE CASE FUNCTION FUNCTION FUNCTION FUNCTION FUNCTION
Start Shopping Session Class: Smart Mobile Device Function: Interpret Customer Input() Class: IoT Gateway Function: Initialize IoT() Connection () Class: AWS IoT Core Function: Establish IoT() Connection ()
Respond to In-Store Customer Button Presses Class: IoT Gateway Function: Relay Customer Input() Class: AWS IoT Core Function: Relay Customer Input() Class: Smart Shopping Bag App Function: Perform Related Action() Class: Smart Mobile Device Function: Display Action Performed Status()
Detect Product Code Put in Bag Class: RFID Reader Function: Detect Product Code() Class: Product RFID Tag Function: Get Product Code() Class: IoT Gateway Function: Relay Product Code() Class: AWS IoT Core Function: Relay Product Code() Class: Smart Shopping Bag App Function: Perform Related Action()
Send EEPROM Data to Billing System Class: Smart Mobile Device Function: Interpret Customer Input() Class: IoT Gateway Function: Relay Customer Input() Class: AWS IoT Core Function: Interpret Customer Input() Class: Smart Shopping Bag App Function: Collect Billing Data()
Respond to RFID Reader Queries Class: Product RFID Tag Function: Get Product Information() Class: EEPROM Function:
Put Product Information()
Calculate the Bill Amount Class: Smart Mobile Device Function: Interpret Customer Input() Class: EEPROM Function: Get Shopping Info() Class: IoT Gateway Function: Relay Shopping Info() Class: AWS IoT Core Function: Relay Shopping Info() Class: Smart Shopping Bag App Function: Calculate Bill Amount()

The Business Logic, Technological, and UI Microservices Prototyped

Developing the application prototype as well as the related microservices prototypes in only two hours was made possible because the team had the wisdom to use the UML methodology to design the smart shopping bag digital product. The resultant use case, sequence, class, and package diagrams proved to be decisive.

The following sections define how the package diagram specified in Chapter 12 simplified the implementation of the application and related microservices.

The Microservices Development Process in the AWS Amplify Context

The AWS Solutions Architect warned the participants:

AWS Amplify provides an abstraction layer that simplifies the implementation of microservices. Figure 13.5 illustrates the AWS Amplify microservices development framework.

Schematic illustration of the microservice development process in the AWS Amplify Environment.

Figure 13.5: The microservices development process in the AWS Amplify Environment

The AWS Amplify microservices development framework is logically organized into two layers that facilitate their development. These layers include the AWS Lambda layer, and the AWS Amplify abstraction layer. Let's discuss them.

The Solutions Architect proceeds as follows:

The Solutions Architect concludes the following:

Defining the Microservices Granularity

As the development team's leader explains:

The development team's leader is right. The information technology industry is overwhelmed with the hype around microservices, so it is not surprising that many do not have a more pragmatic view. In fact, microservices isn't the point; what matters most is to find the level of granularity that ensures agility, reusability, ownership, rapid go-to-market, and quality.

The AWS Solutions Architect had the ingenious idea to share the microservices discovery table (see Table 13.4). It highlighted the class functions that were invoked to implement the main use cases of the smart shopping bag digital product.

The microservices discovery rules were as follows:

  • Every class function implementing a business operation is a potential candidate for becoming a microservice.
  • All class functions used across several use cases are potential candidates for becoming microservices.
  • Potential microservices might be refined into smaller functions to meet the requirement that a microservice perform a single action and perform it well.

The Smart Shopping Bag Business Logic Microservices Implemented

In line with Martin Fowler's second recommendation, organized around business capabilities (see Table 13.2), J&S Food's microservices have been organized based on business line considerations. The business logic microservices have been organized into three categories including in-store customer, shopping session, and smart shopping bag.

Let's see how the business logic microservices work and how they are implemented.

The Smart Shopping Bag Business Logic Microservices Documented

Five functions were identified as business logic microservices including Perform Related Action(), Collect Billing Data(), Calculate Billing Amount(), Interpret Customer Input(), and Put Product Information().

Table 13.5 sums up the information to know about the business logic microservices underpinning the smart shopping bag in terms of purpose (description), APIs (endpoints), functions on which they depend (dependencies), runbooks, and documentation (onboarding guide).

All of these microservices are Lambda functions, and as back-end services they are automatically provisioned, freeing developers from the process.

Table 13.5: The Smart Shopping Business Logic Microservices Documentation

PERFORM RELATED ACTION COLLECT BILLING DATA CALCULATE BILLING AMOUNT
Description This is the main function of the smart shopping bag application. It's implemented as an AWS Lambda function. Based on the action codes provided as input, this microservice accordingly invokes other microservices to perform related business actions. This function is implemented as an AWS Lambda function to act as a microservice collecting the billing data of the in-store customer's current shopping session. This function is implemented as an AWS Lambda function to act as a microservice, calculating the billing amount of the in-store customer's current shopping session.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/
Method: GET Header: user-agent
Body: “business action”
This microservice's API is structured as follows:
URL: https://jsfood.org/billing/
Method: GET
Header: user-agent
Body: “billing data”
This microservice's API is structured as follows:
URL: https://jsfood.org/billing/
Method: GET Header: user-agent
Body: “billing amount”
Dependencies Interpret Customer Input() GraphQL Get Billing Data() Collect Billing Data()
Runbooks Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions.
Onboarding guide J&S Food's business microservices documentation. J&S Food's business microservices documentation. J&S Food's business microservices documentation.

Table 13.6 summarizes the information to know about two additional business logic microservices.

Table 13.6: Additional Smart Shopping Bag Business Logic Microservices Documentation

INTERPRET CUSTOMER INPUT PUT PRODUCT INFORMATION
Description This function is implemented as an AWS Lambda function to act as a microservice reading and interpreting the action code delivered by the IoT gateway following an action initiated by the in-store customer from the smart mobile device. This function is implemented as an AWS Lambda function to act as a microservice tracing the billing data of the in-store customer's current shopping session.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/
Method: GET
Header: user-agent
Body: “interpret action code”
This microservice's API is structured as follows:
URL: https://jsfood.org/billing/
Method: PUT
Header: user-agent
Body: “trace billing data”
Dependencies AWS IoT API Reference. AWS IoT API Reference. GraphQL Put Billing Data().
Runbooks Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions.
Onboarding guide J&S Food's business microservices documentation. J&S Food's business microservices documentation.

The Smart Shopping Bag Technological Innovation Microservices Implemented

Five categories of technological innovation microservices were identified. The purpose of these microservices is to simplify the use of the software development kit (SDK) functions of IoT, Elastic Map Reduce (EMR), and AI/ML AWS services. They were defined as part of the AWS innovation as a service in Chapter 1, “The Digital Economy’s Challenges, Opportunities, and Relevance of AWS.” Let's discuss them now.

IoT Gateway Microservices

Four functions were identified as technological microservices in the IoT gateway area including Initialize IoT Connection(), Relay Customer Input(), Relay Product Code(), and Relay Shopping Information().

Table 13.7 summarizes the information to know about the IoT gateway microservices underpinning the smart shopping bag in terms of purpose (description), APIs (endpoints), functions on which they depend (dependencies), runbooks, and documentation (onboarding guide).

Table 13.7: The Smart Shopping Bag IoT Gateway Microservices Documentation

INITIALIZE IOT CONNECTION RELAY CUSTOMER INPUT
Description This function is implemented as an AWS Lambda function to act as a microservice initiating the connection with J&S Food's AWS IoT Core platform. This function is implemented as an AWS Lambda function to act as a microservice relaying the in-store customer's action from the smart mobile device to J&S Food's AWS IoT Core platform.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/iot/
Method: POST
Header: user-agent
Body: “interpret action code”
This microservice's API is structured as follows:
URL: https://jsfood.org/iot/
Method: POST
Header: user-agent
Body: “trace billing data”
Dependencies AWS IoT Gateway API Reference. AWS IoT Gateway API Reference.
Runbooks Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions.
Onboarding guide J&S Food's technological innovation microservices documentation. J&S Food's technological innovation microservices documentation.

Table 13.8 summarizes the information to know about additional IoT Gateway microservices.

Table 13.8: The Smart Shopping Bag IoT Gateway Microservices Documentation

RELAY PRODUCT CODE RELAY SHOPPING INFORMATION
Description This function is implemented as an AWS Lambda function to act as a microservice getting a product code from the RFID tag associated with a product put in the bag. This function is implemented as an AWS Lambda function to act as a microservice getting the in-store customer's shopping information from the chip's memory and relaying them to J&S Food's AWS IoT Core.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/iot/iot-gateway
Method: GET
Header: user-agent
Body: “relay product code”
This microservice's API is structured as follows:
URL: https://jsfood.org/iot/iot-gateway
Method: PUT
Header: user-agent
Body: “relay shopping information”
Dependencies AWS IoT Gateway API Reference. AWS IoT Gateway API Reference.
Runbooks Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions.
Onboarding guide J&S Food's technological innovation microservices documentation. J&S Food's technological innovation microservices documentation.

AWS IoT Core Microservices

Five functions were identified as technological microservices in the AWS IoT Core area including Establish IoT Connection (), Relay Customer Input(), Relay Product Code(), Interpret Customer Input(), and Relay Shopping Information().

Table 13.9 sums up the information to know about the AWS IoT Core microservices underpinning the smart shopping bag in terms of purpose (description), APIs (endpoints), functions on which they depend (dependencies), runbooks, and documentation (onboarding guide).

Table 13.9: The Smart Shopping Bag AWS IoT Core Microservices Documentation

ESTABLISH IOT CONNECTION RELAY CUSTOMER INPUT RELAY PRODUCT CODE
Description This function is implemented as an AWS Lambda function to act as a microservice establishing the connection with J&S Food's AWS IoT Core platform. This function is implemented as an AWS Lambda function to act as a microservice interacting with the J&S Food's IoT gateway to relay the in-store customer's input to the J&S Food's AWS IoT Core platform. This function is implemented as an AWS Lambda function to act as a microservice interacting with the J&S Food's IoT gateway to relay product code extracted from the RFID tag to J&S Food's AWS IoT Core platform.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/iot/
Method: POST
Header: user-agent
Body: “establish IoT connection”
This microservice's API is structured as follows:
URL: https://jsfood.org/iot/
Method: POST
Header: user-agent Body: “relay customer input”
This microservice's API is structured as follows:
URL: https://jsfood.org/iot/
Method: POST Header: user-agent
Body: “relay customer input”
Dependencies AWS IoT Core API Reference AWS IoT Core API Reference AWS IoT Core API Reference
Runbooks Automatic and intelligent observability for AWS Lambda functions Automatic and intelligent observability for AWS Lambda functions Automatic and intelligent observability for AWS Lambda functions
Onboarding guide J&S Food's technological innovation microservices documentation J&S Food's technological innovation microservices documentation J&S Food's technological innovation microservices documentation

Table 13.10 summarizes the information to know about additional AWS IoT Core microservices.

Table 13.10: Additional Information About AWS IoT Core Microservices Documentation

INTERPRET CUSTOMER INPUT RELAY SHOPPING INFORMATION
Description This function is implemented as an AWS Lambda function to act as a microservice interpreting action codes relayed by the IoT gateway to the proper microservice to invoke. This function is implemented as an AWS Lambda function to act as a microservice relaying the in-store customer's shopping information issued by the IoT gateway to the J&S Food's AWS IoT Core.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/iot/
Method: GET
Header: user-agent
Body: “interpret customer input”
This microservice's API is structured as follows:
URL: https://jsfood.org/iot/iot-gateway
Method: POST
Header: user-agent
Body: “relay shopping information”
Dependencies AWS IoT Core API Reference. React Component Libraries. AWS IoT Core API Reference.
Runbooks Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions.
Onboarding guide J&S Food's technological innovation microservices documentation. J&S Food's technological innovation microservices documentation.

RFID Reader Microservices

Three functions were identified as technological microservices in the RFID Reader area including Detect Product Code(), Put Product Information(), and Get Shopping Information().

Table 13.11 sums up the information to know about the RFID Reader microservices underpinning the smart shopping bag in terms of purpose (description), APIs (endpoints), functions on which they depend (dependencies), runbooks, and documentation (onboarding guide).

Table 13.11: The RFID Reader Microservices Documentation

DETECT PRODUCT CODE PUT PRODUCT INFORMATION GET SHOPPING INFORMATION
Description This function is implemented as an AWS Lambda function to act as a microservice detecting and extracting the product codes and information, as well as the shopping session information associated with the product RFID tags. This function is implemented as an AWS Lambda function to act as a microservice recording in the RFID reader chip's memory, the product code and information extracted from the product RFID tags, as well as the shopping session information. This function is implemented as an AWS Lambda function to act as a microservice getting shopping session information recorded in the RFID reader chip's memory.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/rfid/
Method: GET
Header: user-agent
Body: “detect product code”
This microservice's API is structured as follows:
URL: https://jsfood.org/rfid/
Method: PUT
Header: user-agent
Body: “put product information”
This microservice's API is structured as follows:
URL: https://jsfood.org/rfid/
Method: GET
Header: user-agent
Body: “get shopping information”
Dependencies AWS RFID Reader API Reference. AWS RFID Reader API Reference. Detect Product Code(). Get Shopping Information(). AWS RFID Reader API Reference. Detect Product Code().
Runbooks Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions.
Onboarding guide J&S Food's technological innovation microservices documentation. J&S Food's technological innovation microservices documentation. J&S Food's technological innovation microservices documentation.

RFID Tag Microservices

Two functions were identified as technological microservices in the RFID Tag area including Get Product Code() and Get Product Information().

Table 13.12 sums up the information to know about the RFID Tag microservices underpinning the smart shopping bag in terms of purpose (description), APIs (endpoints), functions on which they depend (dependencies), runbooks, and documentation (onboarding guide).

Table 13.12: The Information About the RFID Tag Microservices Documentation

GET PRODUCT CODE GET PRODUCT INFORMATION
Description This function is implemented as an AWS Lambda function to act as a microservice interpreting action codes relayed by the IoT gateway to the proper microservice to invoke. This function is implemented as an AWS Lambda function to act as a microservice relaying the in-store customer's shopping information issued by the IoT gateway to the J&S Food's AWS IoT Core.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/rfid/
Method: GET
Header: user-agent
Body: “interpret customer input”
This microservice's API is structured as follows:
URL: https://jsfood.org/iot/rfid
Method: POST
Header: user-agent
Body: “relay shopping information”
Dependencies AWS RFID Reader API Reference. AWS RFID Reader API Reference.
Runbooks Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions.
Onboarding guide J&S Food's technological innovation microservices documentation. J&S Food's technological innovation microservices documentation.

The Smart Shopping Bag UI Microservices Implemented

Two functions were identified as technological microservices in the user interface (UI) area including Interpret Customer Input() and Display Action Performed Status().

Table 13.13 sums up the information to know about the UI microservices underpinning the smart shopping bag in terms of purpose (description), APIs (endpoints), functions on which they depend (dependencies), runbooks, and documentation (onboarding guide).

Table 13.13: The Information to Know About the UI Microservices Documentation

INTERPRET CUSTOMER INPUT DISPLAY ACTION PERFORMED STATUS
Description This function is implemented as an AWS Lambda function to act as a microservice interpreting the information entered by in-store customers from their smart mobile device. This function is implemented as an AWS Lambda function to act as a microservice displaying on the customer's smart mobile device, information returned from the smart shopping bag application.
Endpoints This microservice's API is structured as follows:
URL: https://jsfood.org/amplify/
Method: GET
Header: user-agent
Body: “interpret customer input”
This microservice's API is structured as follows:
URL: https://jsfood.org/amplify/
Method: POST
Header: user-agent
Body: “display shopping session information”
Dependencies React Component Libraries. React Component Libraries.
Runbooks Automatic and intelligent observability for AWS Lambda functions. Automatic and intelligent observability for AWS Lambda functions.
Onboarding guide J&S Food's technological innovation microservices documentation. J&S Food's technological innovation microservices documentation.

Key Takeaways

Developing innovative digital products and services in a tense competitive environment requires controlled risk management, an ability to accelerate delivery, and a capability to guarantee the expected superior digital experience.

As illustrated by the smart shopping bag digital product prototyping process discussed in this chapter, the prototyping approach automated by the AWS Amplify CICD workflow was definitely one that makes it possible to control the risk, accelerate delivery, and meet quality requirements.

In this chapter, you learned that automating the digital products and services prototyping process using the AWS Amplify framework was likely to divide the prototyping effort and time in half.

You also learned about how certain AWS Amplify CLI utilities acted as code generators to simplify and accelerate not only the development of GraphQL and Lambda function APIs but also the implementation of data models. These features make the company's digital product and development practices consistent with AWS modern application development.

Finally, you learned about the importance of the AWS Amplify CICD workflow in automating the build, acceptance test, and deploy stages, which made J&S Food's digital products and services development platform consistent with DevOps principles and philosophy.

References

  1. 1.  Amplify Docs, “Installation: Install the Amplify CLI,” Amplify Docs (2021). https://docs.amplify.aws/cli/start/install
  2. 2.  Nader Dabit and Rene Brandel, “How to Use Lambda Layers with the Amplify CLI” AWS Blog (July 07, 2020). https://aws.amazon.com/blogs/mobile/how-to-use-lambda-layers-with-the-amplify-cli/
  3. 3.  Amplify Docs, “Set Up Fullstack Project,” Amplify Docs (2021). https://docs.amplify.aws/start/getting-started/setup/q/integration/react-native/
  4. 4   Amplify Docs, “Connect frontend to API,” Amplify Docs (2020). https://docs.amplify.aws/start/getting-started/data-model/q/integration/react-native/#connect-frontend-to-api
  5. 5.  AWS, “Error Retries and Exponential Backoff in AWS,” AWS (2020). https://docs.aws.amazon.com/general/latest/gr/api-retries.html
  6. 6.  AWS, “Running Containerized Microservices on AWS,” AWS. (2020). https://docs.aws.amazon.com/whitepapers/latest/running-containerized-microservices/welcome.html