- Node js
- NPM
- MySQL
git clone https://github.com/Akilan1999/Centralized_IOE.git
Navigate to the directory
cd Centralized_IOE/
Navigate to config/database.js
var connection = mysql.createConnection({
host: 'localhost',
user: 'ADD YOUR USERNAME', //DB username
password: 'ADD YOUR PASSWORD', //DB password
database: 'shared_electricity'
});
- Login to SQL
mysql -u root -p
- Import shared_electricity.sql
mysql> source \shared_electricity.sql;
- Basic insert statements which are nessary
mysql> insert into users values(0,'<your name>','<your username>','<your password>');
- Only for testing you can do some inserts statement (Remember the primary is auto_increment so once a insert is done the that table -> The next inserts should done without inserting the primary key value as it's automatically incremented);
Ex: This is for adding batteries
mysql> insert into battery_info values(0,2,'POWERWALL 1','Solar City',500,300);
mysql> insert into battery_info(user_id,model_no, manufacturing_company,Storage,Current_power) values(2,'POWERWALL 2','Solar City',500,500);
node app.js
If successful this should be your home page