-
Notifications
You must be signed in to change notification settings - Fork 0
Software Architecture & Design
This section outlines the architectural design and layered structure of the web application, providing an overview of the components and their interactions.
-
The Client Layer encompasses the user interfaces and client-side components that interact with the application. This layer includes desktop and mobile browsers, catering to a wide range of devices and platforms. Users, whether guests or registered, interact with the application through this layer, accessing features such as filling out questionnaires, viewing questionnaire history (for registered users), and potentially making donations.
-
The Access Layer acts as an intermediary between the Client Layer and the Service Layer. It handles the communication between the client-side components and the application's core functionality. This layer is responsible for routing requests, enforcing access controls, and ensuring secure data transmission. Only supporting Chrome and Edge - two similar chromium based browsers.
-
The Service Layer encapsulates the application's business logic and core functionalities. It processes requests from the Access Layer and interacts with the Database Layer to retrieve or persist data as needed. The Service Layer includes modules for various features, such as:
- Fill Questionnaire: Handles the logic for presenting questionnaires to users, calculating scores, and saving responses.
- View Questionnaire History: Manages the retrieval and display of completed questionnaire history and scores for registered users.
- User Management: Handles user authentication, registration, and account management functionalities.
- Content Management: Provides interfaces for admins to manage and update website content, such as posts or information pages.
- Donation Management: Facilitates the donation process, including payment processing and record-keeping.
- Questionnaire Management: Allows admins to create, modify, and remove questionnaires, as well as generate statistical reports based on questionnaire data.
-
The Database Layer is responsible for persisting and retrieving data for the application. In this architecture, Firebase is utilized as the database solution. This layer interacts with the Service Layer to store and retrieve data as required by the various application functionalities, such as user accounts, questionnaire responses, donation records, and content management data.
The database is implemented using Firebase, a NoSQL document-based database service.
-
The
userscollection stores user account information, including email, hashed password, name, role (admin or user), and the account creation timestamp. Each user document is identified by a uniqueuser_id. -
The
donationscollection keeps track of donation records made. Each donation document includes a uniquedonation_id, the donation amount, and the timestamp of the donation. -
The
postscollection stores website content and information posts created by admins. Each post document contains a uniquepost_id, title, content,author_id(referencing theuserscollection for the author), and timestamps for creation and last update. -
The
user_questionnaire_historyis a subcollection nested under each user document in theuserscollection. It stores the history of questionnaires filled out by the user. Each document in this subcollection represents an instance of a completed questionnaire and includes a uniquehistory_id, thequestionnaire_id(referencing thequestionnairescollection), the calculated score, and the timestamp when the questionnaire was filled out. -
The
questionnairescollection contains the questionnaire data. If there is only one questionnaire, it will be stored as a single document. Each questionnaire document includes a uniquequestionnaire_id(or a fixed ID likedefault_questionnaire), a title, an array of questions (each question object contains properties likequestion_id,question_text,question_type, etc.), and a timestamp for the last update. -
The
questionnaire_responsescollection stores user responses to the questionnaires. Each document represents a user's response and includes a uniqueresponse_id, theuser_id(referencing theuserscollection), thequestionnaire_id, an array of responses (each response object contains thequestion_idand the user's answer), the calculated score, and the timestamp of the response submission.