Nodejs, Express, MySql, JQuery
-
install nvm source:https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/
-
install nodejs(version=10.17.0) using nvm.(command:
nvm install 10.17.0
) -
install mysql (version = 5.7)
sources:a.https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04
b. https://blog.zedfox.us/install-mysql-5-7-windows-10/ -
Install redis server.
a. for windows 10:
i. https://github.com/microsoftarchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip) (download this zipfile)
ii. follow the instructions from this site from step 2:
https://riptutorial.com/redis/example/29962/installing-and-running-redis-server-on-windowsb. for Ubuntu: https://codeforgeek.com/node-js-redis-tutorial-installation-commands/
-
Complete the preinstallations steps mentioned above.
-
git clone <repository link>
-
cd movie_booking_application
-
npm install
-
In the 'app.js' file update the following lines(for Mysql) according to your mysql'password'
host: 'localhost',
user: 'root', //mysql username
password : ' ', // type the mysql password which you have set.
database:'booking_movies' // mysql database name -
Open your terminal(linux/mac-os) or CMD(windows) for mysql and type the below 2 commands.
NOTE: Here, the password asked will be of your MySQL.mysql -u root -p -e "create database booking_movies"
mysql -u root -p booking_movies < database.sql
-
And now open another terminal-tab for starting the nodejs server.
Command:node app.js
(Now,the node-server will start at port:3000) -
Lastly,open your Browser and enter this URL:
localhost:3000/home
Note:All the '*' must have the mentioned version installed in your computer.
*mysql = 5.7
*nodejs = 10.17.0
redis = 3.0.6