Setting Up
Follow these steps to run the project in your local environment and start contributing.
Prerequisite
All of these must be done before anything:
Local web server setup
You may use Laragon, XAMPP, or anything you like.
Laragon
-
Run the
laragon.exe. -
Click on
Start All. -
Clone the repository inside the
../wwwfolder. -
Do every project setup step from start to finish.
-
Open
http://{project_name}.test/e.g. http://project-manager.test/
XAMPP
-
Navigate to
../apache/conf/extraand edit thehttpd-vhosts.conffile with a text editor, then add the code snippet below with your own path:<VirtualHost *:80>DocumentRoot "C:/XAMPP/htdocs/tournament-manager/public"ServerName http://tournament-manager.test/<Directory "C:/XAMPP/htdocs/tournament-manager/public">AllowOverride AllRequire all granted</Directory></VirtualHost> -
Navigate to
C:/Windows/System32/drivers/etc/and open thehostsfile as administrator, then add this line:127.0.0.1 tournament-manager.testHow to open
hostsfile as administratorIf the button to
Run as administratordid not appear, do these steps:- Open your text editor as administrator.
- Click on
File -> Open. - Navigate to the
C:/Windows/System32/drivers/etc/. - Open
hosts.
-
Run the
XAMPP Control Panelas administrator.tipYou can set the shortcut to always run as administrator by
right clicking the shortcut -> Properties -> Advanced -> check Run as administrator. -
Start both
ApacheandMySQL. These can be set to autostart in Config. -
Clone the repository inside the
../htdocsfolder. -
Do every project setup step from start to finish.
Project setup
Cloning repository
Run these commands in a terminal of your choice.
git clone https://github.com/Xerillia/tournament-manager.git
cd tournament-manager
Installing dependencies
composer install
npm install
Ensure you are in the project folder, e.g. ../tournament-manager before running the commands.
Creating .env
The following section is done inside the project folder.
-
Duplicate the
.env.examplefile in the project folder and rename it to.env -
Generate an
APP_KEYby running this command:php artisan key:Generate -
Set the
APP_URLfield accordingly. -
Set the
DB_CONNECTIONfield and its configuration.dangerDo not use
sqlitebecause it will not work. -
Setup the OAuth APIs by following the sections below:
OAuth setups
osu!
-
Open the osu! account settings page and scroll down to the
OAuthsection. -
Click on
New OAuth Application. -
Set the
Application Nameto anything you want. -
Set the
Application Callback URLsto{APP_URL}/osu/callback, e.g. http://tournament-manager.test/osu/callback.infoThe URI path must be
/osu/callback. -
Click on
Register application. -
Click on
Editfrom the newly made application. -
Copy the value under
Client IDand paste it to theOSU_CLIENT_IDfield in the.envfile. -
Click on
Show client secret, then copy the value underClient Secret, and paste it to theOSU_CLIENT_SECRETfield. -
Done.
Discord
-
Open the Discord Developer Portal page.
-
Click on
New Application. -
Set the
Nameto anything you want, then create the app. -
Navigate to the
OAuth2tab through the sidebar on the left. -
Click on
Add Redirectthen set it to{APP_URL}/discord/callback, e.g. http://tournament-manager.test/discord/callback.infoThe URI path must be
/discord/callback. -
Copy the
Client IDvalue and paste it to theDISCORD_CLIENT_IDfield in the.envfile. -
Click on
Reset Secretto generate a newClient Secret, then copy the value and paste it to theDISCORD_CLIENT_SECRETfield.warningThe value will be shown only once, then be permanently hidden once the page is closed or refreshed.
-
Done.
Database migrations
Run this command in the project directory to load the database tables.
php artisan migrate
Optional: seed the tables with predetermined and/or generated data.
php artisan db:seed
Development environment
Always have this command running while developing the app:
composer run dev
Building application
npm run build