Software Architecture Document (SAD)
Software Architecture Document (SAD)
Version 1.0
February, 2024
Group 7
1. Introduction...........................................................................................................................................................................
1.1. Purpose..........................................................................................................................................................................
1.2. Summary of the document............................................................................................................................................
1.3. Applicable Document....................................................................................................................................................
2. System Definition...................................................................................................................................................................
2.1. Functional Requirements...............................................................................................................................................
2.2. Design Constraints........................................................................................................................................................
2.3. Quality Attribute Requirements....................................................................................................................................
2.3.1. Performance..........................................................................................................................................................
2.3.2. Security.................................................................................................................................................................
2.3.3. Availability...........................................................................................................................................................
2.3.4. Maintainability.....................................................................................................................................................
2.3.5. Interoperability.....................................................................................................................................................
2.4. Architectural Representation.........................................................................................................................................
3. References............................................................................................................................................................................
4. Glossary................................................................................................................................................................................
LIST OF FIGURES
3
Figure 1: Functional Overview....................................................................................................................10
Figure 2: Activities Flow of UC Sign Up....................................................................................................11
Figure 3: Activities Flow of UC Sign In......................................................................................................14
Figure 4: Activities Flow of UC Forgot Password......................................................................................17
Figure 9: Activities Flow of UC Add New Supermarket............................................................................24
Figure 6: Activities Flow of UC Update Supermarket................................................................................26
Figure 7: Activities Flow of UC Delete Supermarket.................................................................................28
Figure 8: Activities Flow of UC Add New Staff.........................................................................................30
Figure 9: Activities Flow of UC Update Staff.............................................................................................32
Figure 11: Activities Flow of UC Search Staff............................................................................................36
Figure 12: Activities Flow of UC Add New Order......................................................................................39
Table 25: Description of UC Update Order.................................................................................................41
Figure 13: Activities Flow of UC Update Order........................................................................................41
Figure 14: Activities Flow of UC Delete Order...........................................................................................44
Figure 15: Activities Flow of UC Search Order..........................................................................................46
Figure 16: Activities Flow of UC Add New Voucher.................................................................................48
Figure 17: Activities Flow of UC Update Voucher.....................................................................................50
Figure 18: Activities Flow of UC Delete Voucher......................................................................................52
Figure 19: Activities Flow of UC Search Voucher......................................................................................54
Figure 20: Activities Flow of UC Add New Product..................................................................................57
Figure 21: Activities Flow of UC Update Product......................................................................................59
Figure 22: Activities Flow of UC Delete Product.......................................................................................61
Figure 23: Activities Flow of UC Search Product.......................................................................................63
Figure 24: Activities Flow of UC Add New Product Group.......................................................................64
Figure 25: Activities Flow of UC Update Product Group...........................................................................66
Figure 26: Activities Flow of UC DeleteProduct Group.............................................................................68
Figure 27: Activities Flow of UC Search Product Group............................................................................70
Figure 28: Activities Flow of UC Add New Supplier.................................................................................72
Figure 29: Activities Flow of Update Supplier............................................................................................74
Figure 30: Activities Flow of Delete Supplier.............................................................................................76
Figure 31: Activities Flow of Search Supplier............................................................................................78
Figure 32: Activities Flow of Add New Customer......................................................................................79
4
Figure 33: Activities Flow of Update Customer..........................................................................................81
Figure 34: Activities Flow of Delete Customer...........................................................................................83
Figure 35: Activities Flow of Search Customer..........................................................................................85
Figure 36: Activities Flow of Add New Import Order................................................................................86
Figure 37: Activities Flow of Update Import Order....................................................................................88
Figure 38: Activities Flow of Delete Import Order.....................................................................................89
Figure 39: Activities Flow of Search Import Order.....................................................................................91
Figure 40: Activities Flow of Add New Warehouse...................................................................................92
Figure 41: Activities Flow of Update Warehouse.......................................................................................94
Figure 42: Activities Flow of Delete Warehouse........................................................................................96
Figure 43: Activities Flow of Search Warehouse........................................................................................97
Figure 44: Activities Flow of View Report and Statistics...........................................................................99
Figure 45: Activities Flow of Sign Out.....................................................................................................101
Figure 46: Logical View............................................................................................................................110
Figure 47: Front-end structure...................................................................................................................112
Figure 48: Activities Flow of Data View...................................................................................................114
Figure 49: Deployment View.....................................................................................................................120
Figure 50: MVC Model.............................................................................................................................121
5
LIST OF TABLES
Table 1: Applicable Document....................................................................................................................11
Table 2: Description of UC Sign Up............................................................................................................13
Table 3: Business Requirements of UC Sign Up.........................................................................................15
Table 4: Description of UC Sign In.............................................................................................................16
Table 5: Business Requirements of UC Sign In..........................................................................................18
Table 6: Description of UC Forgot Password..............................................................................................19
Table 7: Business Requirements of UC Forgot Password...........................................................................25
Table 8: Description of UC Add New Supermarket....................................................................................26
Table 10: Business Requirements of UC Add New Supermarket...............................................................28
Table 11: Description of UC Update Supemartket......................................................................................29
Table 12: Business Requirements of UC Update Supemartket...................................................................30
Table 13: Description of UC Delete Supemartket.......................................................................................31
Table 14: Business Requirements of UC Delete Supemartket....................................................................32
Table 15: Description of UC Add New Staff...............................................................................................32
Table 16: Business Requirements of UC Add New Staff............................................................................34
Table 17: Description of UC Update Staff.................................................................................................35
Table 18: Business Requirements of UC Update Staff...............................................................................36
Table 19: Description of UC Delete Staff....................................................................................................37
Table 20: Business Requirements of UC Delete Staff................................................................................38
Table 21: Description of UC Search Staff..................................................................................................39
Table 22: Business Requirements of UC Search Staff...............................................................................40
Table 23: Description of UC Add New Order............................................................................................41
Table 24: Business Requirements of UC Add New Order.........................................................................43
Table 25: Description of UC Update Order.................................................................................................44
Table 26: Business Requirements of UC Update Order.............................................................................45
Table 27: Description of UC Delete Order.................................................................................................46
Table 28: Business Requirements of UC Delete Order..............................................................................48
Table 29: Description of UC Search Order.................................................................................................49
Table 30: Business Requirements of UC Search Order..............................................................................50
Table 31: Description of UC Add New Voucher........................................................................................50
Table 32: Business Requirements of UC Add New Voucher.....................................................................52
Table 33: Description of UC Update Voucher...........................................................................................52
6
Table 34: Business Requirements of UC Update Voucher.........................................................................54
Table 35: Description of UC Delete Voucher.............................................................................................54
Table 36: Business Requirements of UC Delete Voucher..........................................................................56
Table 37: Description of UC Search Voucher............................................................................................57
Table 38: Business Requirements of UC Search Voucher.........................................................................58
Table 39: Description of UC Add New Product.........................................................................................59
Table 40: Business Requirements of UC Add New Product......................................................................60
Table 41: Description of UC Update Product.............................................................................................61
Table 42: Business Requirements of UC Update Product..........................................................................62
Table 43: Description of UC Delete Product..............................................................................................63
Table 44: Business Requirements of UC Delete Product...........................................................................65
Table 45: Description of UC Search Product.............................................................................................65
Table 46: Business Requirements of UC Search Product...........................................................................66
Table 47: Description of UC Add New Product Group..............................................................................67
Table 48: Business Requirements of UC Add New Product Group...........................................................68
Table 49: Description of UC Update Product Group..................................................................................68
Table 50: Business Requirements of UC Update Product Group...............................................................69
Table 51: Description of UC Delete Product Group...................................................................................70
Table 52: Business Requirements of UC Delete Product Group................................................................72
Table 53: Business Requirements of UC Search Product Group...............................................................73
Table 54: Business Requirements of UC Search Product Group...............................................................74
Table 55: Description of UC Add New Supplier........................................................................................75
Table 56: Business Requirements of UC Add New Supplier.....................................................................76
Table 57: Description of UC Update Supplier............................................................................................77
Table 58: Business Requirements of UC Update Supplier.........................................................................78
Table 59: Description of UC Delete Supplier..............................................................................................79
Table 60: Business Requirements of UC Delete Supplier..........................................................................80
Table 61: Description of UC Search Supplier............................................................................................80
Table 62: Business Requirements of UC Search Supplier..........................................................................81
Table 63: Description of UC Add New Customer......................................................................................82
Table 64: Business Requirements of UC Add New Customer...................................................................83
Table 65: Description of UC Update Customer..........................................................................................84
Table 66: Business Requirements of UC Update Customer.......................................................................85
7
Table 67: Description of UC Delete Customer...........................................................................................86
Table 68: Business Requirements of UC Delete Customer........................................................................87
Table 69: Description of UC Search Customer..........................................................................................87
Table 70: Business Requirements of UC Search Customer........................................................................88
Table 71: Description of UC Add New Import Order................................................................................89
Table 72: Business Requirements of UC Add New Import Order.............................................................90
Table 73: Description of UC Update Import Order....................................................................................90
Table 74: Business Requirements of UC Update Import Order.................................................................91
Table 75: Description of UC Delete Import Order.....................................................................................92
Table 76: Business Requirements of UC Delete Import Order..................................................................93
Table 77: Description of UC Search Import Order.....................................................................................93
Table 78: Business Requirements of UC Search Import Order..................................................................94
Table 79: Description of UC Add New Warehouse...................................................................................95
Table 80: Business Requirements of UC Add New Warehouse.................................................................96
Table 81: Description of Update Warehouse..............................................................................................96
Table 82: Business Requirements of UC Update Warehouse....................................................................98
Table 83: Description of UC Delete Warehouse........................................................................................98
Table 84: Business Requirements of UC Delete Warehouse......................................................................99
Table 85: Description of UC Search Warehouse......................................................................................100
Table 86: Business Requirements of UC Search Warehouse...................................................................101
Table 87: Description of UC View Report and Statistics.........................................................................101
Table 88: Business Requirements of UC View Report and Statistics......................................................102
Table 89: Description of UC Sign Out.....................................................................................................103
Table 90: Business Requirements of UC Add New Supermarket............................................................105
Table 91: Description of Quick Response Time........................................................................................107
Table 92: Description of Quick Reload.....................................................................................................108
Table 93: Description of Authentication....................................................................................................109
Table 94: Description of Access Permission - Role-based control............................................................109
Table 95: Description of Logging and Monitoring - Error Detection.......................................................110
Table 96: Description of Data Consistency - Concurrency.......................................................................111
Table 98: Desciption of Third-party integration........................................................................................112
Table 99: Elements in Data View..............................................................................................................123
Table 100: Terms in Documents................................................................................................................125
8
1. Introduction
1.1. Purpose
9
● Section 3 - Conclusion: This section describes conclusion and results after
applying ADD
● Section 4 - References: This section describes references, materials, documents
related to this report.
● Section 5 - Glossary: This section describes all acronyms and abbreviations you
may encounter within this document.
1.3. Applicable Document
2. System Definition
2.1. Functional Requirements
2.1.1. Functional Overview
10
Figure 1: Functional Overview
11
2.1.2. Authentication
● UC1: Sign Up
Name Sign Up
The user accesses the website, creating a new account by providing
personal information.
* Architectural Requirement:
● Security: Implement password authentication mechanisms.
Users are required to provide a password and confirm
password. As regards sign up with Google account, comply
Description with google privacy policy about data security.
● Performance: The system should handle the account
creation request within 10 seconds.
● Interoperability: Integrate services for Google Cloud for
function Sign up with Google. The system needs to use
third-party verification services like Firebase or libraries
such as EmailJS to verify the account of users.
Trigger
The user accesses the website and presses the Sign Up button.
Pre-condition The website displays 2 options for the user: Login or Sign Up. The
user does not have an account.
Post-condition A new account is created and the user is back to the Login screen.
Table 2: Description of UC Sign Up
○ Activities Flow
12
Figure 2: Activities Flow of UC Sign Up
○ Business Requirements
13
(5) BR2 Submitting Requirements:
When user clicks on “Sign Up” button, the system will validate data and
save inputted information, submit the item to administrator as the
following:
● UC2: Sign In
Name Sign In
Description The user accesses the website, creating a new account by providing
personal information.
* Architectural Requirement:
14
● Security: Implement password authentication mechanisms.
Users are required to provide a password and confirm
password. As regards sign in with Google account, comply
with google privacy policy about data security.
● Performance: The system should handle the account
creation request within 10 seconds.
● Interoperability: Integrate services for Google Cloud for
function Sign up with Google. The system needs to use
third-party verification services like Firebase or libraries
such as EmailJS to verify the account of users.
Trigger
The user accesses the website and presses the Sign In button.
Pre-condition The website displays 2 options for the user: Login or Sign Up. The
user does not have an account.
Post-condition A new account is created and the user is back to the Login screen.
15
Figure 3: Activities Flow of UC Sign In
○ Business Requirements
When user clicks on “Sign In” button, the system will validate
data and save inputted information as the following:
16
❖ If [Password] does not match with the
password of given email, the system will show
error message (MSG 15)
❖ If sign-in is successful:
Set [Last Login Date] to the current date and time.
Trigger
The user presses the Forgot Password button in the Login screen.
Pre-condition The user has created an account successfully.
Post-condition The user can reset the password by providing a new password.
Table 6: Description of UC Forgot Password
○ Activities Flow
17
Figure 4: Activities Flow of UC Forgot Password
○ Business Requirements
Activity BR Description
Code
18
(5) BR6 Submitting Requirements:
Email Templates:
❖ Send mail to user change password as the
template below:
From [email protected]
To [Email]
Cc N/A
19
Subject "Reset Password"
20
(7) BR7 Submitting Requirements:
21
● The system will show successful message (MSG 18)
○ Activities Flow
22
Figure 5: Activities Flow of UC Add New Supermarket
○ Business Requirements
Activity BR Description
Code
23
field in the system.
● The user chooses an option in the suggestion list.The
user can add [newBusinessField] to the list
❖ Image Requirements
● If (Image.size > 2MB) => MSG 018
● If (!Image.endWith(.png) || !Image.endWith(.jpeg)) =>
MSG 015
❖ Supermarket ID Requirements:
Supermarket ID must begin with “S” character
Supermarket ID must be unique
Example: S00001
Table 10: Business Requirements of UC Add New Supermarket
○ Activities Flow
24
Figure 6: Activities Flow of UC Update Supermarket
○ Business Requirements
Activity BR Description
Code
25
● UC3: Delete Supermarket
Name Delete Supermarket
Description The user accesses the website to delete the supermarket.
Actor Manager
Trigger
The user presses the “Delete” button.
Pre-condition
The supermarket needing to delete has existed in the database.
Post-condition A supermarket is deleted to the database.
○ Activities Flow
○ Business Requirements
Activity BR Description
Code
26
● The system loads the “Supermarket” screen. (Refer to
“Supermarket” list in “List Description” file)
(2) BR 14 ❖ Delete Requirements:
● User clicks on the “Delete” button.
● The system prompt a confirmation message (Refer to
MSG 006)
● If the user chooses Cancel, the system does nothing; else,
the system will delete the supplier from the database and
show message MSG 031.
Table 14: Business Requirements of UC Delete Supemartket
Trigger
The user presses Add new button.
Pre-condition The user has already logged in.
Post-condition New staff has been added to database
Table 15: Description of UC Add New Staff
○ Activities Flow
27
Figure 8: Activities Flow of UC Add New Staff
○ Business Requirements
Activity BR Description
Code
(2) BR 15 ❖ Loading Screen Requirements:
● The system loads “Add New Staff” screen.
(4) & (5) BR 16 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following:
● The system retrieves “Staff Identification”
compared to data in system
● If there is no retrieved value, the system shows an
success
● Else show an error success ( refer to MSG 021)
❖ If [Error Reason] = “Technical Fault”
28
● Set [Document Status] = “Sent to Technical Sign
Off”
❖ Else
● Set [Document Status] = “Sent to Office Sign
Off”.
If [email] <> email format → MSG 010
Require [totalBuyAmount] >=0 && [debt] >=0 → MSG
025
Table 16: Business Requirements of UC Add New Staff
Trigger
The user presses the Update icon of the product.
Pre-condition The staff needing to update has existed in the database.
Post-condition Staff has been updated to database
○ Activities Flow
29
Figure 9: Activities Flow of UC Update Staff
○ Business Requirements
Activity BR Description
Code
(2) BR 17 ❖ Loading Screen Requirements:
● The system loads “Staff Information” screen.
(4) & (5) BR 18 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following:
● The system retrieves “Staff Identification”
compared to data in system
● If there is no retrieved value, the system compared
the data from user and from system
❖ If [Error Reason] = “Technical Fault”
30
● Set [Document Status] = “Sent to Technical Sign
Off”
❖ Else
● Set [Document Status] = “Sent to Office Sign
Off”.
If [email] <> email format → MSG 010
Require [totalBuyAmount] >=0 && [debt] >=0 → MSG
025
If all data is correct → MSG 023
Table 18: Business Requirements of UC Update Staff
Trigger
The user presses the Delete icon of the product.
Pre-condition Staff needing to be deleted have existed in the system.
Post-condition Staff is deleted from database
Table 19: Description of UC Delete Staff
○ Activities Flow
31
Figure 10: Activities Flow of UC Delete Staff
○ Business Requirements
Activity BR Description
Code
(2) BR 19 ❖ Loading Screen Requirements:
● The system loads “Delete Staff” screen.
(5) BR 20 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following:
● The system retrieves “Staff Identification”
compared to data in system
● If there is no retrieved value, the system will
32
prompt to user ( refer to MSG 006)
● If user choose confirm → the system will delete
staff data
● Else If user choose cancel, the system does nothing
Table 20: Business Requirements of UC Delete Staff
Trigger
The user enters the name of the staff in the search box.
The list of staff matching with the keyword that is provided by the
Pre-condition
user is displayed.
Post-condition The system shows the staff information.
○ Activities Flow
33
Figure 11: Activities Flow of UC Search Staff
○ Business Requirements
Activity BR Description
Code
(1) BR 21 ❖ Loading Screen Requirements:
● The system loads the “Search Staff” screen.
(5) BR 22 ❖ Search Requirements:
● When user enter text in search textinput, the
032.
Table 22: Business Requirements of UC Search Staff
34
2.1.5. View Sale
● UC1: Add New Order
Description The user accesses the website, providing information to add new
orders.
* Architecture Requirement
● Performance: Ensure the website loads quickly and
remains responsive, even under heavy load, aiming for a
load time of under 5 seconds.
● Modifiability: Ensure data consistency and concurrency. In
scenarios where one staff member adds/updates/deletes an
order and removes a product from the shelf, it is crucial that
this change is immediately reflected across the system to
prevent other staff members from seeing outdated
information. This ensures that all actions taken based on the
data are accurate and based on the current state of the data.
Actor Manager/ Staff
Trigger
The user presses Add new button.
○ Activities Flow
35
Figure 12: Activities Flow of UC Add New Order
○ Business Requirements
Activity BR Description
Code
36
show in product table
❖ The user will tick the product which they want to buy and
choose quantity of product ( typeof [quantity] =”number”)
❖ The user choose my voucher to apply for this order
❖ If a user has any note for an employee. The user can enter
their note for their order
(4) & (5) BR 25 After the user submit data, the system will validate this
information
If success, save data into database
If fail, notify to user
Table 24: Business Requirements of UC Add New Order
Trigger
The user presses the Update icon of the order.
Pre-condition The order needing to update has existed in the database.
Post-condition Order has been updated to database
○ Activities Flow
37
Figure 13: Activities Flow of UC Update Order
○ Business Requirements
Activity BR Description
Code
(3) BR 27 The user only can change note field in order (optional)
38
Name Delete Order
Description The user accesses the website to delete order.
* Architecture Requirements:
● Modifiability: Ensure data consistency and concurrency. In
scenarios where one staff member adds/updates/deletes an
order and removes a product from the shelf, it is crucial that
this change is immediately reflected across the system to
prevent other staff members from seeing outdated
information. This ensures that all actions taken based on the
data are accurate and based on the current state of the data.
Actor Manager
Trigger
The user presses the Delete icon of the order.
Pre-condition Order needing to be deleted have existed in the system.
Post-condition Order is deleted from database
Table 27: Description of UC Delete Order
○ Activities Flow
39
Figure 14: Activities Flow of UC Delete Order
○ Business Requirements
Activity BR Description
Code
40
to data in system
If there is no retrieved value, the system will prompt to
user (refer to MSG 032)
If validate data successfully, the order will be deleted
and shows a successful message (refer to MSG
031).
Table 28: Business Requirements of UC Delete Order
Trigger
The user enters the name of the order in the search box.
The list of order matching with the keyword that is provided by the
Pre-condition
user is displayed.
Post-condition The system shows the order information.
Table 29: Description of UC Search Order
○ Activities Flow
41
Figure 15: Activities Flow of UC Search Order
○ Business Requirements
Activity BR Description
Code
(2) BR 30 ❖ Loading Screen Requirements:
● The system loads the “Search Order” screen.
(5) BR 31 ❖ Search Requirements:
When user enter keywords in search text input, the
system query data from this value
If [orderName] includes [searchValue]=== true, the
system show product data
If [dataResult].length===0, the system shows MSG
032.
Table 30: Business Requirements of UC Search Order
42
2.1.6. View Voucher
Description The user accesses the website, providing information to add new
voucher.
Actor Manager
Trigger
The user presses Add new button.
○ Activities Flow
43
Activity BR Description
Code
(2) BR 31 ❖ Loading Screen Requirements:
● The system loads “Add New Voucher” form.
(5) BR 32 Submitting Requirements:
If (voucherName == “”) → MSG 009
If (publicDate < expiredDate) → MSG 043
If (publicDate or expiredDate is not in date
format ) → MSG 044
If (discountAmount is not in number format) →
MSG 045
If (discountAmount < 0 || discountAmount > 1) →
MSG 046
Table 32: Business Requirements of UC Add New Voucher
Trigger
The user presses the Update icon of the voucher.
Pre-condition The voucher needing to update has existed in the database.
Post-condition Voucher has been updated to database
○ Activities Flow
44
Figure 17: Activities Flow of UC Update Voucher
○ Business Requirements
Activity BR Description
Code
(2) BR 33 ❖ Loading Screen Requirements:
● The system loads “Update Voucher” screen.
(4) & (5) BR 34 Submitting Requirements:
If (voucherName == “”) → MSG 009
If (publicDate < expiredDate) → MSG 043
If (publicDate or expiredDate is not in date
format ) → MSG 044
If (discountAmount is not in number format) →
MSG 045
If (discountAmount < 0 || discountAmount > 1) →
MSG 046
Table 34: Business Requirements of UC Update Voucher
45
● UC3: Delete Voucher
Trigger
The user presses the Delete icon of the voucher.
Pre-condition Voucher needing to be deleted have existed in the system.
Post-condition Voucher is deleted from database
Table 35: Description of UC Delete Voucher
○ Activities Flow
○ Business Requirements
46
Activity BR Description
Code
(2) BR 35 ❖ Loading Screen Requirements:
● The system loads “Voucher” screen.
(4) & (5) BR 36 ❖ Submitting Requirements:
When the user clicks on “Delete”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following:
● The system retrieves “voucherId” compared to
data in system
● If user choose delete product, the system delete
voucher information by voucherId
● else the system does nothing
Table 36: Business Requirements of UC Delete Voucher
Trigger
The user enters the name of the voucher in the search box.
The list of order matching with the keyword that is provided by the
Pre-condition
user is displayed.
47
Post-condition The system shows the voucher information.
Table 37: Description of UC Search Voucher
○ Activities Flow
○ Business Requirements
Activity BR Description
Code
(2) BR 37 ❖ Loading Screen Requirements:
● The system loads “Voucher” screen.
(5) BR 38 ❖ Submitting Requirements:
1. When user enter text in search textinput, the
system query data from this value
2. If [voucherName] includes [searchValue]=== true,
the system show voucher data
3. If [dataResult].length===0, the system show MSG
032
48
Table 38: Business Requirements of UC Search Voucher
Trigger
The user presses Add new button.
Pre-condition The user has already logged in.
Post-condition New product has been added to database
Table 39: Description of UC Add New Product
○ Activities Flow
49
Figure 20: Activities Flow of UC Add New Product
○ Business Requirements
Activity BR Description
Code
(2) BR 39 ❖ Loading Screen Requirements:
● The system loads “Add New Product” screen.
(4) & (5) BR 40 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following:
● The system retrieves “productId” compared to data
in system
● If there is no retrieved value, the system shows an
success
● Else show an error success ( refer to MSG 021)
50
If [groupName] invalid || [groupId] invalid → MSG 010
If [cost_price]*(1+[VAT]) < [sell_price] → MSG 027
If [productName] invalid → MSG 010
If all information correct → MSG 028
Table 40: Business Requirements of UC Add New Product
Trigger
The user presses the Update icon of the product.
Pre-condition The product needing to update has existed in the database.
Post-condition Product has been updated to database
Table 41: Description of UC Update Product
○ Activities Flow
51
Figure 21: Activities Flow of UC Update Product
○ Business Requirements
Activity BR Description
Code
(2) BR 41 ❖ Loading Screen Requirements:
● The system loads “Update Product” screen.
(4) & (5) BR 42 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following:
● The system retrieves “productId” compared to data
in system
● If there is retrieved value, the system shows an
success
● Else show an error success ( refer to MSG 021)
52
If [groupName] invalid || [groupId] invalid → MSG 010
If [cost_price]*(1+[VAT]) < [sell_price] → MSG 027
If [productName] invalid → MSG 010
If all information correct, then update product
information → MSG 029
Table 42: Business Requirements of UC Update Product
Trigger
The user presses the Delete icon of the product.
Pre-condition Product needing to be deleted have existed in the system.
Post-condition Product is deleted from database
Table 43: Description of UC Delete Product
○ Activities Flow
53
Figure 22: Activities Flow of UC Delete Product
○ Business Requirements
Activity BR Description
Code
(2) BR 43 ❖ Loading Screen Requirements:
● The system loads “Update Product” screen.
(4) & (5) BR 44 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following:
The system retrieves “productId” compared to data in
system
If there is retrieved value, the system show dialog
54
confirm delete (refer to MSG 006)
Else show an error message → MSG 030
If user choose delete product, the system delete
product information by productId
else the system does no thing
Table 44: Business Requirements of UC Delete Product
Trigger
The user enters the name of the product in the search box.
The list of product matching with the keyword that is provided by
Pre-condition
the user is displayed.
Post-condition The system shows the product.
Table 45: Description of UC Search Product
○ Activities Flow
55
Figure 23: Activities Flow of UC Search Product
○ Business Requirements
Activity BR Description
Code
(2) BR 45 ❖ Loading Screen Requirements:
● The system loads “Value Of Product” screen.
(5) BR 46 ❖ Submitting Requirements:
● When user enter text in search textinput, the
system query data from this value
● If [productName] includes [searchValue]=== true,
the system show product data
● If [dataRes].length===0, the system show MSG
032
Table 46: Business Requirements of UC Search Product
56
Description The user accesses the website, providing information to add new
product group.
Actor Manager
Trigger
The user presses Add new button.
Pre-condition The user has already logged in.
Post-condition New product group has been added to database
Table 47: Description of UC Add New Product Group
○ Activities Flow
Activity BR Description
Code
(2) BR 47 ❖ Loading Screen Requirements:
● The system loads “Add New Product Group”
57
screen.
(4)&(5) BR 48 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will validate input
information.
If [groupId] invalid || [groupName] invalid, the
system will add this group to data
Else show → MSG 033
if [shelfId] invalid || [shelfName] invalid → MSG
034
Trigger
The user presses the Update icon of the product.
Pre-condition The product group needing to update has existed in the database.
Post-condition Product group has been updated to database
Table 49: Description of UC Update Product Group
○ Activities Flow
58
Figure 25: Activities Flow of UC Update Product Group
○ Business Requirements
Activity BR Description
Code
(2) BR 49 ❖ Loading Screen Requirements:
● The system loads “Update Product Group” screen.
(4)&(5) BR 50 ❖ Submitting Requirements:
When user clicks on “Submit”, user sends their update value to
the system.
If [groupId] valid, the system will update this group
to data → MSG 035
Else show → MSG 032
If [shelfName] not in [sheftID] → MSG 034
59
Name Delete Product Group
Description The user accesses the website to delete product group.
Actor Manager
Trigger
The user presses the Delete icon of the product.
Pre-condition Product group needing to be deleted have existed in the system.
Post-condition Product group is deleted from database
Table 51: Description of UC Delete Product Group
○ Activities Flow
60
Activity BR Description
Code
(2) BR 51 ❖ Loading Screen Requirements:
● The system loads “Delete Product Group” screen.
(5) BR 52 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following:
The system retrieves “productGroupId” compared to
data in system
If there is retrieved value, the system show dialog
confirm delete (refer to MSG 006)
Else show an error message → MSG 030
If user choose delete product, the system delete
product information by productId
else the system does no thing
Table 52: Business Requirements of UC Delete Product Group
Trigger
The user enters the name of the product group in the search box.
Pre-condition The list of product group matching with the keyword that is
61
provided by the user is displayed.
Post-condition The system shows the product group.
Table 53: Business Requirements of UC Search Product Group
○ Activities Flow
Activity BR Description
Code
(2) BR 53 ❖ Loading Screen Requirements:
● The system loads the “Value Of Product Group”
screen.
(5) BR 54 ❖ Submitting Requirements:
1. When a user enters text in search textinput, the
system query data from this value.
2. If [groupName] includes [searchValue]=== true,
the system show product data
3. If [dataRes].length===0, the system show MSG
032
Table 54: Business Requirements of UC Search Product Group
62
2.1.8. View Supplier
● UC1: Add New Supplier
Trigger
The user presses Add new button.
Pre-condition The user has already logged in.
Post-condition New supplier has been added to database
○ Activities Flow
63
Figure 28: Activities Flow of UC Add New Supplier
○ Business Requirements
Activity BR Description
Code
64
● If (SupplierName.contains([number]) ) => MSG 010
❖ PhoneNumber Requirements:
● If (PhoneNumber.contain([nonNumber])) => MSG 011
● If (PhoneNumber == “” ) => MSG 009
❖ Email Requirements:
● If (!Email.includes(“@”)) => MSG 014
● If (Email.checkRightEmailFormat()) => MSG 012
❖ Image Requirements:
● If (Image.size > 2MB) => MSG 018
● If (!Image.endWith(.png) || !Image.endWith(.jpeg)) =>
MSG 015
❖ Total Buy Amount Requirements:
● If (TotalBuyAmount.contain([nonNumber])) => MSG
022
● If (TotalBuyAmount < 0) => MSG 025
❖ Debt Requirements:
● If (Debt.contain([nonNumber])) => MSG 022
● If (Debt < 0) => MSG 025
(4) BR 57 ❖ Phone Number Requirements:
If (PhoneNumber.existedInDataBase()) => MSG 013
❖ Supplier ID Requirements:
Supplier ID must begin with “P” character
Supplier ID must be unique
Example: P00001
Table 56: Business Requirements of UC Add New Supplier
65
Pre-condition The supplier needing to update has existed in the database.
Post-condition Supplier has been updated to database
Table 57: Description of UC Update Supplier
○ Activities Flow
Activity BR Description
Code
66
❖ Image Requirements:
● If (Image.size > 2MB) => MSG 018
● If (!Image.endWith(.png) || !Image.endWith(.jpeg)) =>
MSG 015
❖ Total Buy Amount Requirements:
● If (TotalBuyAmount.contain([nonNumber])) => MSG
022
● If (TotalBuyAmount < 0) => MSG 025
❖ Debt Requirements:
● If (Debt.contain([nonNumber])) => MSG 022
● If (Debt < 0) => MSG 025
(2) BR 60 ❖ Phone Number Requirements:
If (PhoneNumber.existedInDataBase()) => MSG 013
Table 58: Business Requirements of UC Update Supplier
Trigger
The user presses the Delete icon of the supplier.
Pre-condition Suppliers needing to be deleted have existed in the system.
Post-condition Supplier is deleted from database
Table 59: Description of UC Delete Supplier
○ Activities Flow
67
Figure 30: Activities Flow of Delete Supplier
○ Business Requirements
Activity BR Description
Code
68
Name Search Supplier
Description The user accesses the website, providing information to find
customers.
Actor Manager/ Staff
Trigger
The user enters the name of the supplier in the search box.
The list of customer matching with the keyword that is provided by
Pre-condition
the user is displayed.
Post-condition The system shows the supplier group.
Table 61: Description of UC Search Supplier
○ Activities Flow
○ Business Requirements
Activity BR Description
Code
69
● The system displays a search bar.
(2) BR 64 ❖ Search Requirements:
● When user enter text in search textinput, the system query
data from this value
● If [supplierName] includes [searchValue]=== true, the
system show product data
● If [dataRes].length===0, the system show MSG 032
Trigger
The user presses the Add New button.
Pre-condition The user has already logged in.
Post-condition New supplier is added to the database.
Table 63: Description of UC Add New Customer
○ Activities Flow
70
Figure 32: Activities Flow of Add New Customer
○ Business Requirements
Activity BR Description
Code
71
● If (TotalBuyAmount < 0) => MSG 025
❖ Debt Requirements:
● If (Debt.contain([nonNumber])) => MSG 022
● If (Debt < 0) => MSG 025
(4) BR 67 ❖ Phone Number Requirements:
If (PhoneNumber.existedInDataBase()) => MSG 013
❖ Customer ID Requirements:
Customer ID must begin with “P” character
Customer ID must be unique
Example: P00001
Table 64: Business Requirements of UC Add New Customer
Trigger
The user presses the Add New button.
Pre-condition The user has already logged in.
Post-condition New supplier is added to the database.
Table 65: Description of UC Update Customer
○ Activities Flow
72
Figure 33: Activities Flow of Update Customer
○ Business Requirements
Activity BR Description
Code
73
(2) BR 69 ❖ Customer Name Requirements:
● If (CustomerName == “”) => MSG 009
● If (CustomerName.contains([number]) ) => MSG 010
❖ PhoneNumber Requirements:
● If (PhoneNumber.contain([nonNumber])) => MSG 011
● If (PhoneNumber == “” ) => MSG 009
❖ Email Requirements:
● If (!Email.includes(“@”)) => MSG 014
● If (Email.checkRightEmailFormat()) => MSG 012
❖ Gender Requirements:
● The system displays radio button with 2 options: Male
and Female
❖ Total Buy Amount Requirements:
● If (TotalBuyAmount.contain([nonNumber])) => MSG
022
● If (TotalBuyAmount < 0) => MSG 025
❖ Debt Requirements:
● If (Debt.contain([nonNumber])) => MSG 022
● If (Debt < 0) => MSG 025
Trigger
The user accesses the website to delete customers.
74
Pre-condition The user has added a customer.
Post-condition Customer group is deleted from the database.
Table 67: Description of UC Delete Customer
○ Activities Flow
○ Business Requirements
Activity BR Description
Code
75
006)
If the user chooses Cancel, the system does nothing; else, the
system will delete the supplier from the database and
show message MSG 031.
Table 68: Business Requirements of UC Delete Customer
Trigger
The user enters the name of customer in the search box
Pre-condition The user has already accessed the Customer Screen.
Post-condition The list of customer matching with the keyword that is provided by
the user is displayed.
Table 69: Description of UC Search Customer
○ Activities Flow
○ Business Requirements
76
Activity BR Description
Code
○ Activities Flow
77
Figure 36: Activities Flow of Add New Import Order
○ Business Requirements
Activity BR Description
Code
(2) BR 75 ❖ Loading Screen Requirements:
● The system loads “Add New Import Order” screen.
(4) & (5) BR 76 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following.
❖ Set [isExport] = 0
if [listProduct].length<0 -> MSG 037
if [payment] <0 || [debt]<0 || [discount]<0 || [totalPayment]
<0 → MSG 038
if [warehouseName] invalid → MSG 026
if [seller] invalid → MSG 026
if [totalPayment] <> [payment]+[discount] → MSG 040
if [debt] + [totalPayment] ===[payment] + [discount] →
78
MSG 040
if [partnerId] not in database → MSG 040
Table 72: Business Requirements of UC Add New Import Order
○ Activities Flow
Activity BR Description
79
Code
(2) BR 78 ❖ Loading Screen Requirements:
● The system loads “Update Import Order” screen.
(4) & (5) BR 79 ❖ Submitting Requirements:
When user clicks on “Submit”, the system will prompt a
confirmation message. If user chooses Cancel, the system does
nothing; else, the system will save inputted information, submit
the item to appropriate approver and update the item as the
following.
If “orderId” not in list → MSG 041
Else → MSG 042
Table 74: Business Requirements of UC Update Import Order
○ Activities Flow
80
Figure 38: Activities Flow of Delete Import Order
○ Business Requirements
Activity BR Description
Code
(2) BR 80 ❖ Loading Screen Requirements:
● The system loads a “dialog warning” screen.
(3) BR 81 ❖ User choose delete/cancel
(5) BR 82 ❖ Submitting response:
When the user clicks on “Delete”, the system will delete the
import order from db and message the success notification. If the
user chooses Cancel, the system does nothing.
Table 76: Business Requirements of UC Delete Import Order
81
Description The user accesses the website, providing information to find import
order.
Actor Manager/ Staff
Trigger The user enters the name of the import order in the search box.
The list of import order matching with the keyword that is provided
Pre-condition by the user is displayed.
Post-condition The system shows the import order information.
Table 77: Description of UC Search Import Order
○ Activities Flow
○ Business Requirements
Activity BR Description
Code
(1) BR 83 ❖ Display List Import Orders:
● The system loads the “Import” screen. (Refer to
“Orders” list in “List Description” file)
● The system displays a search bar.
(3) & (5) BR 84 ❖ Search Requirements:
When user enter text in search textinput, the system
query data from this value
82
If [orderId] includes [searchValue]=== true, the
system show order data
If [dataRes].length===0, the system show MSG 032
Table 78: Business Requirements of UC Search Import Order
○ Activities Flow
83
Activity BR Description
Code
(2) BR 85 ❖ Display Form Add New Warehouse Requirements:
● The system loads the “Add New Warehouse” form.
(Refer to “Add New Warehouse” list in “List
Description” file)
(4) & (5) BR 86 ❖ Warehouse Name Requirements:
● If (WarehouseName == “”) => MSG 009
● If (CustomerName.contains([number]) ) => MSG
010
❖ Warehouse Address Requirement
● If (WarehouseName == “”) => MSG 009
❖ Warehouse Note (Optional)
○ Activities Flow
84
Figure 41: Activities Flow of Update Warehouse
○ Business Requirements
Activity BR Description
85
Code
(1) BR 87 ❖ Display Form Update Warehouse Requirements:
● The system loads the “Update Warehouse” form.
(Refer to “Update Warehouse” list in “List
Description” file)
(4) & (5) BR 88 ❖ Warehouse Name Requirements:
● If (WarehouseName == “”) => MSG 009
● If (CustomerName.contains([number]) ) => MSG
010
❖ Warehouse Address Requirement
If (WarehouseName == “”) => MSG 009
Table 82: Business Requirements of UC Update Warehouse
○ Activities Flow
86
Figure 42: Activities Flow of Delete Warehouse
○ Business Requirements
Activity BR Description
Code
(1) BR 89 ❖ Display List Warehouse Requirements:
● The system loads the “Warehouse” screen. (Refer
to “Warehouse” list in “List Description” file)
(5) BR 90 ❖ Delete Requirements:
1. User clicks on a Warehouse in a list.
2. The system prompt a confirmation message (Refer
to MSG 006)
3. If the user chooses Cancel, the system does
nothing; else, the system will delete the warehouse
from the database and show message MSG 031.
Table 84: Business Requirements of UC Delete Warehouse
87
● UC8: Search Warehouse
○ Activities Flow
○ Business Requirements
Activity BR Description
Code
(1) BR 91 ❖ Display List Warehouse Requirements:
● The system loads the “Warehouse” screen. (Refer
to “Warehouse” list in “List Description” file)
88
● The system displays a search bar.
(5) BR 92 ❖ Search Requirements:
1. When user enter text in search textinput, the
system query data from this value
2. If [warehouseName] includes [searchValue]===
true, the system show warehouse data
3. If [dataRes].length===0, the system show MSG
032
Table 86: Business Requirements of UC Search Warehouse
Trigger
The user enters the main page of the View Overview Sale Report
Pre-condition The user has signed in successfully
Post-condition The system shows reports and statistics about sales.
Table 87: Description of UC View Report and Statistics
○ Activities Flow
89
Figure 44: Activities Flow of View Report and Statistics
○ Business Requirements
Activity BR Description
Code
(2) BR 93 ❖ Loading Screen Requirements:
● The system loads the “Report and Statistics”
screen.
(5) BR 94 ❖ Display Report and Statistics Requirements:
Users choose a mode to view reports and statistics.
If the user chooses view mode “Day”, the system displays
reports by Day, with date format is DD/MM/YY.
If the user chooses view mode “Month”, the system displays
reports by Month, with label format is MM/YY.
If the user chooses view mode “Year”, the system displays
reports by Year, with label format YY.
Users choose a period (start date and end date) to view reports
and statistics
Start date <= End date
Table 88: Business Requirements of UC View Report and Statistics
90
2.1.12. Sign out
● UC 1: Sign out
○ Activities Flow
91
Figure 45: Activities Flow of Sign Out
○ Business Flow
Activity BR Description
Code
92
user can add [newBusinessField] to the list
❖ Image Requirements
● If (Image.size > 2MB) => MSG 018
● If (!Image.endWith(.png) || !Image.endWith(.jpeg)) =>
MSG 015
❖ Supermarket ID Requirements:
Supermarket ID must begin with “S” character
Supermarket ID must be unique
Example: S00001
93
● Ease of Use: The user interface (UI) must be intuitive and user-friendly, allowing
users to easily add, edit, or delete product listings, view inventory levels, and
generate reports with minimal training.
● Hosting Environment: The website should be hosted in an environment that
complies with environmental standards, focusing on minimizing the carbon
footprint, possibly using green data centers.
2.3. Quality Attribute Requirements
2.3.1. Performance
2.3.1.1. Quick Response Time
Element Statement
Stimulus A website’s software or hardware
component fails to respond when thousands
of users access the website.
Stimulus source A fault occurs in a website software or
hardware component.
Environment Many software clients are using this
service. At the time of failure, the
component may be servicing a number of
clients concurrently with other queued
requests. Occurs under both normal and
peak load conditions.
94
achieve these response times.
Response Users can login or sign up to the system in
measure ideal conditions within 10 seconds.
Each page has to be displayed to users
after 5 seconds of loading.
Database queries for product availability
checks should be optimized to respond
within 100 milliseconds to reduce blocked
time during checkout.
Table 91: Description of Quick Response Time
Element Statement
Stimulus User action triggers data refresh or page
reload, such as updating inventory,
changing prices, or switching between
different sections of the management
system. The system fails to update data.
Stimulus source User interaction through the web interface.
95
loading.
Table 92: Description of Quick Reload
2.3.2. Security
2.3.2.1. Authentication
Element Statement
Stimulus A user attempts to log in or access resources
within the system.
Stimulus source End-users, administrators, and services
accessing the system.
Environment During all user interactions with the
system, regardless of user location or
device.
Artifact Supermarket’s Products Management
Website System
Response The system authenticates user credentials
and grants access based on predefined
permissions.
Implement password authentication
mechanisms. User are required to provide a
password and confirm the password. As
regards sign up with Google account,
comply with google privacy policy about
data security.
Response Authentication processes must complete
measure within 2 seconds under normal conditions.
Element Statement
96
Stimulus A user attempts to log in or access resources
within the system.
Stimulus source End-users, administrators, and services
accessing the system.
Environment During all user interactions with the
system, regardless of user location or
device.
Artifact Supermarket’s Products Management
Website System
Response The system authenticates user credentials
and grants access based on predefined
permissions.
Implement password authentication
mechanisms. User are required to provide a
password and confirm the password. As
regards sign up with Google account,
comply with google privacy policy about
data security.
Response Authentication processes must complete
measure within 2 seconds under normal conditions.
1.1.1. Availability
1.1.1.1. Logging and Monitoring - Error Detection
97
Element Statement
Stimulus An error occurs within the system due to
software bugs, hardware failures, or external
disruptions.
Stimulus source Application components, databases, servers,
or network infrastructure.
Environment During normal operations and under
varying load conditions.
Artifact Supermarket’s Products Management
Website System
Response The system identifies the error, logs it in a
centralized logging system, and triggers
alerts to the appropriate personnel or
systems.
Implement comprehensive logging of login
attempts (successful and unsuccessful) and
system monitoring to detect and respond to
potential security incidents. Integrate Hotjar
for this requirement
Response Errors are detected and logged within
measure seconds of occurrence.
Alerts are generated and delivered to
system administrators or automated
Table response systems within 1 minute of error 95:
detection. Description
of Logging
and Monitoring - Error Detection
1.1.2. Maintainability
1.1.1.1. Data Consistency - Concurrency
98
Element Statement
Stimulus Multiple users (or automated processes)
concurrently access and/or update data
within the system.
Stimulus source Users, automated services, and system
processes interacting with the database or
data stores.
Environment During peak business operations and
during background administrative tasks.
Artifact Database management system, data access
layers of the application.
Response The system employs mechanisms to handle
concurrency, ensuring that all data
modifications are accurate and do not
interfere with each other.
Ensure data consistency and concurrency.
In scenarios where one staff member
adds/updates/deletes an order and removes
a product from the shelf, it is crucial that
this change is immediately reflected across
the system to prevent other staff members
from seeing outdated information. This
ensures that all actions taken based on the
data are accurate and based on the current
state of the data.
Response Transactions meet the ACID properties
measure (Atomicity, Consistency, Isolation,
Table Durability). 96:
1.1.2. Interoperability
1.1.2.1. Third-party integration
Element Statement
99
Stimulus Integration with a new third-party service or
updating interactions with an existing one.
Stimulus source System developers implementing or
updating integrations.
Environment Development and production environments,
under normal operation conditions.
Artifact Supermarket’s Products Management
Website System
Response The system establishes and maintains a
stable, efficient connection with third-party
services, correctly handling data exchange
and synchronization. Integrate services for
Google Cloud for function Sign up with
Google. The system need to use third-party
verification services like Firebase or library
such as EmailJS to verify the account of
users. Implement a secure and
straightforward password recovery
mechanism, allowing users to reset their
passwords through a verified email link.
Integrate with Firebase's services to send
email reset password to users.
Response Integration points are established without
measure causing disruptions to existing
functionalities.
This document presents the necessary views to represent the software architecture:
● The Logical View: presents the decomposition of the software architecture
into subsystems and packages;
● The Implementation View: describes the overall structure of the
implementation model, the decomposition of the software into layers and
subsystems.
100
● The Data View: describes the persistent data storage perspective of the
system;
● The Deployment View: describes the physical infrastructure on which the
software is deployed and run. It specifies the physical nodes and network
configuration that executes the software, and also maps the processes
defined in the Process View onto physical nodes.
1.1.1. Logical View
The Logical View presents an overview of the architecture and then provides the
decomposition of the software into design packages and subsystems.
The Supermarket’s Products Management Website System has been decomposed into
distinct modules represented in the next figure:
101
in case of data loss or system failure, the supermarket management system can be
restored to a previously saved state.
● Third parties: Third parties represent external entities or services that interact
with the supermarket management system. These can include payment gateways,
suppliers, delivery services, or other systems that integrate with the supermarket's
operations.
● Database: The database component represents the storage system where the
supermarket's data is stored. It includes information such as product details,
customer records, sales transactions, and employee information. The database
enables efficient data management and retrieval.
● Firebase: Firebase is a cloud-based development platform provided by Google. In
the supermarket management system, Firebase is used to provide additional
services like real-time data synchronization, push notifications, user
authentication, and hosting capabilities.
102
1.1.2. Implementation View
103
● src/assets/images: the folder contains all of the images in application.
● src/components: this folder contains component sub ui or group UI. Which is
used to create or save the component to use in the app. (Ex: AppText,
AppView,...)
● src/constants: the folder contains the constant number like mocks or draft which
is used in all of the application.
● src/controller: the folder contains many functions which are used to handle logic
or maintain current UI. (Ex: addDatabase,...)
● src/hooks: the folder contains util hook which is used to handle special logic (Ex:
useMedia, useGetListValue,...)
● src/routes: the folder contains many sub folders like components, routes which
are used to manage routing in the app.
● src/routes/components: the folder contains drawer components,
drawerItemComponents, link,... Which is used in the drawer feature.
● src/routes/route: the folder defines the route of the application like AppRoutes,
AuthRoutes, HomeRoutes,....
● src/state_management/actions: the folder contains action files like
ADD_ORDER, ADD_STAFF,... which is used to create action in redux state
management.
● src/state_management/reducers: the folder contains rootReducer files.
RootReducer file is used to combine many slices into one reducer.
● src/state_management/stores: the folder contains store file configuration.
● src/state_management/variables: the folder is used to define type/ interface for
application.
● src/state_management/views: the folder contains UI screens in application.
104
1.1.3. Data View
105
staffId The ID of the staff Varchar(10)
106
partner
email The email of the Varchar(50)
partner
phonenumber The phone number Varchar(10)
of the partner
address The address of the Varchar(250)
partner
gender The gender of the Varchar(10) Female
partner Male
Certificate The link of the Varchar(250)
certificate of the
supplier
totalBuyAmount The total buy Double
amount of the
partner
Debt The debt amount of Double
the partner
Note The note about the Varchar(250)
the partner
isCustomer To identify Bit
customer or
supplier
Created_date Created date of the Timestamp
object
Updated_date Updated date of the Timestamp
object
VOUCHER
voucherId The ID of the Varchar(10)
voucher
voucherName The name of the Varchar(50)
voucher
discountAmount The discount double
amount of the
voucher
expirationDate The expiration date Timestamp
of the voucher
107
publicDate The public date of Timestamp
the voucher
Created_date Created date of the Timestamp
object
Updated_date Timestamp
Updated date of the
object
ORDER
The ID of the order Varchar(10)
orderId
Note The note about the Varchar(250)
order
Payment The payment Double
amount of the order
Discount The discount double
amount of the order
partnerId The ID of the Varchar(10)
partner
createdAt The created time of Timestamp
the order
Debt The debt amount of Double
the order
Status The status of the Varchar(10) Paid
order Unpaid
Tax The tax of the order Double
108
detailId The ID for each Varchar(10)
product detail in the
order
orderId The ID of the order Varchar(10)
Created_date Timestamp
Created date of the
object
Updated_date Updated date of the Timestamp
object
WAREHOUSE
warehouseId The ID of the Varchar(10)
warehouse
warehouseName The name of the Varchar(50)
warehouse
Address The address of the Varchar(250)
warehouse
Created_date Created date of the Timestamp
109
object
Updated_date Updated date of the Timestamp
object
WAREHOUSE_PRODUCT
warehouseId The ID of the Varchar(10)
warehouse
productId The ID of the Varchar(10)
product
Quantity The quantity of Integer
product in the
warehouse
Created_date Created date of the Timestamp
object
Updated_date Updated date of the Timestamp
object
PRODUCT
productId The ID of the Varchar(10)
product
productName The name of the Varchar(50)
product
groupId The ID of the group Varchar(10)
product
Image The link of the Varchar(250)
image
Cost_price The origin price of Double
the product
VAT The VAT of the Double
product
Sell_price The price of Double
product sell to
customer
Note The note of the Varchar(250)
product
Created_date Created date of the Timestamp
object
Updated_date Updated date of the Timestamp
110
object
GROUP_PRODUCT
groupId The ID of the group Varchar(10)
product
groupName The name of the Varchar(50)
group product
Note The note of the Varchar(250)
group product
Created_date Created date of the Timestamp
object
Updated_date Updated date of the Timestamp
object
Table 99: Elements in Data View
● Front - end: users interact with a React Native application. Redux manages data
flow, ensuring predictability. Components, including Shared UI code, Code
Behind, and Designers.
111
● Database: Our chosen backend-as-a-service, empowers dynamic data
management through Realtime Database, ensuring real-time updates. For more
complex querying, Firestore enhances flexibility. The integration of the Firebase
API into backend functionality streamlines database operations efficiently.
● State management: efficiently manages the application's state, ensuring
predictability in state changes. This streamlined approach enhances stability and
facilitates a controlled flow of data, contributing to a more organized and
maintainable system.
● Deployment: React Native application is deployed on Vercel. Vercel provides a
seamless deployment experience.
● Model: Serving as the database part of the application, the Model represents data
structure, format, and constraints. It is responsible for maintaining and handling
the application's data.
● View: The View is the user interface presented to the user. Utilizing the Model, it
displays data in a user-friendly format. Users can interact with the View, and it
consists of both static and dynamic pages that are rendered or sent to the user upon
request.
112
● Controller: The Controller manages user requests, generating appropriate
responses for the Viewer. Typically, user interaction begins with the View,
generating a request handled by the Controller. The Controller then renders the
relevant View, incorporating data from the Model as the response. This tripartite
structure ensures effective handling of user interactions and response generation
within the backend system.
2. References
[1] (Sei Series in Software Engineering) Len Bass_ Paul Clements_ Rick Kazman -
Software Architecture in Practice-Addison-Wesley (2012)
[4] Microsoft Patterns Practices Team - Microsoft® Application Architecture Guide, 2nd
Edition (Patterns Practices) (2008, Microsoft Press) - libgen.lc
3. Glossary
Term Description
ADD Attribute-Driven Design
UC Use case
113