To install node/react dependencies do this in command line
npm install
In /client
run npm install
#Running server & webpage
go into client and do: npm run build after that go back to main directroy and do node .\app.js npm run buid Server should now be on http://localhost:3000 To download MySQL Workbench follow this link (Also at the password step I just called it password): https://www.freecodecamp.org/news/how-to-install-mysql-workbench-on-windows/
If you then want to put MySQL into Webstrom:
- In the IDE go to files > settings > plugins > search bar: MySQL > install: Database Tools and SQL for Webstorm
- On the right side bar under the notifications icon there is a thing that looks like three circles statcked on each other click it
- Then click the + > Data Source > MySQL
- Download the missing files
- Click test connection near the the OK button
- When it asks for credentials put: User: root Password: password (or whatever you made your password as)
Put this in the console to create the table:
CREATE TABLE sys
.users
(
id
INT NOT NULL AUTO_INCREMENT,
email
VARCHAR(45) NOT NULL,
username
VARCHAR(45) NOT NULL,
password
VARCHAR(255) NOT NULL,
PRIMARY KEY (id
));
Put this in the console to get the table in Webstorm:
SELECT * FROM sys.users;
An error will appear first right click on it then: show context actions > choose schema > sys > Introspect schema
After that it should work.
To allow the Server to connect in the console for the database type these commands
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; flush privileges;
create palns table (put in console):
CREATE TABLE sys
.plans
(
id
INT NOT NULL AUTO_INCREMENT,
Intensity
VARCHAR(45) NOT NULL,
Type of Exercise
VARCHAR(45) NOT NULL,
Time
VARCHAR(45) NOT NULL,
Day
VARCHAR(45) NOT NULL,
PRIMARY KEY (id
));
INSERT INTO plans
VALUES (1,'light','cardio',15,'Monday'),
(2,'light','lower body',10,'Tuesday'),
(3,'light','upper body and core',10,'Wednesday'),
(4,'light','rest',0,'Thursday'),
(5,'light','lower body',10,'Friday'),
(6,'light','upper body',10,'Saturday'),
(7,'light','rest',0,'Sunday'),
(8,'medium','cardio',30,'Monday'),
(9,'medium','lower body',20,'Tuesday'),
(10,'medium','upper body and core',20,'Wednesday'),
(11,'medium','rest',0,'Thursday'),
(12,'medium','lower body',20,'Friday'),
(13,'medium','upper body',20,'Saturday'),
(14,'medium','rest',0,'Sunday'),
(15,'high','cardio',45,'Monday'),
(16,'high','lower body',30,'Tuesday'),
(17,'high','upper body and core',30,'Wednesday'),
(18,'high','rest',0,'Thursday'),
(19,'high','lower body',30,'Friday'),
(20,'high','upper body',30,'Saturday'),
(21,'high','rest',0,'Sunday');
Get plans table
SELECT * FROM sys.plans;
Add intensity to sys.users
ALTER TABLE sys
.users
ADD COLUMN `intensity` VARCHAR(45) NULL AFTER `password`;