This page documents the software design details for the MyAppBooth
web application which mainly supports user authentication, App item search and payment checkout features
Note: this MyAppBooth
is GCP version (ElasticSearch server on GCE, media file storage on GCS). For the AWS version (ElasticSearch server on EC2, media file storage on S3), please refer to my_app_booth_aws_version, the overall software architecture is the same.
-
Frontend
- Framework: React
- Programming Language: JSX (converted to client browser compatible JS version via Babel under the hood)
- Backend: node.js
-
Backend
- Developer Environment: Google Compute Engine (GCE) virtual machine
- Programming Language: Go
- CORS Policy: enabled as ok
Figure 1. Frontend software architecture
This is the main application component
- Layout
- Header
- Display user menu if user is logged in
- Content
- Display LoginForm if user is not logged in
- Display HomePage if user is logged in
- Header
It supports user login function
- Form
- FormItem: username
- FormItem: password
- FormItem: login button
- SignupForm
It supports user signup function
- Form
- Form Item: username
- Form Item: password
- Form Item: signup button
It supports tab switching functions
- TabPane
- BrowseApps: search App item by title or description and support App item payment checkout function
- PostApps: upload App item by current user
- MyApps: display uploaded App item from current user and support App item deleting function
It supports App item search and payment checkout functions
- Form
- ListItem
- Card: display App item information
- Button: payment checkout App item
- Image: display App item
It supports App item uploading function
- Form
- FormItem: App item description
- FormItem: App item title
- FormItem: App item pictue
- FormItem: App item price
- FormItem: submit App item uploading button
It displays App uploaded from current user and supports App deletion function
- ListItem
- Card: display App item information
- Button: delete App item
- Image: display App item
Figure 2. Backend software architecture
The handler responses for handling specific client request redirected from HTTP router. There is a JWT middleware layer added on top of the handler to verify user authentication before handling the client request. The user authenication is JWT token based. A generated token will be sent to client once the first time user login is verified. The client request carries the token afterward for verifying the user information. The CORS request is enabled to unblocks cross domain query.
- Parse the HTTP request into App item object
- Call the
SaveApp
from the service layer for futher App uploading actions
- Parse the HTTP request into user object
- Call the
AddUser
from the service layer for further user registration actions
- Parse the HTTP request into user object
- Call the
CheckUser
from service layer for further user authentication actions
- Parse the HTTP request into title, description and username query string
- Call the
SearchApp
from service layer for further App searching actions
- Parse the HTTP request into App item id query string
- Call the
DeleteApp
from service layer for further App deletion actions
- Parse the HTTP request into App item id query string
- Call the
Checkout
from service layer for further App payment checkout actions
- Call
CreateAppWithPrice
from backend client layer to create App product id and price id via Stripe API - Call
SaveToGCS
from backend client layer to save media file for the APP item and create the media file link - Call
SaveToES
from baclend client layer to save App item metadata
- Verify the user is not existed
- Call
SaveToES
from baclend client layer to save user information metadata
- Call
ReadFromES
from baclend client layer to retrieve user information - Verify the user password
- Provide default search method
- Provide search by username only method
- Provide search by title only method
- Provide search by description only method
- Call
ReadFromES
from baclend client layer to search App items
- It allows to delete only the App items uploaded by the current user
- Call
DeleteFromES
from baclend client layer to delete App item
- Call
SearchApp
from current layer to retrieve the App item price id - Call
CreateCheckoutSession
from backend client layer to retreive the payment checkout link
- Use ElasticSearch backend client object to read data based on input query string and index
- Use ElasticSearch backend client object to save data based on input query string and index
- Use ElasticSearch backend client object to delete data based on input query string and index
- Use Google Cloud Storage backend object client to save media data
- Call Stripe API to create App item product id and price id
- Call Stripe API to retrieve App item payment checkout link based on App item price id
- NoSQL database
- Store user information and App item metadata (app basic information, media file url, product id and price id for payment checkout link query)
- Create inverted index for App item title and description
- Support fast keyword search from user input
The following figures show the schema for App item and user information in ElasticSearch (ES):
Figure 3. App item schema
Figure 4. User information schema
- Blob storage for non-structured data
- Store media files for App item
- Link of each media file is stored as metadata in ElasticSearch (ES)
-
Frontend
- Amazon Web Service (AWS) based
- Deploy frontend build package to AWS Simplify (PaaS)
-
Backend
- Google Cloud Platform (GCP) based
- Docker containerization technology
- Create Dockerfile to include deployment configuration
- Deploy the backend code package to Google App Engine [GAE] (PaaS)