Reference sheet for the project. To be edited when more relevant info needs to be displayed in a convenient location.
Since github doesn't track all of the files that are needed for the application to fucntion, there is some setup work that needs to be done. This guide is relevant for windows users, using Xampp to host the website locally.
Xampp for hosting the website. Apache, MySql and PHP are included in the instalation and don't have to be installed separately.
Composer for managing dependencies. I recommend to download the installer and not bother with the command line installation method.
Handy, but not necessarily needed:
Github desktop - a conveniant tool for collaboration with git. Provides a graphical user interface for
git, so work can be done without using the git bash.
Now when xampp is installed, you need to clone the reposiroty into the Xampp/htdocs folder. Instructions on how to clone a repository can be found here. Just don't forget to set the local path to a subfolder of Xampp/htdocs (example path: C:\Users\Rytis\Desktop\XAMPP\htdocs\realpro).
Since we're using Laravel framework our code is dependent on external libraries. To download those libraries follow these steps:
-
Run windows command prompt as an aministrator.
-
Navigate to /realpro directory (with cmd).
-
Run the following command:
composer install
All of the required libs should be installed now without the need to do anything else.
Laravel framework requires an encryption key and an .env file. This file should be located in \realpro folder along with .env.example. If it's not there (which it will likely be, if you cloned the repo), you need to create it and copy .env.example file content into it. This can be easily done by simply running this command in cmd (make sure you are in \realpro directory).
copy .env.example .envAfter the .env file is there and filled with .env.example content, run:
php artisan key:generateNavigate to \realpro directory and run the following commands into cmd:
mkdir storage
cd storage
mkdir app
mkdir cache
mkdir framework
mkdir logs
cd framework
mkdir cache
mkdir logs
mkdir sessions
mkdir viewsYou can simply just copy-paste the entire thing into cmd and it will be run without the need of pasting each command one by one.
First you need to create the database itself and setup a user account for that database using phpmyadmin. Instructions on how to to that
can be found Here. Don't create any tables yet, that will
be done through migrations.
Once that is done, open up the .env file (located in \realpro) and change DB_DATABASE, DB_USERNAME and DB_PASSWORD to match the values that you chose during database creation process.
To check if the database is connected open your browser and type http://localhost/realpro/ (link may differ depending on your repository folder name). If no error appears and you see the home page, it means the database was connected succesfully. If you see an error, check your .env file.
Once the database is connected, navigate to \realpro folder with cmd and run the following command:
php artisan migrateAll the required tables will be created using the migration files located here