Movie Ticket Reservation System
To run locally for development
Install MySql Server
Install the MySQL server by using the Ubuntu operating system package manager:
sudo apt-get update
sudo apt-get install mysql-server
The installer installs MySQL and all dependencies.
If the secure installation utility does not launch automatically after the installation completes, enter the following command:
sudo mysql_secure_installation utility
Set the password as "root".
This utility prompts you to define the mysql root password and other security-related options, including removing remote access to the root user and setting the root password.
After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running:
sudo systemctl start mysql
To ensure that the database server launches after a reboot, run the following command:
sudo systemctl enable mysql
Restart the mysql service.
sudo systemctl restart mysql
Start the MySql shell:
sudo mysql -u root -p
Enter password as "root" when prompted.
The following mysql shell prompt should appear:
mysql>
Run the following to use MySql without sudo:
mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
mysql > FLUSH PRIVILEGES;
mysql > CREATE DATABASE csye7220;
mysql > exit
Run the backend microservice
- Click here to Download Spring Tools Suite (STS IDE)
- Open the
backend-microservice
andsecurity-backend-microservice
project in STS - Run it as a Springboot Application
Run ReactJS front end
- Make sure you have node and npm installed. Click here and follow the instructions to install the latest versions
- Open a terminal and navigate inside the directory
recipe-frontend
- Run
npm run install-deps
to install all the dependencies - Run
npm run start-dev
- Now open your browser and go to http://localhost:8080
- Now, you should be able to see a home page at http://localhost:8080
To run on kubernetes cluster on AWS
Requirements
NOTE
This project was developed on an ubuntu 18.04 system. It supports every major OS, provided the above requirements are fulfilled. Though it is recommended to use a UNIX based OS (especially ubuntu 18.04).
In order to simplify the process of meeting the requirements, we have a install-dependencies.sh
bash script to install all the depending tools. Follow the steps below:
- Create an s3 bucket on AWS named
<your-bucket-name>
- Navigate to the root of this project in your terminal
- Run
./install-dependencies.sh
- It will prompt you to enter the name of your s3 bucket
<your-bucket-name>
(that you have to create forkops
to work. This is mentioned in the 1st step) - The last step in the script is AWS configuration, hence, you will be prompted to enter your
AWS access key
,AWS access key ID
,default region
(recommended: 'us-east-1') anddefault output
- If you have followed this, you can skip to step 2 in the next section
Start Cluster and app using the ansible-playbook
- Create an s3 bucket on AWS named
<your-bucket-name>
- Open terminal and navigate to
infrastructure
directory - Run the following command to start the kubernetes server on AWS
ansible-playbook main.yaml --extra-vars "command=start cluster_name=k8s.local kops_state_store=s3://<your-bucket-name>"
- Run the following command to note down the password for your grafana dashboard
Note that this is a base64 encoded string, use any tool to decode it and note it down
kubectl -n grafana get secret grafana -o json
- Run the following command to view the external IPS of your 3 apps - frontend, frontend-post and grafana
kubectl get svc --all-namespaces
- Note the URLs for the LoadBalancer created for all three of your Apps
- Open these URLs in your browser
- For the grafana dashboard, use the username as
admin
and for password use the decoded string from step 4
Delete the created cluster and free your resources when done using
- Open terminal and navigate to
infrastructure
directory - Run the following command to delete the kubernetes server on AWS
ansible-playbook main.yaml --extra-vars "command=delete cluster_name=k8s.local kops_state_store=s3://<your-bucket-name>"