Special thanks to Vincent Mühler for open sourcing efforts on face recognision npm package Face API.
As the viewer of this repository you get an additional privilege to run this project without generating an infura ropsten network api key as it is already hardcoded into the code.
Step 1: Clone this repository using the command.
git clone https://github.com/pranav3714/BlockChainVoting.git
Step 2: Navigate to the cloned repository using.
cd BlockChainVoting
Step 3: Install the dependancies using.
npm i
Step 4: Use mongodb database.(This is a basic database architecture for test purposes only.)
Database name: panDatabase
Collection name: users
Document schema:
{ _id: objectID, name : string, pan : string, phone : string, image: base64encodedImage}
Document Sample:
{ _id : ObjectId("5e07a89511fe041fb1668b97"), "name" : "Raman Raaj", "pan" : "AAAPL1234C", "phone" : "9324679902", image: base64encodedImage }
Note:
Image of user can be encoded to base64 programmatically or using any online tool.(input image format expected is jpeg)
_id is automatically generated by Mongo
concepts like indexing and user authentication for efficiency and security respectively
Image can be inserted to the database using the image.js file in the project directory.
Step 5: Run the app.js file using node
node app.js
Step 6: Open a web browser and type in URL:
http://localhost:3000
TruffleJS(v5.1.8)
Make sure to add a .env file that contains following properties.
DB_URL = URL_TO_MONGODB
DB_NAME = "panDatabase"
DB_COLL = "users"
PRIVATE_KEY = ERC_20_WALLET_PRIVATE_KEY
MNEMONIC = ERC_20_WALLET_MNEMONIC_PHRASE
INFURA = "https://ropsten.infura.io/v3/075dda323f9b4c29a2bc22fd96cb29e6"
JWT_SECRET = SECURE_PASSWORD_TO_GENERATE_AND_AUTHERIZE_JWT
Click here to see detailed tutorial on deploying smart contract