- PHP >= 7.0.0
- composer
- npm
- Install the requirements
Note: Follow the instructions accordingly depending on your operating systems.
- Download the Laravel Installer using
composer
composer global require "laravel/installer"
- Place the composer's
vendor/bin
directory in your$PATH
variable- macOS:
$HOME
/.composer/vendor/bin - Windows: C:\Users\USERNAME\AppData\Roaming\Composer\vendor\bin
- macOS:
The executable
laravel
should now be available in your local machine.
This project is using Google Sheets API to fetch scores.
-
Install
Laravel Socialite
:
composer require laravel/socialite
- Put the details on the
.env
file with the following:
GOOGLE_SERVER_KEY=[your_api_key]
GOOGLE_CLIENT_ID=[Oauth2_client_ID]
GOOGLE_APP_SECRET=[Oauth2_client_secret]
GOOGLE_REDIRECT=http://localhost:8000/login/google/callback
Don't forget to run
php artisan config:clear
after changing the.env
file.
-
Navigate to
/login/google
and follow the instructions on the page. -
After seeing the success message, navigate to
/score
-
Key in the password for each OG (at the bottom of the page) to view the results
- Clone this branch
git clone -b <BRANCHNAME> https://github.com/dheamariesta/gtd.git
- Move to the gtd directory and install the necessary dependencies using Composer
cd gtd
composer install
You should be able to run
php artisan
command.
- Copy the
.env.example
file to the.env
file
cp .env.example .env
Note: For Windows, use copy
:
copy .env.example .env
You should have a brand new
.env
file right now
- Generate application key
php artisan key:generate
- Run the application on the localhost using the Artisan command
php artisan serve
- Visit
localhost:8000
in your web browser
You must have
npm
installed on your machine. Refer to here
- Install all npm dependencies
npm install
- Compile assets
npm run dev
Alternatively, you can use the watcher command:
npm run watch
.
- Build the assets in production mode in your local computer
npm run production
- Copy all the application files to the
${webRoot}
(web root directory of your server). Usually, the web root is thepublic_html
directory.
This can be done via FTP, but will take a long time. Preferably, you will want to create a repository on this directory. To do so, you need to have SSH Access. Contact your hosting admistrator for more information. After that, refer to SSH Access below.
-
Set the document root of your domain to the
public
directory of your app. (For example, given your app's directory name is gtd, then the document root is${webRoot}/gtd/public
) -
Edit the
.env
file in the app's root directory
APP_DEBUG=false
APP_URL=[your_domain_url]
If you need to use database, then create your own database in your server and then update the
.env
file accordingly:
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
Similarly, if you need the mail feature, edit the following:
MAIL_HOST=
MAIL_USERNAME=
MAIL_PASSWORD=
-
Navigate to your
${webRoot}
directory -
Clone this repository to the current directory
git clone -b <BRANCHNAME> https://github.com/dheamariesta/gtd.git .
- Install php dependencies
composer install
Make sure composer is installed globally
- Copy the
.env.example
file to the.env
file
cp .env.example .env
You should have a brand new
.env
file right now
- Generate application key
php artisan key:generate
- Your website should be deployed
If you need to create database tables based on your migration files, then you can also run the migration
artisan
command. Make sure that you have created the database and update the .env accordingly.
php artisan migrate
php artisan migrate
fails with errors similar to the following:
[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
Workaround:
- Edit the
boot
method inAppServiceProvider.php
file inapp/Providers
directory
// import Laravel's Facade (this is important!)
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
- If you encounter any errors during compiling assets, probably you have not fully installed the npm packages. Run the command below:
npm install
MIT