-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3338 from Superalgos/develop
Develop into Master, Nov and Dec 2021 Bug Fixes, Features and Plugins
- Loading branch information
Showing
2,346 changed files
with
1,102,549 additions
and
160,307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 180 | ||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 7 | ||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
- improvement | ||
# Label to use when marking an issue as stale | ||
staleLabel: stale | ||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "C:\\Superalgos\\TaskServer" | ||
}, | ||
{ | ||
"path": "C:\\Superalgos\\Projects" | ||
} | ||
], | ||
"settings": { | ||
"search.maintainFileSearchCache": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
exports.newDesktopAppBackend = function newDesktopAppBackend() { | ||
|
||
let thisObject = { | ||
appBootstrapingProcess: undefined, | ||
p2pNetworkClientIdentity: undefined, | ||
p2pNetwork: undefined, | ||
p2pNetworkPeers: undefined, | ||
webSocketsInterface: undefined, | ||
webAppInterface: undefined, | ||
p2pNetworkInterface: undefined, | ||
socialGraph: undefined, | ||
run: run | ||
} | ||
|
||
DK.desktopApp = thisObject | ||
|
||
return thisObject | ||
|
||
async function run() { | ||
|
||
await setupNetwork() | ||
await setupServices() | ||
|
||
async function setupNetwork() { | ||
/* | ||
We set up ourselves as a Network Client. | ||
*/ | ||
thisObject.p2pNetworkClientIdentity = SA.projects.network.modules.p2pNetworkClientIdentity.newNetworkModulesP2PNetworkClientIdentity() | ||
await thisObject.p2pNetworkClientIdentity.initialize() | ||
/* | ||
We will read all user profiles plugins and get from there our network identity. | ||
*/ | ||
thisObject.appBootstrapingProcess = SA.projects.network.modules.appBootstrapingProcess.newNetworkModulesAppBootstrapingProcess() | ||
await thisObject.appBootstrapingProcess.initialize(global.env.DESKTOP_APP_SIGNING_ACCOUNT, thisObject.p2pNetworkClientIdentity) | ||
/* | ||
We set up the P2P Network. | ||
*/ | ||
thisObject.p2pNetwork = SA.projects.network.modules.p2pNetwork.newNetworkModulesP2PNetwork() | ||
await thisObject.p2pNetwork.initialize('Network Client') | ||
/* | ||
This is where we will process all the events comming from the p2p network. | ||
*/ | ||
thisObject.p2pNetworkInterface = SA.projects.socialTrading.modules.p2pNetworkInterface.newSocialTradingModulesP2PNetworkInterface() | ||
/* | ||
Set up the connections to network nodes. | ||
*/ | ||
thisObject.p2pNetworkPeers = SA.projects.network.modules.p2pNetworkPeers.newNetworkModulesP2PNetworkPeers() | ||
await thisObject.p2pNetworkPeers.initialize( | ||
'Network Client', | ||
thisObject.p2pNetworkClientIdentity, | ||
thisObject.p2pNetwork, | ||
thisObject.p2pNetworkInterface, | ||
global.env.DESKTOP_APP_MAX_OUTGOING_PEERS | ||
) | ||
} | ||
|
||
async function setupServices() { | ||
/* | ||
This is where we will process all the messages comming from our web app. | ||
*/ | ||
thisObject.webAppInterface = DK.projects.socialTrading.modules.webAppInterface.newSocialTradingModulesWebAppInterface() | ||
/* | ||
This is the Personal Social Graph for the user running this App. | ||
*/ | ||
thisObject.socialGraph = DK.projects.socialTrading.modules.socialGraph.newSocialTradingModulesSocialGraph() | ||
await thisObject.socialGraph.initialize() | ||
|
||
let express = require('./backend/src/expressServer.js') | ||
express.DesktopBackend(DK.desktopApp.p2pNetworkClientIdentity.node.config.webPort, SA, DK); | ||
console.log(`express Interface ................................................ Listening at port ${DK.desktopApp.p2pNetworkClientIdentity.node.config.webPort}` ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
exports.newDesktopAppFrontend = function newDesktopAppFrontend() { | ||
|
||
let thisObject = { | ||
run: run | ||
} | ||
|
||
return thisObject | ||
|
||
async function run() { | ||
|
||
await setupServices() | ||
|
||
async function setupServices() { | ||
|
||
let react = require('./frontend/scripts/start') | ||
let port = 33249; | ||
react.start(port); // todo get port from node config | ||
console.log(`react Interface ................................................ Listening at port ${port}`); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
exports.newDesktopBackendRoot = function newDesktopBackendRoot() { | ||
/* | ||
This module represents the execution root of the Desktop App. | ||
We use this module that is outside the Desktop folder to | ||
load all node dependencies and get them ready to the actual App. | ||
*/ | ||
let thisObject = { | ||
run: run | ||
} | ||
|
||
return thisObject | ||
|
||
async function run(debugSettings) { | ||
/* | ||
The DK object is accessible everywhere at the Superalgos Desktop App. | ||
It provides access to all modules built for this App. | ||
*/ | ||
global.DK = {} | ||
/* | ||
The SA object is accessible everywhere at the Superalgos Desktop App. | ||
It provides access to all modules built for Superalgos in general. | ||
*/ | ||
global.SA = {} | ||
/* Load Environment Variables */ | ||
let ENVIRONMENT = require('../Environment.js'); | ||
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment() | ||
global.env = ENVIRONMENT_MODULE | ||
|
||
if (debugSettings !== undefined && debugSettings.DESKTOP_APP_SIGNING_ACCOUNT !== undefined) { | ||
global.env.DESKTOP_APP_SIGNING_ACCOUNT = debugSettings.DESKTOP_APP_SIGNING_ACCOUNT | ||
} | ||
/* | ||
First thing is to load the project schema file. | ||
*/ | ||
global.PROJECTS_SCHEMA = require(global.env.PATH_TO_PROJECT_SCHEMA) | ||
/* | ||
Setting up the modules that will be available, defined at the Project Schema file. | ||
*/ | ||
let MULTI_PROJECT = require('../MultiProject.js'); | ||
let MULTI_PROJECT_MODULE = MULTI_PROJECT.newMultiProject() | ||
MULTI_PROJECT_MODULE.initialize(DK, 'DK') | ||
MULTI_PROJECT_MODULE.initialize(SA, 'SA') | ||
/* | ||
Setting up external dependencies. | ||
*/ | ||
SA.nodeModules = { | ||
fs: require('fs'), | ||
util: require('util'), | ||
path: require('path'), | ||
web3: require('web3'), | ||
ws: require('ws'), | ||
open: require('open'), | ||
http: require('http'), | ||
octokit: require("@octokit/rest"), | ||
simpleGit: require('simple-git'), | ||
nodeFetch: require('node-fetch'), | ||
graphql: require("@octokit/graphql"), | ||
axios: require('axios') | ||
} | ||
SA.version = require('../package.json').version | ||
/* | ||
Setting up Secrets. | ||
*/ | ||
let SECRETS = require('../Secrets.js').newSecrets() | ||
SECRETS.initialize() | ||
|
||
run() | ||
|
||
async function run() { | ||
DK.app = require('./DesktopAppBackend.js').newDesktopAppBackend() | ||
await DK.app.run() | ||
console.log('Superalgos Desktop Backend App is Running!') | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
exports.newDesktopFrontendRoot = function newDesktopFrontendRoot() { | ||
|
||
let thisObject = { | ||
run: run | ||
} | ||
|
||
return thisObject | ||
|
||
async function run() { | ||
|
||
run() | ||
|
||
async function run() { | ||
let app = require('./DesktopAppFrontend').newDesktopAppFrontend() | ||
await app.run() | ||
console.log('Superalgos Desktop Frontend App is Running!') | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const { postService } = require('../services'); | ||
|
||
const getPosts = async (req, res) => { | ||
const result = await postService.getPosts(req.query.userId); | ||
res.send(result); | ||
}; | ||
|
||
const createPost = async (req, res) => { | ||
try { | ||
const result = await postService.createPost(req.body); | ||
res.send(result); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
|
||
}; | ||
|
||
|
||
module.exports = { | ||
getPosts, | ||
createPost | ||
}; | ||
|
Oops, something went wrong.