diff --git a/Desktop/UI/WebApp.js b/Desktop/UI/WebApp.js index 21af37e22..6675b0ba4 100644 --- a/Desktop/UI/WebApp.js +++ b/Desktop/UI/WebApp.js @@ -1,5 +1,9 @@ function newWebApp() { + /* + In it's current state of development, the Web App only has one module. + Everything is being coded here until some structure emerges. + */ let thisObject = { initialize: initialize, finalize: finalize @@ -123,7 +127,6 @@ function newWebApp() { function addToContentDiv(events) { try { let contentDiv = document.getElementById('content-div') - /* Delete al current content. */ diff --git a/Projects/Social-Trading/DK/modules/WebAppInterface.js b/Projects/Social-Trading/DK/modules/WebAppInterface.js index eb232bc70..364e36711 100644 --- a/Projects/Social-Trading/DK/modules/WebAppInterface.js +++ b/Projects/Social-Trading/DK/modules/WebAppInterface.js @@ -1,8 +1,11 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModulesWebAppInterface() { /* This module handles the incomming messages from the Web App. - At it's current iteration, it will jusr forward those messages + At it's current version, it will jusr forward those messages to the Network Node it is connected to. + + Later, it will try to use the personal social graph as a cache, + so as to minimize the requests to Network Nodes. */ let thisObject = { messageReceived: messageReceived, @@ -144,6 +147,14 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule } async function savePostAtStorage(postText, commitMessage, timestamp) { + /* + Each user, has a git repository that acts as his publicly accesible + storage for posts. + + They way we store post there is first saving the data at the local disk + which has a clone of the remote git repository, and once done, we push + the changes to the public git repo. + */ const { createHash } = await import('crypto') const hash = createHash('sha256') let post = { @@ -174,6 +185,12 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule } async function getPostText(userProfileHandle, postHash, timestamp) { + /* + When the Web App makes a query that includes Post text as responses, + we need to fetch the text from the public git repositories, since + the Network Nodes do not store that info themselves, they just + store the structure of the social graph. + */ let promise = new Promise((resolve, reject) => { const fileName = postHash + ".json" diff --git a/Projects/Social-Trading/DK/modules/httpInterface.js b/Projects/Social-Trading/DK/modules/httpInterface.js index 77bb35598..f99ebcd87 100644 --- a/Projects/Social-Trading/DK/modules/httpInterface.js +++ b/Projects/Social-Trading/DK/modules/httpInterface.js @@ -1,8 +1,7 @@ exports.newDesktopModulesHttpInterface = function newDesktopModulesHttpInterface() { - /* This module represent the HTTP API of the - Desktop App. All HTTP request are processed + Desktop App Client. All HTTP request are processed by this module. */ let thisObject = {