-
Platform: Begin on a Windows system.
-
NodeJs Installation: Install NodeJs.
-
Initialization: Navigate to the specific folder of the Voting project using Command Prompt and initialize the project by entering the command npm init -y. This command creates the package.json file in the Voting folder.
-
Library Installation: Install necessary library files using the following commands in Command Prompt:
1. npm install express sqlite3 body-parser , 2. npm install cookie-parser
-
Folder Structure: Maintain the following folder/files structure.
-
Image Addition: Add an image of choice and update the names accordingly in both index.html and results.html files.
-
Service Start: Launch the service by entering the command in Command Prompt:
node server.js
-
Database Creation: The database votes.db will be automatically generated for the first time and will continue to update with subsequent service restarts.
-
IDE: Utilize Visual Studio Code for optimal development and deployment of the Voting site on a webpage.
-
Database Inspection: Install SQLite in Visual Studio Code to examine the votes.db file.
-
Open any browser and enter the URL - http://localhost:3000
-
To view the Results page enter the URL - http://localhost:3000/results
-
To view the Results page in json format enter the URL - http://localhost:3000/resultsData
-
To export the result page in excel enter the URL - http://localhost:3000/exportResults
By following these steps diligently, you can seamlessly set up the Voting webpage and ensure smooth functionality.