Please add project constraints and design principles we should follow as needed.
testing the github bot
This program is run using Vagrant with the Laravel/Homestead 5.4 Virtual Box environment. Set up instructions can be found here:
##Setting up Vagrant/Homestead with our Project
-
Install Virtual Box with the default settings.
-
Install Vagrant with the default settings.
-
If you're on Windows, be sure that the "vagrnat" binary is in your System's Environment Variables.
-
Install Git Bash if you don't have it install.
-
Using Git Bash, run the command
vagrant
If Vagrant is properly installed, a list of possible commands should display.
-
Run the following command to install the laravel/homestead virtual box
vagrant box add laravel/homestead
-
Create the Homestead directory in your user home directory with the following commands
cd ~
git clone https://github.com/laravel/homestead.git Homestead -
Checkout a tagged version of Homestead
cd Homestead
git checkout v4.0.5 -
Once you've finished cloning, run the following:
// Mac / Linux...
bash init.sh
// Windows...
init.bat
-
This should create a Homestead.yaml file in your ~/Homestead directory.
-
Create the folder "Code" in your user's home directory.
-
Inside of the Code directory, run the following command in the Git Bash window:
git clone https://github.com/COSC3380-Team-5/databaseProject.git cosc3380
-
You should now have the cosc3380 project source code
-
Once you have downloaded the necessary software, use a text editor to open up the ~/Homestead/homesetad.yaml file.
-
Replace the lines in the "folders:" section with the following
map: ~/Code/cosc3380
to: /home/vagrant/Code/cosc3380- This will map the ~/Code/cosc3380 in your local directory to the /home/vagrant/Code/cosc3380 in the virtual machine
-
Replace the lines in the "sites:" section with the following
map: database.app
to: /home/vagrant/Code/cosc3380/public- This will map the domain database.app to pull the files in the /home/vagrant/Code/cosc3380 directory
-
Add an entry in the "databases:" section with the following
- cosc3380
-
Open up notepad.exe and run it as an administrator.
-
File > Open
- Go to "C:\Windows\System32\drivers\etc" and open the "hosts" file.
-
At the very bottom enter the following: "192.168.10.10 database.app"
- This will instruct your system to direct all HTTP requests to "database.app" to "192.168.10.10" which is the IP address of your local virtual machine while it's up.
-
Using Git Bash, navigate to your Homestead directory ("cd ~/Homestead") and run the following command:
- ssh-keygen -t rsa -C "you@homestead"
- This will create a .ssh directory with your ssh key inside for SSh-ing into your virtual machine.
-
Using Git Bash, navigate to your home directory and run
vagrant up
This will spin up your virtual environment.
- If vagrant times out at the ssh step, you may need to edit your BIOS settings and enable virtualization
-
Run the following commands.
vagrant ssh
- This will ssh you into the virtual machine environment
php Code/cosc3380/app/core/database/sql/factory.php
- This will build/populate the database with the dummy data for the app.
- You should see a list of files that were executed being printed to the terminal window.
-
You should now be able to go to "database.app" in your web browser to view the site.
- If you get a message saying "No input file selected" or something like that, make sure the git repository is in the correct location based on the "folders:" and "sites:" sections in the Homestead.yaml file.
- the "sites:" section should point to cosc3380/public directory and the nginx server will automatically look for the cosc3380/public/index.php file which is the entry point of the entire app.
-
There are comments throughout the source code for navigating what is going on
- Using Git Bash, go to your home directory
- cd ~
- do
touch .bashrc
- In a text editor, open this file (C:\Users<username>.bashrc)
- Add the following lines
alias ll="ls -alh" alias vgserve="cd ~/Homestead; vagrant up;"
- Close and relaunch Git Bash. You should now be able to use
- "ll" to list all files in the current directory in a formatted manner.
- "vgserve" to automatically navigate to your Homestead foler and spin up the virtual machine from any directory
- Select View > Tool Windows > Database
- A window should pop up on the right side. Click the Plus sign.
- Select Data Source
- Select MySQL
- A new window should pop up.
- Name: name it whatever you'd like that's specific to this project. cosc3380, for example.
- Host: 192.168.10.10
- Database: cosc3380
- User: homestead
- Password: secret
- URL: leave alone
- Driver: download if it's asking you to near the bottom
- Click Test Connection.
- Click Apply then Ok.
You should now be able to go to any SQL file within PHPStorm and press CTRL+Enter. You'll be prompted to select which statement you want to run.