{"id":19599067,"url":"https://github.com/mrcheater/peace-data","last_synced_at":"2025-10-13T03:40:33.554Z","repository":{"id":102597196,"uuid":"301473351","full_name":"MrCheater/Peace-Data","owner":"MrCheater","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-11T11:57:15.000Z","size":29338,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-20T19:40:22.870Z","etag":null,"topics":["2020","hackathon","vtb"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrCheater.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-05T16:34:14.000Z","updated_at":"2020-12-27T13:13:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d52eba2-fdb7-47ba-9e30-79e6e66de815","html_url":"https://github.com/MrCheater/Peace-Data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MrCheater/Peace-Data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrCheater%2FPeace-Data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrCheater%2FPeace-Data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrCheater%2FPeace-Data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrCheater%2FPeace-Data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrCheater","download_url":"https://codeload.github.com/MrCheater/Peace-Data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrCheater%2FPeace-Data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013520,"owners_count":26085368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2020","hackathon","vtb"],"created_at":"2024-11-11T09:08:54.513Z","updated_at":"2025-10-13T03:40:33.533Z","avatar_url":"https://github.com/MrCheater.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Peace-Data\n#### VTB hackathon team\n\n##### Services\n![](https://github.com/Peace-Data/Peace-Data/blob/main/MVP/Demonstration/services.png?raw=true)\n##### Navigation\n![](https://github.com/Peace-Data/Peace-Data/blob/main/MVP/Demonstration/navigation.png?raw=true)\n\n## Security Features\n#### SSL Certificate\n![SSL Certificate](https://user-images.githubusercontent.com/5055654/95653059-5f31c400-0afe-11eb-8519-3bd99940ca86.png)\n```js\nconst httpsServer = https.createServer({\n  key: fs.readFileSync(path.join(__dirname, '..', 'peace.data.key')),\n  cert: fs.readFileSync(path.join(__dirname, '..', 'peace.data.crt')),\n}, app);\n\nhttpsServer.listen(443, 'api.peace.data', () =\u003e {\n  console.log(`HTTPS Server running on port https://api.peace.data`);\n});\n```\n\n#### Two-factor authentication + QR code for scanning into Google Authenticator\n![Passport-TOTP-Example](https://user-images.githubusercontent.com/5055654/95653175-41189380-0aff-11eb-9e73-df4a0c6874bc.png)\n\n![Passport-TOTP-Example (1)](https://user-images.githubusercontent.com/5055654/95653176-4249c080-0aff-11eb-9155-8a2879d8fa9f.png)\n\n#### Secure Session\n```js\n// Send session cookie only over HTTPS\napp.use(session({\n  secret: sessionSecret,\n  name: 'SessionID',\n  resave: false,\n  saveUninitialized: true,\n  cookie: {\n    secure: debug ? false : true,\n    httpOnly: true,\n  }\n}));\n```\n\n#### Whitelist Cors\n```js\n// For https://api.peace.data:443/\napp.use(cors({\n  origin: 'https://peace.data:443/',\n  optionsSuccessStatus: 204\n}));\n```\n\n#### Rate Limiting\n```js\napp.use(rateLimit({\n  windowMs: 15 * 60 * 1000, // 15 minutes\n  max: 100 // limit each IP to 100 requests per windowMs\n}));\n```\n\n#### JWT + Asymmetric Encryption based on RS256\nA public key and a private key will be used to encrypt and decrypt the JWT by the authentication server and application server.\n\nIf the application server registered with the asymmetric encryption, The public key will be given to the application server to use as the decryption key while authentication server will use the private key for the encryption.\n\n`data=base64urlEncode(header)+”.”+base64urlEncode(payload);`\n\n`hashedData=hash(data,secret);`\n\n`signature=base64urlEncode(hashedData);`\n\nThen we encode the Header, Payload and the signature separately in base 64 and combine them with “.”.\n```\nHeader:-eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9\nPayload:-eyJ1c2VySWQiOiJiMDhmODZhZi0zNWRhLTQ4ZjItOGZhYi1jZWYzOTA0NjYwYmQifQ\nSignature:- -xN_h82PHVTCMA9vdoHrcZxH-x5mb11y1537t3rGzcM\n```\nA complete JWT will be look like this\n``` eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiJiMDhmODZhZi0zNWRhLTQ4ZjItOGZhYi1jZWYzOTA0NjYwYmQifQ.-xN_h82PHVTCMA9vdoHrcZxH-x5mb11y1537t3rGzcM\nTo identify how JWT works lets consider there is a authentication server, Application server and a user.\n```\n\n#### Machine Learning\n1. DBSCAN - Density-based spatial clustering of applications with noise (DBSCAN) is a data clustering algorithm. It is a density-based clustering non-parametric algorithm: given a set of points in some space, it groups together points that are closely packed together (points with many nearby neighbors), marking as outliers points that lie alone in low-density regions (whose nearest neighbors are too far away). \n\n2. Random forests or random decision forests are an ensemble learning method for classification, regression and other tasks that operate by constructing a multitude of decision trees at training time and outputting the class that is the mode of the classes (classification) or mean/average prediction (regression) of the individual trees.\n\n#### \n\n## :rocket: Getting Started\n\n### Installation\nFrontend: (Port 3000)\n```sh\ncd client\nnpm install\nnpm run dev\n```\n\nBackend Node.js: (Port 3001)\n```sh\ncd node\nnpm install\nnpm run dev\n```\n\nBackend Python: (Port 3002)\n```sh\ncd server\npython3 -m http.server 3002\n```\n\n\n## Requirements\n* Node.js 12.18.4 https://nodejs.org/en/download/\n* Python 3.x https://www.python.org/downloads/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrcheater%2Fpeace-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrcheater%2Fpeace-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrcheater%2Fpeace-data/lists"}