1. Introduction and Goals
1.1. Requirements Overview
The following diagram represents the functional requirements of the application.
List of requirements:
-
The system will emulate an online shop where the users will be able to select and buy products.
-
The system will calculate the shipping costs of the selected products based on the shipping information provided by the user’s pod. The price will be calculated based on distance between distribution center and client’s address.
-
The system will show the user the total price for the products selected.
-
The system will register the user’s order and will proceed with the shipping.
-
The system will show the user a list of all its orders.
1.2. Quality Goals
Nº | Quality | Motivation |
---|---|---|
1 |
Confidentiality |
The application will respect client’s privacy. Users are going to retrive their personal information stored in Solid Pods. |
2 |
Availability |
The application will be available the majority of time, specially at client reviews. System availability will always be above 97%, with about 15 hours of maintenance every three weeks. |
3 |
Usability |
The GUI will be easy to use for any user, especially non-technical users. We will do usability tests with different user profiles. |
4 |
Accesibility |
Provide equal access and opportunities to people. Increase the number of customers using the application. |
5 |
Efficiency |
Server’s response is going to be under 0.5 seconds. This value is considered the minimum acceptable waiting time by users all over the net. Waiting times upper 0.5 seconds are usually negative for websites' popularity. |
1.3. Stakeholders
Role | Description | Expectations |
---|---|---|
Client |
Fictitious company that hires us to develop DeDe application. |
They expect continuous and responsible work. In addition, a product that reflects what has been learned in the course. |
Development team + Software Architects |
Formed by group ES5A students. |
Learn about Software Architecture and teamwork. |
Users |
People interested in buying online products while maintaining their privacy. |
To have an application that allows making purchases and at the same time managing the shared data. |
Suppliers |
These are the distribution centers of the products offered in the application. |
Deliver orders to users. |
Inrupt |
Company founded by Tim Berners-Lee. |
Make known the SOLID project and promote its development. |
2. Architecture Constraints
Constraint |
Description |
SOLID |
We will use this technology so that the users´ information cannot be centralized in a server, this information will be obtained from the users´ pods, as long as they give permissions. |
React/Typescript |
Its shared use will offer us different advantages such as having a more robust and bug-proof application. |
Arc42 |
We must use this template because it is suitable for the project to be carried out, it will allow us to document it in a clear, simple and effective way. |
GitHub |
We must use this version controller. It helps us to have a good organization of the project and facilitates teamwork. |
Constraint |
Description |
Time |
Other task from other subjects will be constraints. Time spent doing them will be time we will not spend in the project. We must take advantage of our organizational skills in order to get success. |
Knowledge |
Technologies used are going to be constraints due to the few experience we have. We must improve our knowledge as soon as possible so it will be easier to work in the project. |
3. System Scope and Context
3.1. Business Context
-
Client: the main target that should pay attention to our products, he has to interact with the shop and buy products.
-
Database: the infrastructure that stores the orders generated by the client and all the information related to them.
-
Solid pod: external storage which guarantees client’s privacy and personal data management.
-
Maps API: external service of a maps' provider which is going to be the responsible of calculating the distance between client’s address and distribution center address. This distance will be used in order to calculate the price of the order.
3.2. Technical Context
-
Web browser: the application used by the client to reach a connection to the shop. It could be an application such as firefox or chrome.
-
Database: the infrastructure that stores all the information related to the shop. Orders, products, etc…
-
Solid pod: external storage which guarantees client’s privacy and personal data management. We will accede it using http requests to the web using an API key.
-
Webapp: it refers to the UI of the application. It will be the visible part of the shop called ArquiSocks developed using React.js.
-
Restapi: it is a server based on Node.js and Express that receives requests by the webapp. It will return json objects in order to satisfy webapp’s needs.
4. Solution Strategy
Decision | Reason |
---|---|
MongoDB as DBMS |
MongoDB is a non-relational model that is a good choice for this project. |
Docker for application deployment |
Docker is chosen due to its popularity and there is a lot of information about this technology. |
Visual Studio Code, WebStorm as IDE or a text editor |
At the moment, everyone can use any IDE that supports Typescript and React. Or even, it is possible to use a text editor instead of an IDE. Because the project continues working regardless of the used tool. However, an agreement may be fine to avoid potential problems. |
Decision | Reason |
---|---|
Layered Architecture |
Usage of MERN architecture allows us to easily build a 3-tier architecture entirely using only TypeScript and JSON. |
Decision | Reason |
---|---|
Online accessibility testing tools |
To achieve accessibility |
SOLID |
To achieve confidentiality |
NoSQL database |
NoSQL database provides easy and fast search and thus efficiency is achieved. |
Usability tests |
Perform usability tests throughout development and do not leave for the last moment can help detect usability problems early. |
Server provider |
Choose the server provider and the payment plan according to our needs to achieve acceptable availability. |
Decision | Reason |
---|---|
Kanban Board as work management tool |
It allows stakeholders to visualize the workflow. Also, it helps development team to organize their tasks more visually. |
Git Flow as branching strategy |
All members have experience with it and find it comfortable. |
Wiki to record of meeting minutes |
It is an integrated tool in GitHub where the project’s git repository is. |
Labels are created as needed |
For now, create labels as needed and be careful not to duplicate them. |
5. Building Block View
5.1. Whitebox Overall System
Building block view shows the static decomposition of the system into building blocks, it includes libraries, modules, components… And also the dependencies among them.
Restapi and webapp are both balck boxes which are explained more detailed scrolling down a little.
- Motivation
-
This diagram shows the relations of the application among many others systems. It also shows dependency relations with clients. This diagram provides readers a general static vision of the project.
- Contained Building Blocks
Building block |
Description |
Client |
Interacts with the application. He also takes care of his data using pods. |
Database System |
Service to store data. It is used through mongoDB atlas. Packages (npm): mongodb, mongoose. |
Solid infrastructure |
Mechanism to store data taking care of privacy. Packages (npm): inrupt/solid-ui-react |
Maps API |
API which allow us to manage distances and many other aspects related to addresses. |
ArquiSocks |
The main core of the application. |
- Important Interfaces
Interface |
Description |
nodo-fetch |
Allow us to make asynchronous requests to the maps API so we can get information about coordinates and distances among many addresses. |
mongodb and mongoose |
Optimize database connections and data management |
inrupt/solid-ui-react |
Dependency which allows us to have a connection to solid. In this way we can get information from the pods. |
5.2. Level 2
5.2.1. White Box Webapp
- Motivation
-
This diagram shows the relations among webapp components and libraries used. The main library is mui used to optimize the development of many components. It has been implemented using React library for user interfaces.
- Contained Building Blocks
Building block |
Description |
Api |
Contains functions to connect with the restapi. |
App |
Main component which contains all other components. Packages (npm): mui. |
Components |
Contains all ui components of the webapp, like cart, order, navbar, footer… Packages (npm): mui, inrupt/solid-ui-react. |
Contexts |
It allows us to share data across the components more easily. For now, the context is sharing selected products in cart. |
5.2.2. White Box Restapi
- Motivation
-
This diagram shows the relations among restapi components and libraries used.
- Contained Building Blocks
Building block |
Description |
Models |
Stores classes which represent objects from database. Packages (npm): mongodb. |
Routes |
Admin requests and redirect to the service. Includes business logic. Packages (npm): express, mongodb, node-fetch. |
Service |
Connects to database. Packages (npm): mongoose, dotenv. |
Server |
Manage users' requests. Packages (npm): express, dotenv. |
6. Runtime View
6.1. Sign in
6.2. View orders and products
Many details to keep in mind:
-
The user will interact with UI elements of the webapp such as buttons. These elements trigger events to the restapi.
-
Restapi will manage requests in order to get a response from database system. The response will be shown by the webapp in diferent views.
6.3. Add product to cart
6.4. Delete product from cart
6.5. Confirm purchase
6.6. Register the sale event
7. Deployment View
7.1. Infrastructure Level 1
- Motivation
-
The user will access our app through a website which will communicate with the Web server hosted by Heroku. Also, the user can access our app hosted in Azure. Then, the Webapp will use the RestAPI to respond the user’s requests. The RestAPI will use both MongoDB and the Solid pod from the user in order to correctly respond the WebApp request.
- Quality and/or performance features
-
The performance will depend mostly on the user’s internet connection and device hardware, since most of the infraestructure depends on external services (MongoDB, Inrupt, etc.). However, we can increase the performance of the application focusing on writing better and most efficient code.
Element |
Description |
Client |
Device use by the user to interact with the app. |
Web server |
Server where we will have the app running, in our case, Heroku. |
WebApp |
Frontend of the app. |
RestAPI |
Backend of the app. |
Database Server |
Server with our Database, in our case, MongoDB Atlas. |
Solid Pod Server |
Solid pods used by the users to store their personal information. |
8. Cross-cutting Concepts
8.1. Domain model
Element | Meaning |
---|---|
User |
Representation of users who are logged in. |
Product |
Representation of socks of the on-line shop. |
Availability |
Save the stock and size of the product. |
OrderProduct |
Represents products in orders. |
Order |
Represents confirmed orders. |
DistributionCenter |
Represents distribution centers that are in charge of send orders. |
8.2. Architecture and Design Patterns
MERN Stack is being used in the application which allows to easily create 3-tier architecture.
-
React.js is used to work with the presentation layer.
-
Express.js and Node.js are used to make up the middle or application layer.
-
MongoDB is used to create the database layer.
8.3. Package Structure
8.3.1. Level 1
The project is named dede_5a and contains the following main folders:
-
docs is the folder that stores the files related to this documentation.
-
restapi is the folder where the REST API that obtains data from the database is.
-
webapp is the folder that stores everything related to the application itself.
8.3.2. Level 2
restapi mainly contains:
-
routes defines API endpoints and they are separated by database collections.
-
models are representations of the data in the database.
-
services contains global services like database connection.
webapp mainly contains:
-
public is the folder where the static and necessary resources for the application are located: images, scripts, etc.
-
src contains the code part.
-
api contains calls to REST API to get data.
-
components are UI components that can be used across various files in the project.
-
contexts contains the state which has to be shared across these components.
-
helpers contains commonly used functions in the project.
-
8.4. User Experience (UX)
A good User Experience is a key aspect for the success of the application. The application must satisfy the needs of the users effectively. For this, several concepts must be taken into account when designing user interfaces like:
-
Usability
-
Accessibility
8.4.1. Usability
Throughout development, usability tests are carried out on different users. Each test consists of small tasks that test the implemented functionalities.
Thanks to the user’s interactions with the application, usability problems can be detected and it makes it possible to make improvements in this regard.
Usability problems make the application difficult to use and understand for users. So, it is important to avoid or reduce it.
8.4.2. Accessibility
There are different standards to follow to achieve accessibility. One of the standards is WCAG 2.0 (Level AA) which is the most used worldwide. Therefore, it is the one used in this application.
Tools to use are:
8.4.3. User interface
User interfaces should be designed with usability and accessibility in mind.
Mockups
They may not exactly match the final design, but they offer an idea of the functionality and design of the pages that the application will have.
8.5. Security
Security is another key aspect to consider. Some measures to ensure security are:
-
The application does not store private data of the user. To obtain it, the application asks the user for permission to access the Solid POD where the data is stored at the time it is needed. In this way, control of the user’s own data is guaranteed.
8.6. Availability
To achieve high availability:
-
On the one hand, try to avoid making software errors by applying the code review process by other team members. The process is carried out before joining the new code with the code that already works correctly.
-
On the other hand, enable autoscaling on the application’s service providers in case of anticipating the success of the application.
-
Moreover, we will try to have more than one deployment technology in order to increase a high availability.
8.7. Efficiency
Try to have a good code quality for better performance. We will develop many load tests which are going to simulate the state of the application as it were deployed and used by many users. There are many tools to prove that. Gatling will be the reference tool to get information of the behaviour of the app. Results will be shown in the wiki which is available in our repository in GitHub. You can follow this link
8.8. "Under the hood"
8.8.1. Persistency
The database management system used is MongoDB and the main reason is the easiness of data passing between the database and the application based on node.js. Another reason is the feature it offers: flexible schema.
8.8.2. Session handling
A node.js module, express-session, is used to handle the application session. There are many reasons:
-
Easy to incorporate into the project as it is a node.js module.
-
The session of this module is stored on the server, therefore it is more secure.
8.9. Operation concepts
8.9.1. Logging
Users just need to log in to any Solid Pod provider to use the app. There are several advantages:
-
The user does not have to register an account in the application. So he does not have to remember the password.
-
Developers do not have to deal with passwords.
9. Design Decisions
9.1. MERN Stack usage
- Context
-
We need a set of different technologies and frameworks that can work well together in order to build our project.
- Decision
-
As we are restricted to use the React framework, we might as well use these technologies (MongoDB, Express and Node.JS) knowing that there is a lot of information about them working together.
- Status
-
Accepted.
- Consequences
-
Having this much information about how to combine these technologies will help the team during the development to create a much more robust application.
9.2. Login with Solid
- Context
-
The constraint of Solid use in order to keep client’s privacy has to be done. We need something to manage the use of his data. Client must allow us to use his data when we are creating an order for example, address which is necessary to process those events.
- Decision
-
While looking for alternatives to solve this problem we found out that making a login system based in Solid was the best way. From our point of view, this decision is the easiest and also the most natural for the user while using the webapp.
- Status
-
Accepted.
- Consequences
-
This decision will improve the simplicity of the system because we will not have the need of developing an authentication system. We will only manage webIds from Solid and roles so that we will not store client’s personal info, usernames and passwords. Solid will be the responsible of users' accounts and credentials.
9.3. Shopping cart in session
- Context
-
Every e-commerce platform need a shoping cart where client can see his selection while preparing a purchase. In the same way, we have to take the decision of saving this data among many options such as database, user’s session…
- Decision
-
Finally we tend to develop it using the session instead of database. It is more natural and it is also the most realistic solution.
- Status
-
Accepted.
- Consequences
-
This decision avoids us from having an entity called shopping cart and also the risk of collapsing the database with a lot of modifying operations. We understand that the cart is something depends on client’s session and it is very related to him so it should not persist when the client is not in the session.
10. Quality Requirements
10.1. Quality Tree
10.2. Quality Scenarios
Reference |
Atribute |
Scenario |
Priority |
Dificulty |
QS.1 |
Confidenciality |
User’s personal data is retrived from their Solid pod. |
High |
Medium |
QS.2 |
Confidenciality |
Only the data necessary for the correct operation of the application will be accessed. (Name, address and profile photo). |
High |
Medium |
QS.3 |
Availability |
The application will be available the majority of time, specially at client reviews. System availability will always be above 97%, with about 15 hours of maintenance every three weeks. |
Medium |
High |
QS.4 |
Usability |
Project documentation shall be kept up to date and consistent with the project. Changes will be made as soon as something changes, and this will be checked with a review every two weeks. |
Medium |
High |
QS.5 |
Usability |
The application must be intuitive and easy to use. This will be verified by testing with different user profiles. |
Medium |
Medium |
QS.6 |
Accesibility |
The web application must pass the AA level in Achecker |
Low |
High |
QS.7 |
Efficiency |
The system will have a response time of less than 0.5 seconds. |
Low |
Very High |
11. Risks and Technical Debts
Nº | Risk | Explanation | Measures |
---|---|---|---|
1 |
Abandonment of a team member |
It can be caused by different reasons such as personal or organizational problems. |
Do not leave an important task or module for a single person. |
2 |
Not enough experience on technologies which we need to use. |
These technologies are Typescript, React, Node.js, Express and SOLID. |
Investigate more about these technologies and practice by following tutorials or online courses. There are also materials provided by teachers. |
3 |
Problems with git |
Team members can have conflicts when merging branches. |
Make sure the result is what we expect before running unknown commands. To do this, we can consult the official documentation or ask other members of the team. |
4 |
Lack of time |
This risk is closely related to the others. In addition, team members also have other subjects besides this one. |
Combine the completion of this work with the rest of the subjects. |
5 |
Unproductive meetings |
It can be caused by not making preparations before meetings. |
Have a list of topics to talk about during the meeting. |
6 |
Lack of communication |
The communication is not immediate in most of the time because team members have different schedules. |
Team members need to be more collaborative. Another measure is to take advantage of scheduled meetings. |
7 |
English |
It is not the usual language of the team members. Then this documentation can have linguistic errors. |
Use the free online dictionary and language error detection tools. |
Nº | Technical debts | Explanation | Measures |
---|---|---|---|
1 |
Security |
There are many paths which should not be accesible for some users. |
Checking paths and improving role system in order to check and revert those dangerous requests. These will improve security and decrease hacking risks. |
2 |
Versions |
During development we have used some old versions which have been quite useful. Npm has report many vulnerabilities, there are 6 moderate vulnerailities while installing webapp dependencies |
Updating dependencies in order to reduce those vulnerabilities which could be dangerous for application’s security. |
3 |
Azure deployment |
Configuration files are created but deployment could not be finished correctly due to many problems of GitHub actions while creating a release |
We will try to solve all this problems. However, webpage has been deployed using Heroku and now is available. Trying to have both deployments will be a challenge for us in order to reach some quality goals such as availability. |
12. Glossary
Term | Definition |
---|---|
Git |
It’s a version control software designed by Linus Torvalds, thinking about the efficiency, reliability and compatibility of application version maintenance. |
Github |
Is’s a platform for hosting projects using the Git version control system. |
Solid |
It’s a specification that allows customers to store their data securely in decentralized data stores. |
Solid Pod |
Pods are where you store your data. Any kind of data can be stored in a Solid Pod. Once stored in a Pod, you control who can access your data. |
REACT |
It’s an open source Javascript library that allows you to easily create interactive user interfaces. |
Typescript |
It’s a Javascript-based web programming language that adds static typing. |
DBMS |
DataBase Management System is a software that is used to store and retrieve data from a database. |
IDE |
Integrated development environment is a software that provides facilities to developers. |
GUI |
Graphical User Interface. |
Usability tests |
Usability tests is a testing technique to evaluate the functionality of a software product that consists of proposing tasks to real users and observing how they perform it. |
Deployment |
All the processes and activities that make a software system available to its users. |
Accesibility |
The attribute of being easy to meet or deal with especially for disabled clients |
Confidentiality |
The ethical principle or legal right that a physician or other health professional will hold secret all information relating to a patient, unless the patient gives consent permitting disclosure. |
Efficiency |
The ratio of the effective or useful output to the total input in any system. |
Usability |
The degree to which an object, device, software application, etc. is easy to use with no specific training. |
Availability |
The quality of being at hand when needed. |
Node.js |
An open-source and cross-platform runtime environment on the server-side. It is based on Google’s V8 JavaScript engine, which is designed to execute JavaScript code very quickly. |
JavaScript |
A programming language used both on the client side and on the server side. JavaScript allows the interaction between web pages. |
Express |
A web application framework for Node.js used for building web and mobile applications. |
Merge branches |
The process of incorporating any changes in a branch to another branch. |
Webpage that allow as to check webpage accessibility using level AA |
|
dotenv |
Library from npm used to get environment variables that should not be exposed to the public. API keys, passwords, database links, ports… In this way .env files should not be in the repository in GitHub |
mui |
Npm library used to optimize the development of GUI. It gives us a lot of improvements while creating buttons, panels and many other things. The link to the webpage can be found here. |
mongodb |
Official mongodb driver for Node.js. Usage documentation can be found in this webpage. |
mongoose |
Object modeling tool designed to work in an asynchronous environment. Mongoose supports both promises and callbacks. Here is the link to the documentation. |
inrupt/solid-ui-react |
Module which improves the development of applications using react and Solid architecture. The link to the documentation is here. |
node-fetch |
Module which is useful to make requests to other web services. Here is the link to the documentation. |
MapsAPI |
Api which helps to calculate distances between the client and the distribution center. We will use Mapbox in order to implement these features. Here is the documentation. |
MongoDB Atlas |
Service supported by mongoDB which allows the application to externalize the data storage. Data is stored using serverless architecture managed by mongoDB with AWS, Azure or Google Cloud. MongoDB Atlas. |
Mockup |
A static design of a web page or application that shows general layout and functionality. |
MERN |
MERN stands for MongoDB, Express, React and Node. |
3-tier architecture |
It is a client-server architecture which separates the application into three logical and three physical tiers: presentation tier, application tier and data tier. |
WCAG |
Web Content Accessibility Guidelines |
About arc42
arc42, the Template for documentation of software and system architecture.
By Dr. Gernot Starke, Dr. Peter Hruschka and contributors.
Template Revision: 7.0 EN (based on asciidoc), January 2017
© We acknowledge that this document uses material from the arc 42 architecture template, http://www.arc42.de. Created by Dr. Peter Hruschka & Dr. Gernot Starke.