Our application builds three virtual machines, two web servers and one database, which all communicate to allow for users to fill out a request form, then have it stored and displayed to an admin who can accept or decline the request.
The purpose of each of our VMs, why they are separate VMs, and how they interact.
- First VM: A website which a user can fill out a request form
- Second VM: A database containing the request forms
- Third VM: A web page for administrative purposes to accept/decline requests
The first virtual machine hosts a web page which a user can go to and will be prompted to fill out a request form which consists of the users details and a description of their request. The user will then be taken to a confirmation web page which displays the information they provided.
The second virtual machine hosts a database containing the request forms. It holds the details provided by the user, the current status of the request, as well as an ID and timestamp generated by the database.
The third virtual machine hosts the admin web page, where admins can view, accept, and decline requests. This is a separate virtual machine to the first VM as we only want admins to be able to access this web page.
The two web server VMs are both connected to the database VM. After a user fills out a request form the first VM sends that to the database. When an admin loads the admin web page the third VM queries the database to populate the page, then after an admin accepts or declines a request the VM sends a corresponding update to the database.
- Vagrant: https://www.vagrantup.com/
- VirtualBox: https://www.virtualbox.org/
Clone into the repository at https://github.com/regan-lj/ApprovalProcess.git and cd into the directory that is created.
$ vagrant up
To open the first web server, where a user can submit a request:
$ open http://127.0.0.1:8080/ // Mac user
$ start http://127.0.0.1:8080/ // Windows user
$ xdg-open http://127.0.0.1:8080/ // Linux user
To open the second web server, where an admin can view and respond to requests:
$ open http://127.0.0.1:8081/admin.php // Mac user
$ start http://127.0.0.1:8081/admin.php // Windows user
$ xdg-open http://127.0.0.1:8081/admin.php // Linux user
To access the database itself:
$ vagrant ssh dbserver
$ export MYSQL_PWD=’insecure_mysqlroot_pw’
$ mysql -u root
$ use fvision
Remember to shut down once finished:
$ vagrant destroy