\n This example demonstrates a custom render method for the capture\n button.\n
\ndiff --git a/LICENSE b/binaryBrain/LICENSE similarity index 100% rename from LICENSE rename to binaryBrain/LICENSE diff --git a/binaryBrain/README.md b/binaryBrain/README.md new file mode 100644 index 0000000..60927c4 --- /dev/null +++ b/binaryBrain/README.md @@ -0,0 +1,49 @@ +# Electhon - 2023 + +#### Team Name - Binary Brain +#### Problem Statement - 3. Device a solution that can increase the voting turnout on the election day +#### Team Leader Email - phadnis.anurag@gmail.com + +## A Brief of the Prototype: + What is your solution? and how it works. + > The idea behind Votivate is to increase voter turnout in India by incentivizing people to vote. Votivate aims to achieve this by partnering with brands to offer exclusive discounts and offers to those who cast their votes. + + > Users can register for Votivate using their prefered brand's application and upload a selfie with an inked finger as proof of voting. Votivate uses deep learning neural net to verify the proof of voting and confirm that the user has indeed cast their vote. Once a user's vote is validated, they are redirected to the participating brand's website or app to receive their discount or offer. + + > By providing a tangible benefit to voting, Votivate hopes to increase voter turnout and promote a more representative democracy. In addition, brands benefit from increased customer engagement and loyalty, positive brand image and reputation, and increased sales and revenue. Votivate offers a plug-and-play API that allows brands to easily integrate their campaigns into their apps and websites. + +## Code Execution Instruction: + The repository contains multiple indepndent service which are needed to be built in order to run the system. + + 1. pov-app-backend: + This is the backend server created for the votivate application. The purpose of this service is to create endpoint to upload picture with geolocation and verify the proof of vote token should be given to the user or not. The user's are identified on the basis of SHA256 hash of their email address of phone number. It talks to the services of the brand companies by using HTTP callbacks. + It has the following dependencies: + 1. Nodejs + 2. Mongodb + 3. Token for the ML model hosted on cloud + + You need to provide all the above information in an .env file. + Then run + > `yarn install` + > Run `yarn start:dev` + > Server opens on a default port 3000 + + 2. react-camera + This is the frontend application which will be used to upload a selfie and act as a web interface using which the voter can get his proof of vote for one time for each election which can then be redemmed at brand offers of multiple brands + + To run the application + > npm install + > npm start + + 3. Ecom-app-backend (Demo code for integration with brands) + This is the backend application which act as a mock application for how the brand's will integrate our application. They need to create and maintain their own discount coupons and create banner during the election which will act as reminder using push notifications and voter can click on the banner to get redirected to the portal where he can upload the selfie to get the proof of vote tokens. Later the proof of vote tokens are notified to this service using HTTP calls which are made by the pov app backend. + > Create .env file with the mongodb credentials + > run yarn install + > run yarn start:dev + + 4. Ecommerce react app (Demo code for integration with brands) + This is a front end demo application of how our solution will be integrated on other platforms. + To run this + > npm run + +[Execution Plan](pov.pdf) diff --git a/binaryBrain/e-commerce-react-app/.gitignore b/binaryBrain/e-commerce-react-app/.gitignore new file mode 100644 index 0000000..4d29575 --- /dev/null +++ b/binaryBrain/e-commerce-react-app/.gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/binaryBrain/e-commerce-react-app/LICENSE b/binaryBrain/e-commerce-react-app/LICENSE new file mode 100644 index 0000000..f2f2d37 --- /dev/null +++ b/binaryBrain/e-commerce-react-app/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Alper Tugriçeri + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/binaryBrain/e-commerce-react-app/README.md b/binaryBrain/e-commerce-react-app/README.md new file mode 100644 index 0000000..4177d05 --- /dev/null +++ b/binaryBrain/e-commerce-react-app/README.md @@ -0,0 +1,138 @@ + +
+ +[![MIT License][license-shield]](https://github.com/Atugriceri/e-commerce-react-app/blob/main/LICENSE) +[![LinkedIn][linkedin-shield]](https://www.linkedin.com/in/alpertugriceri/) + + +
+ Shopping site project that includes basic processes such as adding to cart, adding to favorites, product listing and product detail page, which should be on an e-commerce site.
+
+
+ View Demo
+
+ + Brand, + {" "} + {item.title} +
++ ({item.rating.count}) +
+This may take a few seconds, please don't close this page.
++ There are no products in your cart. +
++ Add the products you like to the cart and buy. +
+ +{item.title}
+ ++ $ {item.price} +
++ OOPS! NOTHING WAS FOUND! +
++ The page you are looking for might have been removed had its name + changed or is temporarily unavailable. +
+ ++ There is no product in your favorites. +
++ Add the products you like to your favorites to buy them later. +
+ ++ ({product?.rating?.count}) +
++ {product.description} +
+A progressive Node.js framework for building efficient and scalable server-side applications.
+ + + +## Description + +[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. + +## Installation + +```bash +$ yarn install +``` + +## Running the app + +```bash +# development +$ yarn run start + +# watch mode +$ yarn run start:dev + +# production mode +$ yarn run start:prod +``` + +## Test + +```bash +# unit tests +$ yarn run test + +# e2e tests +$ yarn run test:e2e + +# test coverage +$ yarn run test:cov +``` + +## Support + +Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). + +## Stay in touch + +- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) +- Website - [https://nestjs.com](https://nestjs.com/) +- Twitter - [@nestframework](https://twitter.com/nestframework) + +## License + +Nest is [MIT licensed](LICENSE). diff --git a/binaryBrain/ecomm-app-backend/nest-cli.json b/binaryBrain/ecomm-app-backend/nest-cli.json new file mode 100644 index 0000000..f9aa683 --- /dev/null +++ b/binaryBrain/ecomm-app-backend/nest-cli.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli", + "collection": "@nestjs/schematics", + "sourceRoot": "src", + "compilerOptions": { + "deleteOutDir": true + } +} diff --git a/binaryBrain/ecomm-app-backend/package.json b/binaryBrain/ecomm-app-backend/package.json new file mode 100644 index 0000000..e7b7f32 --- /dev/null +++ b/binaryBrain/ecomm-app-backend/package.json @@ -0,0 +1,75 @@ +{ + "name": "electhon-pov", + "version": "0.0.1", + "description": "", + "author": "", + "private": true, + "license": "UNLICENSED", + "scripts": { + "build": "nest build", + "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "start": "nest start", + "start:dev": "nest start --watch", + "start:debug": "nest start --debug --watch", + "start:prod": "node dist/main", + "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", + "test": "jest", + "test:watch": "jest --watch", + "test:cov": "jest --coverage", + "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", + "test:e2e": "jest --config ./test/jest-e2e.json" + }, + "dependencies": { + "@nestjs/common": "^9.0.0", + "@nestjs/config": "^2.3.1", + "@nestjs/core": "^9.0.0", + "@nestjs/mongoose": "^9.2.2", + "@nestjs/platform-express": "^9.0.0", + "@types/multer": "^1.4.7", + "axios": "^1.3.5", + "mongoose": "^7.0.3", + "reflect-metadata": "^0.1.13", + "rxjs": "^7.2.0", + "uuid": "^9.0.0" + }, + "devDependencies": { + "@nestjs/cli": "^9.0.0", + "@nestjs/schematics": "^9.0.0", + "@nestjs/testing": "^9.0.0", + "@types/express": "^4.17.13", + "@types/jest": "29.5.0", + "@types/node": "18.15.11", + "@types/supertest": "^2.0.11", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^8.0.1", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "jest": "29.5.0", + "prettier": "^2.3.2", + "source-map-support": "^0.5.20", + "supertest": "^6.1.3", + "ts-jest": "29.0.5", + "ts-loader": "^9.2.3", + "ts-node": "^10.0.0", + "tsconfig-paths": "4.2.0", + "typescript": "^4.7.4" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "json", + "ts" + ], + "rootDir": "src", + "testRegex": ".*\\.spec\\.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + }, + "collectCoverageFrom": [ + "**/*.(t|j)s" + ], + "coverageDirectory": "../coverage", + "testEnvironment": "node" + } +} diff --git a/binaryBrain/ecomm-app-backend/src/app.controller.spec.ts b/binaryBrain/ecomm-app-backend/src/app.controller.spec.ts new file mode 100644 index 0000000..d22f389 --- /dev/null +++ b/binaryBrain/ecomm-app-backend/src/app.controller.spec.ts @@ -0,0 +1,22 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AppController } from './app.controller'; +import { AppService } from './app.service'; + +describe('AppController', () => { + let appController: AppController; + + beforeEach(async () => { + const app: TestingModule = await Test.createTestingModule({ + controllers: [AppController], + providers: [AppService], + }).compile(); + + appController = app.getA progressive Node.js framework for building efficient and scalable server-side applications.
+ + + +## Description + +[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. + +## Installation + +```bash +$ yarn install +``` + +## Running the app + +```bash +# development +$ yarn run start + +# watch mode +$ yarn run start:dev + +# production mode +$ yarn run start:prod +``` + +## Test + +```bash +# unit tests +$ yarn run test + +# e2e tests +$ yarn run test:e2e + +# test coverage +$ yarn run test:cov +``` + +## Support + +Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). + +## Stay in touch + +- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) +- Website - [https://nestjs.com](https://nestjs.com/) +- Twitter - [@nestframework](https://twitter.com/nestframework) + +## License + +Nest is [MIT licensed](LICENSE). diff --git a/binaryBrain/pov-app-backend/nest-cli.json b/binaryBrain/pov-app-backend/nest-cli.json new file mode 100644 index 0000000..f9aa683 --- /dev/null +++ b/binaryBrain/pov-app-backend/nest-cli.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli", + "collection": "@nestjs/schematics", + "sourceRoot": "src", + "compilerOptions": { + "deleteOutDir": true + } +} diff --git a/binaryBrain/pov-app-backend/package.json b/binaryBrain/pov-app-backend/package.json new file mode 100644 index 0000000..d569ccd --- /dev/null +++ b/binaryBrain/pov-app-backend/package.json @@ -0,0 +1,76 @@ +{ + "name": "electhon-pov", + "version": "0.0.1", + "description": "", + "author": "", + "private": true, + "license": "UNLICENSED", + "scripts": { + "build": "nest build", + "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "start": "nest start", + "start:dev": "nest start --watch", + "start:debug": "nest start --debug --watch", + "start:prod": "node dist/main", + "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", + "test": "jest", + "test:watch": "jest --watch", + "test:cov": "jest --coverage", + "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", + "test:e2e": "jest --config ./test/jest-e2e.json" + }, + "dependencies": { + "@nestjs/common": "^9.0.0", + "@nestjs/config": "^2.3.1", + "@nestjs/core": "^9.0.0", + "@nestjs/mongoose": "^9.2.2", + "@nestjs/platform-express": "^9.0.0", + "@nestjs/serve-static": "^3.0.1", + "@types/multer": "^1.4.7", + "axios": "^1.3.5", + "mongoose": "^7.0.3", + "reflect-metadata": "^0.1.13", + "rxjs": "^7.2.0", + "uuid": "^9.0.0" + }, + "devDependencies": { + "@nestjs/cli": "^9.0.0", + "@nestjs/schematics": "^9.0.0", + "@nestjs/testing": "^9.0.0", + "@types/express": "^4.17.13", + "@types/jest": "29.5.0", + "@types/node": "18.15.11", + "@types/supertest": "^2.0.11", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^8.0.1", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "jest": "29.5.0", + "prettier": "^2.3.2", + "source-map-support": "^0.5.20", + "supertest": "^6.1.3", + "ts-jest": "29.0.5", + "ts-loader": "^9.2.3", + "ts-node": "^10.0.0", + "tsconfig-paths": "4.2.0", + "typescript": "^4.7.4" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "json", + "ts" + ], + "rootDir": "src", + "testRegex": ".*\\.spec\\.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + }, + "collectCoverageFrom": [ + "**/*.(t|j)s" + ], + "coverageDirectory": "../coverage", + "testEnvironment": "node" + } +} diff --git a/binaryBrain/pov-app-backend/src/app.controller.spec.ts b/binaryBrain/pov-app-backend/src/app.controller.spec.ts new file mode 100644 index 0000000..d22f389 --- /dev/null +++ b/binaryBrain/pov-app-backend/src/app.controller.spec.ts @@ -0,0 +1,22 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AppController } from './app.controller'; +import { AppService } from './app.service'; + +describe('AppController', () => { + let appController: AppController; + + beforeEach(async () => { + const app: TestingModule = await Test.createTestingModule({ + controllers: [AppController], + providers: [AppService], + }).compile(); + + appController = app.get component higher in the tree to provide a loading indicator or placeholder to display."+te(s))}$l=!0,f=Zn(f,s),u=c;do{switch(u.tag){case 3:u.effectTag|=2048,u.expirationTime=l,l=sr(u,f,l),Gn(u,l);break e;case 1:if(p=f,h=u.type,s=u.stateNode,0==(64&u.effectTag)&&("function"==typeof h.getDerivedStateFromError||null!==s&&"function"==typeof s.componentDidCatch&&(null===Yl||!Yl.has(s)))){u.effectTag|=2048,u.expirationTime=l,l=fr(u,p,l),Gn(u,l);break e}}u=u.return}while(null!==u)}Dl=wr(a);continue}i=!0,Vr(t)}}break}if(Ul=!1,Ml.current=n,Tl=kl=xl=null,cn(),i)zl=null,e.finishedWork=null;else if(null!==Dl)e.finishedWork=null;else{if(n=e.current.alternate,null===n&&o("281"),zl=null,$l){if(i=e.latestPendingTime,a=e.latestSuspendedTime,l=e.latestPingedTime,0!==i&&i 3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(ie,""),i=t&&n?n+" "+t+" { "+o+" }":o;return fe=r,de=t,pe=new RegExp("\\"+de+"\\b","g"),le(n||!t?"":t,i)}function c(e){return e.replace(He,"-$1").toLowerCase().replace(qe,"-ms-")}function s(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in R.a?String(t).trim():t+"px"}function f(e,t,n){if(Array.isArray(e)){for(var r,i=[],u=0,c=e.length;u \n {errorTypes[errorType].details || 'Oops, something broke.'}\n \n This example demonstrates a custom render method for the capture\n button.\n
+ {errorTypes[errorType].details || 'Oops, something broke.'}
+
+ This example demonstrates a custom render method for the capture
+ button.
+ b&&(b=8),S=bb&&(b=8),S=b