-
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 = 10.17.0)
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 <this repository link on the right corner> -
cd movie_booking_application -
npm install(it will install all the required dependencies present in the 'package.json' file.) -
In the 'app.js' file update the following lines(for Mysql) according to your '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 or GUI based-app 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
-
Open a new-terminal(1st) and start the redis-server.
redis-server &redis-cli
-
And now open another terminal(2nd) for starting the nodejs server.
Command:nodemon app.js(Now,the 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.29
*nodejs = 10.17.0
redis = 3.0.6
`/etc/init.d/redis-server stop`
keys *get <keyname(session)>