Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 34 additions & 30 deletions .github/workflows/production-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,37 @@ jobs:
name: Production

steps:
- uses: actions/checkout@v3
- name: Deploy to production
uses: appleboy/ssh-action@master
env:
SSH_BUILD_DIRECTORY: ${{ secrets.SSH_BUILD_DIRECTORY }}
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
envs: SSH_BUILD_DIRECTORY
script: |
cd $SSH_BUILD_DIRECTORY

echo "Enabling maintenance mode"
php artisan down

echo "Pulling latest code"
git checkout -f main
git pull origin main
php artisan migrate --force

echo "Running composer"
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader --no-dev
composer dump-autoload

echo "Optimizing Laravel app"
php artisan optimize:clear

echo "Disabling maintenance mode"
php artisan up
- uses: actions/checkout@v3
- name: Deploy to production
uses: appleboy/ssh-action@master
env:
SSH_BUILD_DIRECTORY: ${{ secrets.SSH_BUILD_DIRECTORY }}
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
envs: SSH_BUILD_DIRECTORY
script: |
cd $SSH_BUILD_DIRECTORY

echo "Enabling maintenance mode"
php artisan down

echo "Pulling latest code"
git checkout -f main
git pull origin main
php artisan migrate --force

echo "Running composer"
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader --no-dev
composer dump-autoload

echo "Building frontend assets"
npm install
npm run build

echo "Optimizing Laravel app"
php artisan optimize:clear

echo "Disabling maintenance mode"
php artisan up
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
Expand Down
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":2,"defects":{"Tests\\Feature\\Auth\\AuthenticationTest::test_users_can_authenticate_using_the_login_screen":8,"Tests\\Feature\\Auth\\EmailVerificationTest::test_email_can_be_verified":8,"Tests\\Feature\\Auth\\PasswordConfirmationTest::test_password_can_be_confirmed":7,"Tests\\Feature\\Auth\\RegistrationTest::test_new_users_can_register":8},"times":{"Tests\\Unit\\ExampleTest::test_basic_test":0.005,"Tests\\Feature\\Auth\\AuthenticationTest::test_login_screen_can_be_rendered":0.068,"Tests\\Feature\\Auth\\AuthenticationTest::test_users_can_authenticate_using_the_login_screen":0.04,"Tests\\Feature\\Auth\\AuthenticationTest::test_users_can_not_authenticate_with_invalid_password":0.238,"Tests\\Feature\\Auth\\EmailVerificationTest::test_email_verification_screen_can_be_rendered":0.016,"Tests\\Feature\\Auth\\EmailVerificationTest::test_email_can_be_verified":0.042,"Tests\\Feature\\Auth\\EmailVerificationTest::test_email_is_not_verified_with_invalid_hash":0.036,"Tests\\Feature\\Auth\\PasswordConfirmationTest::test_confirm_password_screen_can_be_rendered":0.016,"Tests\\Feature\\Auth\\PasswordConfirmationTest::test_password_can_be_confirmed":0.007,"Tests\\Feature\\Auth\\PasswordConfirmationTest::test_password_is_not_confirmed_with_invalid_password":0.212,"Tests\\Feature\\Auth\\PasswordResetTest::test_reset_password_link_screen_can_be_rendered":0.003,"Tests\\Feature\\Auth\\PasswordResetTest::test_reset_password_link_can_be_requested":0.236,"Tests\\Feature\\Auth\\PasswordResetTest::test_reset_password_screen_can_be_rendered":0.224,"Tests\\Feature\\Auth\\PasswordResetTest::test_password_can_be_reset_with_valid_token":0.249,"Tests\\Feature\\Auth\\RegistrationTest::test_registration_screen_can_be_rendered":0.002,"Tests\\Feature\\Auth\\RegistrationTest::test_new_users_can_register":0.006,"Tests\\Feature\\ExampleTest::test_basic_test":0.002}}
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ Check our [prerequisites](./docs/prerequisites.md) to get started.

### Installation

Use our [installation guidelines](./docs/installation.md) to set up the project on your local.
To download the UAT database, use the following [link]((https://drive.google.com/file/d/1LQ2Cqd9dbY8G1WqsbfmF2D5h8rMarKjm/view?usp=sharing))
Use our [installation guidelines](./docs/installation.md) to set up the project on your local.
To download the UAT database, use the following [link]((https://drive.google.com/file/d/1LQ2Cqd9dbY8G1WqsbfmF2D5h8rMarKjm/view?usp=sharing))

### Deployment

The project uses GitHub Actions for deployment. Ensure the target server has Node.js and NPM installed as the deployment script runs `npm install` and `npm run build` on the server.
42 changes: 0 additions & 42 deletions app/Console/Kernel.php

This file was deleted.

53 changes: 0 additions & 53 deletions app/Exceptions/Handler.php

This file was deleted.

3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/AuthenticatedSessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\LoginRequest;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
Expand Down Expand Up @@ -36,7 +35,7 @@ public function store(LoginRequest $request)

$request->session()->regenerate();

return redirect()->intended(RouteServiceProvider::HOME);
return redirect()->intended('/monitors');
}

/**
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/ConfirmPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ConfirmsPasswords;

class ConfirmPasswordController extends Controller
Expand All @@ -26,7 +25,7 @@ class ConfirmPasswordController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = '/monitors';

/**
* Create a new controller instance.
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/ConfirmablePasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;
Expand Down Expand Up @@ -39,6 +38,6 @@ public function store(Request $request)

$request->session()->put('auth.password_confirmed_at', time());

return redirect()->intended(RouteServiceProvider::HOME);
return redirect()->intended('/monitors');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;

class EmailVerificationNotificationController extends Controller
Expand All @@ -16,7 +15,7 @@ class EmailVerificationNotificationController extends Controller
public function store(Request $request)
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(RouteServiceProvider::HOME);
return redirect()->intended('/monitors');
}

$request->user()->sendEmailVerificationNotification();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use Inertia\Inertia;

Expand All @@ -17,7 +16,7 @@ class EmailVerificationPromptController extends Controller
public function __invoke(Request $request)
{
return $request->user()->hasVerifiedEmail()
? redirect()->intended(RouteServiceProvider::HOME)
? redirect()->intended('/monitors')
: Inertia::render('Auth/VerifyEmail', ['status' => session('status')]);
}
}
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
Expand All @@ -26,7 +25,7 @@ class LoginController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = '/monitors';

/**
* Create a new controller instance.
Expand Down
7 changes: 3 additions & 4 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use App\User;
use App\Models\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
Expand All @@ -29,7 +28,7 @@ class RegisterController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = '/monitors';

/**
* Create a new controller instance.
Expand Down Expand Up @@ -58,7 +57,7 @@ protected function validator(array $data)
/**
* Create a new user instance after a valid registration.
*
* @return \App\User
* @return \App\Models\User
*/
protected function create(array $data)
{
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Http\Controllers\Controller;
use App\Models\User;
use App\Providers\RouteServiceProvider;
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
Expand Down Expand Up @@ -49,6 +48,6 @@ public function store(Request $request)

Auth::login($user);

return redirect(RouteServiceProvider::HOME);
return redirect('/monitors');
}
}
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/ResetPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ResetsPasswords;

class ResetPasswordController extends Controller
Expand All @@ -26,5 +25,5 @@ class ResetPasswordController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = '/monitors';
}
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/VerificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\VerifiesEmails;

class VerificationController extends Controller
Expand All @@ -26,7 +25,7 @@ class VerificationController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = '/monitors';

/**
* Create a new controller instance.
Expand Down
5 changes: 2 additions & 3 deletions app/Http/Controllers/Auth/VerifyEmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Auth\Events\Verified;
use Illuminate\Foundation\Auth\EmailVerificationRequest;

Expand All @@ -17,13 +16,13 @@ class VerifyEmailController extends Controller
public function __invoke(EmailVerificationRequest $request)
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
return redirect()->intended('/monitors'.'?verified=1');
}

if ($request->user()->markEmailAsVerified()) {
event(new Verified($request->user()));
}

return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
return redirect()->intended('/monitors'.'?verified=1');
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers;

use App\Http\Requests\UserRequest;
use App\User;
use App\Models\User;
use Inertia\Inertia;

class UsersController extends Controller
Expand Down
Loading