Added base app

Has basic login UI, has methods to run speedtests
This commit is contained in:
Henry Whitaker
2020-04-08 13:57:26 +01:00
parent e9fdc98fd3
commit 0062ac6960
114 changed files with 120193 additions and 1 deletions

56
routes/api.php Normal file
View File

@@ -0,0 +1,56 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::group(
[
'middleware' => 'api',
'prefix' => 'auth'
],
function ($router) {
Route::post('register', 'AuthController@register')->name('auth.register');
Route::get('verify-email', 'AuthController@verifyEmail')->middleware('throttle:5,1')->name('auth.verify_email');
Route::post('login', 'AuthController@login')->middleware('throttle:10,1')->name('auth.login');
Route::get('logout', 'AuthController@logout')->name('auth.logout');
Route::get('refresh', 'AuthController@refresh')->middleware(['throttle:5,1' ])->name('auth.refresh');
Route::get('me', 'AuthController@me')->middleware(['session_active' ])->name('auth.me');
Route::put('details', 'UserController@update')->name('auth.user.update_details');
Route::group(
[
'middleware' => ['api', 'session_active' ],
'prefix' => 'sessions'
],
function($router) {
Route::get('/', 'AuthController@getSessions')->name('auth.sessions.all');
Route::delete('/{id}', 'AuthController@deleteSession')->name('auth.sessions.delete');
}
);
}
);
Route::group([
'middleware' => [ 'api', 'session_active' ],
'prefix' => 'speedtest'
], function($router) {
Route::get('latest', 'SpeedtestController@latest')->name('speedtest.latest');
Route::get('run', 'SpeedtestController@run')->name('speedtest.run');
});

14
routes/channels.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
use Illuminate\Support\Facades\Broadcast;
/*
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all of the event broadcasting channels that your
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
|
*/

15
routes/console.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/

20
routes/web.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/{path?}', function() {
return view('app', [ 'title' => 'Speedtest Checker' ]);
})
->where('path', '.*')
->name('react');