Skip to main content

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

  1. Install laragon.

  2. Run the laragon.exe.

  3. Click on Start All.

  4. Clone the repository inside the ../www folder.

  5. Do every project setup step from start to finish.

  6. Open http://{project_name}.test/ e.g. http://project-manager.test/

XAMPP

  1. Install XAMPP.

  2. Navigate to ../apache/conf/extra and edit the httpd-vhosts.conf file 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 All
    Require all granted
    </Directory>
    </VirtualHost>
  3. Navigate to C:/Windows/System32/drivers/etc/ and open the hosts file as administrator, then add this line:

    127.0.0.1 tournament-manager.test
    How to open hosts file as administrator

    If the button to Run as administrator did not appear, do these steps:

    1. Open your text editor as administrator.
    2. Click on File -> Open.
    3. Navigate to the C:/Windows/System32/drivers/etc/.
    4. Open hosts.
  4. Run the XAMPP Control Panel as administrator.

    tip

    You can set the shortcut to always run as administrator by
    right clicking the shortcut -> Properties -> Advanced -> check Run as administrator.

  5. Start both Apache and MySQL. These can be set to autostart in Config.

  6. Clone the repository inside the ../htdocs folder.

  7. Do every project setup step from start to finish.

  8. Open http://tournament-manager.test

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
note

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.

  1. Duplicate the .env.example file in the project folder and rename it to .env

  2. Generate an APP_KEY by running this command:

    php artisan key:Generate
  3. Set the APP_URL field accordingly.

  4. Set the DB_CONNECTION field and its configuration.

    danger

    Do not use sqlite because it will not work.

  5. Setup the OAuth APIs by following the sections below:

OAuth setups

osu!

  1. Open the osu! account settings page and scroll down to the OAuth section.

  2. Click on New OAuth Application.

  3. Set the Application Name to anything you want.

  4. Set the Application Callback URLs to {APP_URL}/osu/callback, e.g. http://tournament-manager.test/osu/callback.

    info

    The URI path must be /osu/callback.

  5. Click on Register application.

  6. Click on Edit from the newly made application.

  7. Copy the value under Client ID and paste it to the OSU_CLIENT_ID field in the .env file.

  8. Click on Show client secret, then copy the value under Client Secret, and paste it to the OSU_CLIENT_SECRET field.

  9. Done.

Discord

  1. Open the Discord Developer Portal page.

  2. Click on New Application.

  3. Set the Name to anything you want, then create the app.

  4. Navigate to the OAuth2 tab through the sidebar on the left.

  5. Click on Add Redirect then set it to {APP_URL}/discord/callback, e.g. http://tournament-manager.test/discord/callback.

    info

    The URI path must be /discord/callback.

  6. Copy the Client ID value and paste it to the DISCORD_CLIENT_ID field in the .env file.

  7. Click on Reset Secret to generate a new Client Secret, then copy the value and paste it to the DISCORD_CLIENT_SECRET field.

    warning

    The value will be shown only once, then be permanently hidden once the page is closed or refreshed.

  8. 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