My image


For sake of demonstration, Core i solutions developed the cloud application https://www.lottopoolnation.com 
to demonstrate how we can achieve a multi tiered architecture with model view controller to develop 
a modern cloud applcation with the IBM i and DB2 database at the core of the architecture. 


LottoPoolNation is a legitmate fully functional website that tracks the lottery games POWERBALL and MEGAMILLIONS in real time 
via http api calls from the IBM i to a 3rd party company with that data (per subscription status).  Depending on the jackpot 
amounts at any given time a user makes a request to the service layer and getPools service, the jackpots are examined 
and 3 pools are calculated with different payout options based on the number of participants and presented to the user. 
If the user joins a pool, they are asked to upload images of their tickets and sign a legal agreement for pool sharing 
reasonings in the event of a win.  The user can un-enroll at any time. 
All images are stored on and retrieved from DB2 on the IBM i, and all 3rd party http API consumptions are executed via 
an sqlrpgle pgm on the IBM i and not from the .NET core application tier. 


The tiers and their relationships are as follows...
 - application tier = external webserver with .NET core (however dumb, only facilitates UI/UX and makes required calls to IBM i 
 - presentation tier = external webserver with .NET core for the gui
 - service tier = IBM i
 - data access tier - IBM i


Emphasis Services Used Description
MTA/MVC
getNextLotteryNextDrawDate
Demonstrating Multi Tiered Architecture utilizing Model View Controller
, with a modern .NET Core gui front end with IBM i and DB2 on the backend.
video
Two Factor Authentication
sendLoginInfo
chkLoginInfo
In this video we watch how the presentation 
layer accepts a phone number and email from the user and executes a 
service call from the application tier via HTTP to the service tier on the IBM i (sndLoginInfo)..
The webservice generates a random number and calls a 3rd party sms txt msg 
service (Twilio) using qsys2.http_post and sends the random code to the users 
phone sitting in front of the presentation layer.
When user receives the txt msg they input the code which submits a new service
request to the IBM i service layer (chkLoginInfo).
video
MTA/MVC
getPools
This video shows how the CoreiRST webservice calls an SQLRPGLE  
service on the IBM i (invoked from the gui front end (application tier) via http),  
and produces a response to load all the lottery pools to the .NET gui front end.
video
Image/Base64 DB2
getParticipantSettings
postParticipantSettings
In this video, we demonstrate how a service can be called to the IBM i service tier 
and retrieve/store images from/to DB2 clobs in base64 format.  Then with base64 string  
the image can be pulled from service and database tier up to the modern gui application tier 
to be displayed on the front end.  We also have a backend check in the postParticipantSettings
sqlrpgle pgm to ensure the max bite size of the image is not greater than 1.5MB. 
video