This project is a web application that uses various Node.js packages and integrates with a MySQL database and a Ganache blockchain for implementing blockchain functionalities. Make sure to use sqlyog database, ganache and nodejs
- Installation
- Usage
- Dependencies
- Features
- License
-
Clone the repository:
git clone https://github.com/roiitanish86/evotin cd your-repo -
Install the dependencies:
npm install
-
Set up your MySQL database and update the configuration in the project. Start the server using npm start to connect the database.
-
Start Ganache and ensure it is running on
http://localhost:7545. -
Start the application:
npm start
-
Compile the smart contract and change the contract address:
Go to my-truffle-project directory and in terminal enter truffle compile and truffle migrate. This will create a new contract address for security purpose. Ensure to change the contract address in dash.js
-
You are ready to vote:
Start voting (Prototype version)
- The application provides a web interface for users to interact with the blockchain and the MySQL database.
- Users can vote in elections, and the votes are recorded on the blockchain.
- The application also displays current, upcoming, and past elections.
This project uses the following Node.js packages:
bcrypt@5.1.1: For hashing passwords.body-parser@1.20.3: For parsing incoming request bodies.cors@2.8.5: For enabling Cross-Origin Resource Sharing.express-session@1.18.1: For managing user sessions.express@4.21.1: For creating the web server.fs@0.0.1-security: For interacting with the file system.mysql@2.18.1: For connecting to the MySQL database.web3@4.15.0: For interacting with the Ethereum blockchain.
- User Authentication: Secure user authentication using
bcryptfor password hashing. - Database Integration: Connects to a MySQL database to store user and election data.
- Blockchain Integration: Uses Ganache to simulate a local blockchain for recording votes.
- RESTful API: Provides a RESTful API for interacting with the application.
- Responsive Design: A user-friendly interface that works on both desktop and mobile devices.
This project is licensed under the MIT License. See the LICENSE file for details.