diff --git a/.gitignore b/.gitignore index a595b21..a0dddc6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,3 @@ yarn-error.log* *.njsproj *.sln *.sw? - -# Traefik related files -/letsencrypt diff --git a/backend/.env.testing b/backend/.env.testing new file mode 100644 index 0000000..3916403 --- /dev/null +++ b/backend/.env.testing @@ -0,0 +1,43 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=sqlite +DB_DATABASE="test.sqlite" + + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/backend/Dockerfile b/backend/Dockerfile index 1ec8a92..e30283a 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -29,6 +29,4 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local RUN chown -R www-data:www-data /var/www/html \ && a2enmod rewrite -EXPOSE 3000 - RUN cd /var/www/html && composer install && php artisan key:generate \ No newline at end of file diff --git a/backend/app/Http/Controllers/Api/EventsController.php b/backend/app/Http/Controllers/Api/EventsController.php index 490aaf0..29cfaca 100644 --- a/backend/app/Http/Controllers/Api/EventsController.php +++ b/backend/app/Http/Controllers/Api/EventsController.php @@ -24,10 +24,26 @@ public function index() /** * Store a newly created resource in storage. + * StoreFacultyRequest $request + * * @return Event */ public function store(Request $request) { - // + if ($request->input('id_repeat') === null) { + return Event::create($request->only([ + 'name', + 'desc', + 'room', + 'beginning', + 'end', + 'attendance_limit', + 'id_user', + 'id_place', + 'id_faculty', + 'id_department', + ])); + } + } /** @@ -45,7 +61,22 @@ public function show($id) */ public function update(Request $request, $id) { - // + + $event = Event::findOrFail($id); + $event->update($request->only([ + 'name', + 'desc', + 'room', + 'beginning', + 'end', + 'attendance_limit', + 'id_user', + 'id_place', + 'id_faculty', + 'id_department' + + ])); + return $event; } /** @@ -53,6 +84,6 @@ public function update(Request $request, $id) */ public function destroy($id) { - // + } } diff --git a/backend/app/Http/Controllers/Api/PicturesController.php b/backend/app/Http/Controllers/Api/PicturesController.php index b6bc88b..c10b94a 100644 --- a/backend/app/Http/Controllers/Api/PicturesController.php +++ b/backend/app/Http/Controllers/Api/PicturesController.php @@ -56,7 +56,7 @@ public function show($id) public function update(StorePictureRequest $request, $id) { $picture = Picture::findOrFail($id); - $picture->update($request->only(['línk', 'id_event'])); + $picture->update($request->only(['link', 'id_event'])); return $picture; } diff --git a/backend/app/Http/Controllers/Api/UsersController.php b/backend/app/Http/Controllers/Api/UsersController.php index dafb799..0c94711 100644 --- a/backend/app/Http/Controllers/Api/UsersController.php +++ b/backend/app/Http/Controllers/Api/UsersController.php @@ -4,7 +4,12 @@ use App\Http\Controllers\Controller; use App\Http\Requests\StoreUserRequest; +use App\Http\Requests\UserLoginRequest; +use App\Http\Requests\UserRegisterRequest; +use App\Models\Role; use App\Models\User; +use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Auth; /** * Class UsersController @@ -31,8 +36,12 @@ public function index() */ public function store(StoreUserRequest $request) { - return User::create($request->only([ + $user = User::create($request->only([ 'name', 'surname', 'email', 'password', 'id_role'])); + + // for testing purposes + $user->makeVisible(['password']); + return $user; } /** @@ -58,6 +67,9 @@ public function update(StoreUserRequest $request, $id) $user = User::findOrFail($id); $user->update($request->only([ 'name', 'surname', 'email', 'password', 'id_role'])); + + // for testing purposes + $user->makeVisible(['password']); return $user; } @@ -71,4 +83,83 @@ public function destroy($id) { // TODO: discuss with team } + + /** + * Login user + * + * @param UserLoginRequest $request + * @return JsonResponse + */ + public function login(UserLoginRequest $request) + { + // Attempt to login + if (!Auth::attempt([ + 'email' => $request->input('email'), + 'password' => $request->input('password'), + ])) { + return response()->json([ + 'success' => false, + 'message' => 'You have entered the wrong login information!']); + } + + // create token to user and return it + $accessToken = Auth::user()->createToken('authToken')->accessToken; + return response()->json([ + 'success' => true, + 'message' => 'Login was successful', + 'user' => Auth::user(), + 'access_token' => $accessToken]); + } + + /** + * Register new user + * + * @param UserRegisterRequest $request + * @return JsonResponse + */ + public function register(UserRegisterRequest $request) + { + // get data from request + $input = [ + 'name' => $request->input('name'), + 'surname' => $request->input('surname'), + 'email' => $request->input('email'), + 'id_role' => Role::where('type', 'pouzivatel')->value('id'), + 'password' => bcrypt($request->input('password')), + ]; + + // create new user + $user = User::create($input); + + // create token to the user and return it with user + $accessToken = $user->createToken('authToken')->accessToken; + return response()->json([ + 'success' => true, + 'message' => 'User registered successfully', + 'user' => $user, + 'access_token' => $accessToken]); + } + + /** + * Logout user + * + * @return JsonResponse + */ + public function logout() + { + if (Auth::user()) { + $user = Auth::user()->token(); + $user->revoke(); + + return response()->json([ + 'success' => true, + 'message' => 'Logout successfully' + ]); + } else { + return response()->json([ + 'success' => false, + 'message' => 'Unable to Logout' + ]); + } + } } diff --git a/backend/app/Http/Kernel.php b/backend/app/Http/Kernel.php index deb65e8..7bf7c14 100644 --- a/backend/app/Http/Kernel.php +++ b/backend/app/Http/Kernel.php @@ -14,6 +14,7 @@ class Kernel extends HttpKernel * @var array */ protected $middleware = [ + \Fruitcake\Cors\HandleCors::class, \App\Http\Middleware\TrustProxies::class, \App\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, diff --git a/backend/app/Http/Requests/UserLoginRequest.php b/backend/app/Http/Requests/UserLoginRequest.php new file mode 100644 index 0000000..09418a3 --- /dev/null +++ b/backend/app/Http/Requests/UserLoginRequest.php @@ -0,0 +1,37 @@ + 'required|string|email|max:255', + 'password' => 'required|string|min:6|max:255', + ]; + } +} diff --git a/backend/app/Http/Requests/UserRegisterRequest.php b/backend/app/Http/Requests/UserRegisterRequest.php new file mode 100644 index 0000000..cf2ef83 --- /dev/null +++ b/backend/app/Http/Requests/UserRegisterRequest.php @@ -0,0 +1,51 @@ + 'required|string|max:255', + 'surname' => 'required|string|max:255', + 'email' => 'required|string|email|max:255|unique:users', + 'password' => 'required|string|min:6|max:255' + ]; + } + + /** + * Get the custom validation messages + * + * @return array|string[] + */ + public function messages() + { + return [ + 'email.unique' => 'An email is already used', + ]; + } +} diff --git a/backend/app/Models/User.php b/backend/app/Models/User.php index e6dfa1e..96d630e 100644 --- a/backend/app/Models/User.php +++ b/backend/app/Models/User.php @@ -2,17 +2,19 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use Illuminate\Foundation\Auth\User as Authenticatable; +use Illuminate\Notifications\Notifiable; +use Laravel\Passport\HasApiTokens; /** * Class CreateRepeatsTable * - * @author klukak + * @author klukak, lacal */ -class User extends Model +class User extends Authenticatable { - use SoftDeletes; + use SoftDeletes, Notifiable, HasApiTokens; /** * The attributes that aren´t max assignable @@ -21,6 +23,24 @@ class User extends Model */ protected $guarded = ['id']; + /** + * The attributes that should be hidden for arrays. + * + * @var array + */ + protected $hidden = [ + 'password', + ]; + + /** + * The attributes that should be cast to native types. + * + * @var array + */ + protected $casts = [ + 'email_verified_at' => 'datetime', + ]; + /** * Get the role */ diff --git a/backend/app/Providers/AppServiceProvider.php b/backend/app/Providers/AppServiceProvider.php index ee8ca5b..07ec012 100644 --- a/backend/app/Providers/AppServiceProvider.php +++ b/backend/app/Providers/AppServiceProvider.php @@ -2,8 +2,14 @@ namespace App\Providers; +use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; +/** + * Class AppServiceProvider + * + * @author lacal + */ class AppServiceProvider extends ServiceProvider { /** @@ -23,6 +29,6 @@ public function register() */ public function boot() { - // + Schema::defaultStringLength(191); } } diff --git a/backend/app/Providers/AuthServiceProvider.php b/backend/app/Providers/AuthServiceProvider.php index 3049068..1167726 100644 --- a/backend/app/Providers/AuthServiceProvider.php +++ b/backend/app/Providers/AuthServiceProvider.php @@ -3,8 +3,13 @@ namespace App\Providers; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; -use Illuminate\Support\Facades\Gate; +use Laravel\Passport\Passport; +/** + * Class AuthServiceProvider + * + * @author lacal + */ class AuthServiceProvider extends ServiceProvider { /** @@ -13,7 +18,7 @@ class AuthServiceProvider extends ServiceProvider * @var array */ protected $policies = [ - // 'App\Model' => 'App\Policies\ModelPolicy', + 'App\Model' => 'App\Policies\ModelPolicy', ]; /** @@ -25,6 +30,6 @@ public function boot() { $this->registerPolicies(); - // + Passport::routes(); } } diff --git a/backend/composer.json b/backend/composer.json index 78126e9..879f122 100644 --- a/backend/composer.json +++ b/backend/composer.json @@ -10,7 +10,9 @@ "require": { "php": "^7.2", "fideloper/proxy": "^4.0", + "fruitcake/laravel-cors": "^2.0", "laravel/framework": "^6.18.35", + "laravel/passport": "^8.0", "laravel/tinker": "^2.0" }, "require-dev": { diff --git a/backend/composer.lock b/backend/composer.lock index 2895134..b24a8ad 100644 --- a/backend/composer.lock +++ b/backend/composer.lock @@ -4,8 +4,123 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0a030c40c9ab7c2e125a5e48f9c72ca8", + "content-hash": "e77f9f776dcb509f76ab06b3ca6ff4d6", "packages": [ + { + "name": "asm89/stack-cors", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/asm89/stack-cors.git", + "reference": "8d8f88b3b3830916be94292c1fbce84433efb1aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/asm89/stack-cors/zipball/8d8f88b3b3830916be94292c1fbce84433efb1aa", + "reference": "8d8f88b3b3830916be94292c1fbce84433efb1aa", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0", + "symfony/http-foundation": "~2.7|~3.0|~4.0|~5.0", + "symfony/http-kernel": "~2.7|~3.0|~4.0|~5.0" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Asm89\\Stack\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander", + "email": "iam.asm89@gmail.com" + } + ], + "description": "Cross-origin resource sharing library and stack middleware", + "homepage": "https://github.com/asm89/stack-cors", + "keywords": [ + "cors", + "stack" + ], + "time": "2020-10-29T16:03:21+00:00" + }, + { + "name": "defuse/php-encryption", + "version": "v2.2.1", + "source": { + "type": "git", + "url": "https://github.com/defuse/php-encryption.git", + "reference": "0f407c43b953d571421e0020ba92082ed5fb7620" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/defuse/php-encryption/zipball/0f407c43b953d571421e0020ba92082ed5fb7620", + "reference": "0f407c43b953d571421e0020ba92082ed5fb7620", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "paragonie/random_compat": ">= 2", + "php": ">=5.4.0" + }, + "require-dev": { + "nikic/php-parser": "^2.0|^3.0|^4.0", + "phpunit/phpunit": "^4|^5" + }, + "bin": [ + "bin/generate-defuse-key" + ], + "type": "library", + "autoload": { + "psr-4": { + "Defuse\\Crypto\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Hornby", + "email": "taylor@defuse.ca", + "homepage": "https://defuse.ca/" + }, + { + "name": "Scott Arciszewski", + "email": "info@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "Secure PHP Encryption Library", + "keywords": [ + "aes", + "authenticated encryption", + "cipher", + "crypto", + "cryptography", + "encrypt", + "encryption", + "openssl", + "security", + "symmetric key cryptography" + ], + "time": "2018-07-24T23:27:56+00:00" + }, { "name": "dnoegel/php-xdg-base-dir", "version": "v0.1.1", @@ -322,61 +437,518 @@ "validation", "validator" ], - "time": "2020-09-26T15:48:38+00:00" + "time": "2020-09-26T15:48:38+00:00" + }, + { + "name": "fideloper/proxy", + "version": "4.4.0", + "source": { + "type": "git", + "url": "https://github.com/fideloper/TrustedProxy.git", + "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8", + "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0", + "php": ">=5.4.0" + }, + "require-dev": { + "illuminate/http": "^5.0|^6.0|^7.0|^8.0", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Fideloper\\Proxy\\TrustedProxyServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Fideloper\\Proxy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Fidao", + "email": "fideloper@gmail.com" + } + ], + "description": "Set trusted proxies for Laravel", + "keywords": [ + "load balancing", + "proxy", + "trusted proxy" + ], + "time": "2020-06-23T01:36:47+00:00" + }, + { + "name": "firebase/php-jwt", + "version": "v5.2.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "feb0e820b8436873675fd3aca04f3728eb2185cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/feb0e820b8436873675fd3aca04f3728eb2185cb", + "reference": "feb0e820b8436873675fd3aca04f3728eb2185cb", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": ">=4.8 <=9" + }, + "type": "library", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "time": "2020-03-25T18:49:23+00:00" + }, + { + "name": "fruitcake/laravel-cors", + "version": "v2.0.3", + "source": { + "type": "git", + "url": "https://github.com/fruitcake/laravel-cors.git", + "reference": "01de0fe5f71c70d1930ee9a80385f9cc28e0f63a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/01de0fe5f71c70d1930ee9a80385f9cc28e0f63a", + "reference": "01de0fe5f71c70d1930ee9a80385f9cc28e0f63a", + "shasum": "" + }, + "require": { + "asm89/stack-cors": "^2.0.1", + "illuminate/contracts": "^6|^7|^8|^9", + "illuminate/support": "^6|^7|^8|^9", + "php": ">=7.2", + "symfony/http-foundation": "^4|^5", + "symfony/http-kernel": "^4.3.4|^5" + }, + "require-dev": { + "laravel/framework": "^6|^7|^8", + "orchestra/testbench-dusk": "^4|^5|^6", + "phpunit/phpunit": "^6|^7|^8", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + }, + "laravel": { + "providers": [ + "Fruitcake\\Cors\\CorsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Fruitcake\\Cors\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fruitcake", + "homepage": "https://fruitcake.nl" + }, + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application", + "keywords": [ + "api", + "cors", + "crossdomain", + "laravel" + ], + "funding": [ + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2020-10-22T13:57:20+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.5.5", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2020-06-16T21:01:06+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "60d379c243457e073cff02bc323a2a86cb355631" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", + "reference": "60d379c243457e073cff02bc323a2a86cb355631", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2020-09-30T07:37:28+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", + "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2020-09-30T07:37:11+00:00" + }, + { + "name": "laminas/laminas-diactoros", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-diactoros.git", + "reference": "36ef09b73e884135d2059cc498c938e90821bb57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/36ef09b73e884135d2059cc498c938e90821bb57", + "reference": "36ef09b73e884135d2059cc498c938e90821bb57", + "shasum": "" + }, + "require": { + "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.1", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "conflict": { + "phpspec/prophecy": "<1.9.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "replace": { + "zendframework/zend-diactoros": "^2.2.1" + }, + "require-dev": { + "ext-curl": "*", + "ext-dom": "*", + "ext-gd": "*", + "ext-libxml": "*", + "http-interop/http-factory-tests": "^0.5.0", + "laminas/laminas-coding-standard": "~1.0.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5.18" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "Laminas\\Diactoros\\ConfigProvider", + "module": "Laminas\\Diactoros" + } + }, + "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php", + "src/functions/create_uploaded_file.legacy.php", + "src/functions/marshal_headers_from_sapi.legacy.php", + "src/functions/marshal_method_from_sapi.legacy.php", + "src/functions/marshal_protocol_version_from_sapi.legacy.php", + "src/functions/marshal_uri_from_sapi.legacy.php", + "src/functions/normalize_server.legacy.php", + "src/functions/normalize_uploaded_files.legacy.php", + "src/functions/parse_cookie_header.legacy.php" + ], + "psr-4": { + "Laminas\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "PSR HTTP Message implementations", + "homepage": "https://laminas.dev", + "keywords": [ + "http", + "laminas", + "psr", + "psr-17", + "psr-7" + ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2020-09-03T14:29:41+00:00" }, { - "name": "fideloper/proxy", - "version": "4.4.0", + "name": "laminas/laminas-zendframework-bridge", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/fideloper/TrustedProxy.git", - "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8" + "url": "https://github.com/laminas/laminas-zendframework-bridge.git", + "reference": "6ede70583e101030bcace4dcddd648f760ddf642" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8", - "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8", + "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6ede70583e101030bcace4dcddd648f760ddf642", + "reference": "6ede70583e101030bcace4dcddd648f760ddf642", "shasum": "" }, "require": { - "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0", - "php": ">=5.4.0" + "php": "^5.6 || ^7.0 || ^8.0" }, "require-dev": { - "illuminate/http": "^5.0|^6.0|^7.0|^8.0", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", + "squizlabs/php_codesniffer": "^3.5" }, "type": "library", "extra": { - "laravel": { - "providers": [ - "Fideloper\\Proxy\\TrustedProxyServiceProvider" - ] + "laminas": { + "module": "Laminas\\ZendFrameworkBridge" } }, "autoload": { + "files": [ + "src/autoload.php" + ], "psr-4": { - "Fideloper\\Proxy\\": "src/" + "Laminas\\ZendFrameworkBridge\\": "src//" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "authors": [ + "description": "Alias legacy ZF class names to Laminas Project equivalents.", + "keywords": [ + "ZendFramework", + "autoloading", + "laminas", + "zf" + ], + "funding": [ { - "name": "Chris Fidao", - "email": "fideloper@gmail.com" + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" } ], - "description": "Set trusted proxies for Laravel", - "keywords": [ - "load balancing", - "proxy", - "trusted proxy" - ], - "time": "2020-06-23T01:36:47+00:00" + "time": "2020-09-14T14:23:00+00:00" }, { "name": "laravel/framework", @@ -527,6 +1099,79 @@ ], "time": "2020-10-13T14:20:24+00:00" }, + { + "name": "laravel/passport", + "version": "v8.5.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/passport.git", + "reference": "6affa6ed600c5f8909385fbae7cf6f8af3db2d39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/passport/zipball/6affa6ed600c5f8909385fbae7cf6f8af3db2d39", + "reference": "6affa6ed600c5f8909385fbae7cf6f8af3db2d39", + "shasum": "" + }, + "require": { + "ext-json": "*", + "firebase/php-jwt": "^3.0|^4.0|^5.0", + "guzzlehttp/guzzle": "^6.0", + "illuminate/auth": "^6.0|^7.0", + "illuminate/console": "^6.0|^7.0", + "illuminate/container": "^6.0|^7.0", + "illuminate/contracts": "^6.0|^7.0", + "illuminate/cookie": "^6.0|^7.0", + "illuminate/database": "^6.0|^7.0", + "illuminate/encryption": "^6.0|^7.0", + "illuminate/http": "^6.0|^7.0", + "illuminate/support": "^6.0|^7.0", + "laminas/laminas-diactoros": "^2.2", + "league/oauth2-server": "^8.0", + "nyholm/psr7": "^1.0", + "php": "^7.2", + "phpseclib/phpseclib": "^2.0", + "symfony/psr-http-message-bridge": "^2.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "orchestra/testbench": "^4.4|^5.0", + "phpunit/phpunit": "^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Passport\\PassportServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Passport\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel Passport provides OAuth2 server support to Laravel.", + "keywords": [ + "laravel", + "oauth", + "passport" + ], + "time": "2020-05-05T14:25:53+00:00" + }, { "name": "laravel/tinker", "version": "v2.4.2", @@ -591,6 +1236,71 @@ ], "time": "2020-08-11T19:28:08+00:00" }, + { + "name": "lcobucci/jwt", + "version": "3.3.3", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "c1123697f6a2ec29162b82f170dd4a491f524773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/c1123697f6a2ec29162b82f170dd4a491f524773", + "reference": "c1123697f6a2ec29162b82f170dd4a491f524773", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-openssl": "*", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "mikey179/vfsstream": "~1.5", + "phpmd/phpmd": "~2.2", + "phpunit/php-invoker": "~1.1", + "phpunit/phpunit": "^5.7 || ^7.3", + "squizlabs/php_codesniffer": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Lcobucci\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Luís Otávio Cobucci Oblonczyk", + "email": "lcobucci@gmail.com", + "role": "Developer" + } + ], + "description": "A simple library to work with JSON Web Token and JSON Web Signature", + "keywords": [ + "JWS", + "jwt" + ], + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2020-08-20T13:22:28+00:00" + }, { "name": "league/commonmark", "version": "1.5.6", @@ -686,6 +1396,56 @@ ], "time": "2020-10-17T21:33:03+00:00" }, + { + "name": "league/event", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/event.git", + "reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/event/zipball/d2cc124cf9a3fab2bb4ff963307f60361ce4d119", + "reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "~1.0.1", + "phpspec/phpspec": "^2.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Event\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Event package", + "keywords": [ + "emitter", + "event", + "listener" + ], + "time": "2018-11-26T11:52:41+00:00" + }, { "name": "league/flysystem", "version": "1.0.46", @@ -770,6 +1530,89 @@ ], "time": "2018-08-22T07:45:22+00:00" }, + { + "name": "league/oauth2-server", + "version": "8.1.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/oauth2-server.git", + "reference": "09f22e8121fa1832962dba18213b80d4267ef8a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/09f22e8121fa1832962dba18213b80d4267ef8a3", + "reference": "09f22e8121fa1832962dba18213b80d4267ef8a3", + "shasum": "" + }, + "require": { + "defuse/php-encryption": "^2.2.1", + "ext-json": "*", + "ext-openssl": "*", + "lcobucci/jwt": "^3.3.1", + "league/event": "^2.2", + "php": ">=7.2.0", + "psr/http-message": "^1.0.1" + }, + "replace": { + "league/oauth2server": "*", + "lncd/oauth2": "*" + }, + "require-dev": { + "laminas/laminas-diactoros": "^2.3.0", + "phpstan/phpstan": "^0.11.19", + "phpstan/phpstan-phpunit": "^0.11.2", + "phpunit/phpunit": "^8.5.4 || ^9.1.3", + "roave/security-advisories": "dev-master" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\OAuth2\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alex Bilbie", + "email": "hello@alexbilbie.com", + "homepage": "http://www.alexbilbie.com", + "role": "Developer" + }, + { + "name": "Andy Millington", + "email": "andrew@noexceptions.io", + "homepage": "https://www.noexceptions.io", + "role": "Developer" + } + ], + "description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.", + "homepage": "https://oauth2.thephpleague.com/", + "keywords": [ + "Authentication", + "api", + "auth", + "authorisation", + "authorization", + "oauth", + "oauth 2", + "oauth 2.0", + "oauth2", + "protect", + "resource", + "secure", + "server" + ], + "funding": [ + { + "url": "https://github.com/sephster", + "type": "github" + } + ], + "time": "2020-07-01T11:33:50+00:00" + }, { "name": "monolog/monolog", "version": "2.1.1", @@ -992,15 +1835,88 @@ ], "authors": [ { - "name": "Nikita Popov" + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2020-09-26T10:30:38+00:00" + }, + { + "name": "nyholm/psr7", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "21b71a31eab5c0c2caf967b9c0fd97020254ed75" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/21b71a31eab5c0c2caf967b9c0fd97020254ed75", + "reference": "21b71a31eab5c0c2caf967b9c0fd97020254ed75", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "php-http/message-factory": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "dev-master", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5", + "symfony/error-handler": "^4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "A fast PHP7 implementation of PSR-7", + "homepage": "http://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" } ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2020-09-26T10:30:38+00:00" + "time": "2020-06-13T15:59:10+00:00" }, { "name": "opis/closure", @@ -1108,6 +2024,56 @@ ], "time": "2018-07-02T15:55:56+00:00" }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, { "name": "phpoption/phpoption", "version": "1.7.5", @@ -1173,6 +2139,111 @@ ], "time": "2020-07-20T17:29:33+00:00" }, + { + "name": "phpseclib/phpseclib", + "version": "2.0.29", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "497856a8d997f640b4a516062f84228a772a48a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/497856a8d997f640b4a516062f84228a772a48a8", + "reference": "497856a8d997f640b4a516062f84228a772a48a8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phing/phing": "~2.7", + "phpunit/phpunit": "^4.8.35|^5.7|^6.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "suggest": { + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2020-09-08T04:24:43+00:00" + }, { "name": "psr/container", "version": "1.0.0", @@ -1222,6 +2293,108 @@ ], "time": "2017-02-14T16:28:37+00:00" }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, { "name": "psr/log", "version": "1.1.3", @@ -1389,6 +2562,46 @@ ], "time": "2020-05-03T19:32:03+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "ramsey/uuid", "version": "3.9.3", @@ -3155,6 +4368,84 @@ ], "time": "2020-09-02T16:08:58+00:00" }, + { + "name": "symfony/psr-http-message-bridge", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "51a21cb3ba3927d4b4bf8f25cc55763351af5f2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/51a21cb3ba3927d4b4bf8f25cc55763351af5f2e", + "reference": "51a21cb3ba3927d4b4bf8f25cc55763351af5f2e", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0", + "symfony/http-foundation": "^4.4 || ^5.0" + }, + "require-dev": { + "nyholm/psr7": "^1.1", + "symfony/phpunit-bridge": "^4.4 || ^5.0" + }, + "suggest": { + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\PsrHttpMessage\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "PSR HTTP message bridge", + "homepage": "http://symfony.com", + "keywords": [ + "http", + "http-message", + "psr-17", + "psr-7" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-29T08:17:46+00:00" + }, { "name": "symfony/routing", "version": "v4.4.15", @@ -4854,6 +6145,7 @@ "faker", "fixtures" ], + "abandoned": true, "time": "2019-12-12T13:22:17+00:00" }, { diff --git a/backend/config/auth.php b/backend/config/auth.php index aaf982b..1192b86 100644 --- a/backend/config/auth.php +++ b/backend/config/auth.php @@ -42,7 +42,7 @@ ], 'api' => [ - 'driver' => 'token', + 'driver' => 'passport', 'provider' => 'users', 'hash' => false, ], @@ -68,7 +68,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => App\Models\User::class, ], // 'users' => [ diff --git a/backend/config/cors.php b/backend/config/cors.php new file mode 100644 index 0000000..9856dd3 --- /dev/null +++ b/backend/config/cors.php @@ -0,0 +1,65 @@ + ['api/*'], + + /* + * To disable CORS, uncomment 'paths' below and comment 'paths' above. + */ + // 'paths' => [''], + + /* + * Matches the request method. `['*']` allows all methods. + */ + 'allowed_methods' => ['*'], + + /* + * Matches the request origin. `['*']` allows all origins. Wildcards can be used, eg `*.mydomain.com` + */ + 'allowed_origins' => ['*'], + + /* + * Patterns that can be used with `preg_match` to match the origin. + */ + 'allowed_origins_patterns' => [], + + /* + * Sets the Access-Control-Allow-Headers response header. `['*']` allows all headers. + */ + 'allowed_headers' => ['*'], + + /* + * Sets the Access-Control-Expose-Headers response header with these headers. + */ + 'exposed_headers' => [], + + /* + * Sets the Access-Control-Max-Age response header when > 0. + */ + 'max_age' => 0, + + /* + * Sets the Access-Control-Allow-Credentials header. + */ + 'supports_credentials' => false, +]; diff --git a/backend/config/passport.php b/backend/config/passport.php new file mode 100644 index 0000000..95a4892 --- /dev/null +++ b/backend/config/passport.php @@ -0,0 +1,33 @@ + env('PASSPORT_PRIVATE_KEY'), + + 'public_key' => env('PASSPORT_PUBLIC_KEY'), + + /* + |-------------------------------------------------------------------------- + | Client UUIDs + |-------------------------------------------------------------------------- + | + | By default, Passport uses auto-incrementing primary keys when assigning + | IDs to clients. However, if Passport is installed using the provided + | --uuids switch, this will be set to "true" and UUIDs will be used. + | + */ + + 'client_uuids' => false, + +]; diff --git a/backend/routes/api.php b/backend/routes/api.php index b7a829f..96d5b4f 100644 --- a/backend/routes/api.php +++ b/backend/routes/api.php @@ -1,7 +1,6 @@ get('/user', function (Request $request) { - return $request->user(); +/* + * Prefix for user authentication routes + */ +Route::prefix('users')->group(function () { + Route::post('login', 'Api\UsersController@login'); + Route::post('register', 'Api\UsersController@register'); + Route::get('logout', 'Api\UsersController@logout')->middleware('auth:api'); }); Route::namespace('Api')->group(function () { @@ -33,6 +37,9 @@ Route::apiResource('users', 'UsersController'); }); +/* + * Route for filtering events according parameters + */ Route::get('events', function () { $query = Event::query(); diff --git a/backend/test.sqlite b/backend/test.sqlite new file mode 100644 index 0000000..e69de29 diff --git a/backend/tests/Feature/CategoryTest.php b/backend/tests/Feature/CategoryTest.php new file mode 100644 index 0000000..dded418 --- /dev/null +++ b/backend/tests/Feature/CategoryTest.php @@ -0,0 +1,46 @@ + 'test']; + $this->json('POST', route('categories.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating Category + */ + public function test_can_update_category() + { + + $category = factory(Category::class)->create(); + $data = ['name' => 'testovanie']; + + $this->json('PUT', route('categories.update', $category->id), $data) + ->assertStatus(200) + ->assertJson($data); + + } + +} diff --git a/backend/tests/Feature/CitiesTest.php b/backend/tests/Feature/CitiesTest.php new file mode 100644 index 0000000..b815c71 --- /dev/null +++ b/backend/tests/Feature/CitiesTest.php @@ -0,0 +1,54 @@ + 'Lapáš', + 'id_state' => factory(State::class)->create()->id, + ]; + $this->withoutExceptionHandling(); + $this->json('POST', route('cities.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + public function test_can_update_city() + { + $state = factory(State::class)->create()->id; + $city = factory(City::class)->create(); + $data = [ + 'name' => 'Veľký Lapáš', + 'id_state' => $state, + ]; + $this->withoutExceptionHandling(); + $this->json('PUT', route('cities.update', $city->id), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/DepartmentsTest.php b/backend/tests/Feature/DepartmentsTest.php new file mode 100644 index 0000000..ce5157e --- /dev/null +++ b/backend/tests/Feature/DepartmentsTest.php @@ -0,0 +1,64 @@ +seed(); + } + + + /** + * Test: Creating Department + */ + public function test_can_create_department() + { + + $data = [ + 'name' => 'Informatika', + 'id_faculty' => Faculty::all()->random()->id, + ]; + $this->withoutExceptionHandling(); + $this->json('POST', route('departments.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating departments + */ + public function test_can_update_department() + { + $faculty = Faculty::all()->random()->id; + $department = Department::all()->random()->id; + $data = [ + 'name' => 'testovanie', + 'id_faculty' => $faculty, + ]; + $this->withoutExceptionHandling(); + $this->json('PUT', route('departments.update', $department), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/EventsTest.php b/backend/tests/Feature/EventsTest.php new file mode 100644 index 0000000..35c81fc --- /dev/null +++ b/backend/tests/Feature/EventsTest.php @@ -0,0 +1,88 @@ +seed(); + } + + /** + * Test: Creating Events + */ + public function test_can_create_event() + { + + + $data = [ + 'name' => $this->faker->numerify('Event ##'), + 'desc' => $this->faker->text($maxNbChars = 500), + 'room' => $this->faker->numerify('S-###'), + 'beginning' => '2001-08-03 09:42:42.000000', + 'end' => '2001-10-03 09:42:42.000000', + 'attendance_limit' => $this->faker->numberBetween($min = 20, $max = 300), + 'id_user' => factory(User::class)->create()->id, + 'id_place' => factory(Place::class)->create()->id, + 'id_faculty' => Faculty::all()->random()->id, + 'id_department' => Department::all()->random()->id, + //'id_repeat' => factory(Repeat::class)->create()->id, + + ]; + $this->withoutExceptionHandling(); + $this->json('POST', route('events.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating Events + */ + public function test_can_update_event() + { + + + $event = factory(Event::class)->create(); + $data = [ + 'name' => $this->faker->numerify('Event ##'), + 'desc' => $this->faker->text($maxNbChars = 500), + 'room' => $this->faker->numerify('S-###'), + 'beginning' => '2020-08-03 09:42:42.000000', + 'end' => '2020-10-03 09:42:42.000000', + 'attendance_limit' => $this->faker->numberBetween($min = 20, $max = 300), + 'id_user' => factory(User::class)->create()->id, + 'id_place' => factory(Place::class)->create()->id, + 'id_faculty' => Faculty::all()->random()->id, + 'id_department' => Department::all()->random()->id, + //'id_repeat' => factory(Repeat::class)->create()->id, + ]; + $this->withoutExceptionHandling(); + $this->json('PUT', route('events.update', $event->id), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/ExampleTest.php b/backend/tests/Feature/ExampleTest.php index cdb5111..8fbf370 100644 --- a/backend/tests/Feature/ExampleTest.php +++ b/backend/tests/Feature/ExampleTest.php @@ -2,7 +2,6 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class ExampleTest extends TestCase diff --git a/backend/tests/Feature/FacultiesTest.php b/backend/tests/Feature/FacultiesTest.php new file mode 100644 index 0000000..0c41e42 --- /dev/null +++ b/backend/tests/Feature/FacultiesTest.php @@ -0,0 +1,56 @@ +seed(); + } + + + /** + * Test: Creating Faculties + */ + public function test_can_create_faculty() + { + $data = ['name' => 'politologia']; + $this->withoutExceptionHandling(); + $this->json('POST', route('faculties.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating Faculties + */ + public function test_can_update_faculty() + { + + $faculty = Faculty::all()->random()->id; + $data = ['name' => 'testovanie']; + $this->withoutExceptionHandling(); + $this->json('PUT', route('faculties.update', $faculty), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/FiltersTest.php b/backend/tests/Feature/FiltersTest.php new file mode 100644 index 0000000..a5c058d --- /dev/null +++ b/backend/tests/Feature/FiltersTest.php @@ -0,0 +1,55 @@ +seed(); + } + + /** + * Test: Creating Filters + */ + public function test_can_create_filter() + { + $data = ['name' => 'test']; + $this->withoutExceptionHandling(); + $this->json('POST', route('filters.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating Filters + */ + public function test_can_update_filter() + { + + $filter = Filter::all()->random()->id; + $data = ['name' => 'testovanie']; + $this->withoutExceptionHandling(); + $this->json('PUT', route('filters.update', $filter), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/PicturesTest.php b/backend/tests/Feature/PicturesTest.php new file mode 100644 index 0000000..016d3b6 --- /dev/null +++ b/backend/tests/Feature/PicturesTest.php @@ -0,0 +1,64 @@ +seed(); + } + + /** + * Test: Creating pictures + */ + public function test_can_create_picture() + { + + $data = [ + 'link' => $this->faker->imageUrl(), + 'id_event' => factory(Event::class)->create()->id, + ]; + $this->withoutExceptionHandling(); + $this->json('POST', route('pictures.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating pictures + */ + public function test_can_update_picture() + { + $event = factory(Event::class)->create()->id; + $picture = factory(Picture::class)->create()->id; + $data = [ + 'link' => $this->faker->imageUrl(), + 'id_event' => $event, + ]; + $this->withoutExceptionHandling(); + $this->json('PUT', route('pictures.update', $picture), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/PlacesTest.php b/backend/tests/Feature/PlacesTest.php new file mode 100644 index 0000000..4ff33e7 --- /dev/null +++ b/backend/tests/Feature/PlacesTest.php @@ -0,0 +1,57 @@ +create(); + $data = [ + 'name' => 'Za školou 8111', + 'id_city' => factory(City::class)->create()->id, + ]; + $this->withoutExceptionHandling(); + $this->json('POST', route('places.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating cities + */ + public function test_can_update_city() + { + factory(State::class)->create(); + $city = factory(City::class)->create()->id; + $place = factory(Place::class)->create(); + $data = [ + 'name' => 'testovanie', + 'id_city' => $city, + ]; + $this->withoutExceptionHandling(); + $this->json('PUT', route('places.update', $place->id), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/RepeatsTest.php b/backend/tests/Feature/RepeatsTest.php new file mode 100644 index 0000000..29eada0 --- /dev/null +++ b/backend/tests/Feature/RepeatsTest.php @@ -0,0 +1,57 @@ + $this->faker->randomElement(['rok', 'mesiac', 'den']), + 'repeatNumber' => $this->faker->randomDigitNot(0), + 'repeatUntil' => '2001-08-03 09:42:42.000000', + ]; + $this->withoutExceptionHandling(); + $this->json('POST', route('repeats.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: updating repeats + */ + public function test_can_update_repeat() + { + + $repeat = factory(Repeat::class)->create(); + $data = [ + 'repeatUnit' => $this->faker->randomElement(['rok', 'mesiac', 'den']), + 'repeatNumber' => $this->faker->randomDigitNot(0), + 'repeatUntil' => '2001-08-03 09:42:42.000000' + ]; + $this->withoutExceptionHandling(); + $this->json('PUT', route('repeats.update', $repeat->id), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/RolesTest.php b/backend/tests/Feature/RolesTest.php new file mode 100644 index 0000000..8018ae4 --- /dev/null +++ b/backend/tests/Feature/RolesTest.php @@ -0,0 +1,55 @@ +seed(); + } + + /** + * Test: creating roles + */ + public function test_can_create_role() + { + $data = ['type' => 'test']; + $this->withoutExceptionHandling(); + $this->json('POST', route('roles.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: updating roles + */ + public function test_can_update_role() + { + + $role = Role::all()->random()->id; + $data = ['type' => 'testovanie']; + $this->withoutExceptionHandling(); + $this->json('PUT', route('roles.update', $role), $data) + ->assertStatus(200) + ->assertJson($data); + + } +} diff --git a/backend/tests/Feature/StatesTest.php b/backend/tests/Feature/StatesTest.php new file mode 100644 index 0000000..15721d6 --- /dev/null +++ b/backend/tests/Feature/StatesTest.php @@ -0,0 +1,48 @@ + 'Slovensko']; + $this->withoutExceptionHandling(); + $this->json('POST', route('states.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating state + */ + public function test_can_update_state() + { + + $state = factory(State::class)->create(); + $data = ['name' => 'testovanie']; + $this->withoutExceptionHandling(); + $this->json('PUT', route('states.update', $state->id), $data) + ->assertStatus(200) + ->assertJson($data); + + } + +} diff --git a/backend/tests/Feature/UsersTest.php b/backend/tests/Feature/UsersTest.php new file mode 100644 index 0000000..addcd47 --- /dev/null +++ b/backend/tests/Feature/UsersTest.php @@ -0,0 +1,76 @@ +seed(); + + + } + + /** + * Test: Creating User + */ + public function test_can_create_user() + { + $data = [ + 'name' => $this->faker->firstName, + 'surname' => $this->faker->lastName, + 'email' => $this->faker->safeEmail, + 'password' => $this->faker->password, + 'id_role' => Role::all()->random()->id, + + + ]; + $this->withoutExceptionHandling(); + $this->json('POST', route('users.store'), $data) + ->assertStatus(201) + ->assertJson($data); + + + } + + /** + * Test: Updating User + */ + public function test_can_update_user() + { + + $user = factory(User::class)->create(); + $data = [ + 'name' => $this->faker->firstName, + 'surname' => $this->faker->lastName, + 'email' => $this->faker->safeEmail, + 'password' => $this->faker->password, + 'id_role' => Role::all()->random()->id, + + + ]; + $this->withoutExceptionHandling(); + $this->json('PUT', route('users.update', $user), $data) + ->assertStatus(200) + ->assertJson($data); + + } + +} diff --git a/docker-compose.yaml b/docker-compose.yaml index 66c524b..09c18e9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,7 +20,7 @@ services: build: ./backend image: "backend" ports: - - 3000:80 + - 8000:80 restart: ${DOCKER_RESTART_POLICY:-always} networks: - network @@ -29,7 +29,7 @@ services: build: ./frontend image: "frontend" ports: - - 8080:8080 + - 80:80 restart: ${DOCKER_RESTART_POLICY:-always} networks: - network diff --git a/dynamic.yaml b/dynamic.yaml deleted file mode 100644 index 7966918..0000000 --- a/dynamic.yaml +++ /dev/null @@ -1,6 +0,0 @@ -## Setting up the middleware for redirect to https ## -http: - middlewares: - redirect: - redirectScheme: - scheme: https \ No newline at end of file diff --git a/frontend/.env b/frontend/.env index 16d7401..efe4b5f 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1,2 +1,3 @@ VUE_APP_I18N_LOCALE=sk VUE_APP_I18N_FALLBACK_LOCALE=en +VUE_APP_BACKEND_URL=http://localhost:8000/api \ No newline at end of file diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 6b43200..f5a43c4 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -5,7 +5,7 @@ module.exports = { }, extends: ["plugin:vue/essential", "@vue/prettier"], rules: { - "no-console": process.env.NODE_ENV === "production" ? "error" : "off", + "no-console": "off", "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" }, parserOptions: { diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 603dc9d..3475f8d 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,23 +1,12 @@ -# example Dockerfile from https://vuejs.org/v2/cookbook/dockerize-vuejs-app.html -FROM node:lts-alpine - -# install simple http server for serving static content -RUN npm install -g http-server - -# make the 'app' folder the current working directory +# build stage +FROM node:lts-alpine as build-stage WORKDIR /app - -# copy both 'package.json' and 'package-lock.json' (if available) COPY package*.json ./ - -# install project dependencies RUN npm install - -# copy project files and folders to the current working directory (i.e. 'app' folder) COPY . . - -# build app for production with minification RUN npm run build -EXPOSE 8080 -CMD [ "http-server", "dist" ] \ No newline at end of file +# production stage +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist /usr/share/nginx/html +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7d1d115..c81a586 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1906,9 +1906,9 @@ } }, "vue-loader-v16": { - "version": "npm:vue-loader@16.0.0-beta.9", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.9.tgz", - "integrity": "sha512-mu9pg6554GbXDSO8LlxkQM6qUJzUkb/A0FJc9LgRqnU9MCnhzEXwCt1Zx5NObvFpzs2mH2dH/uUCDwL8Qaz9sA==", + "version": "npm:vue-loader@16.0.0-rc.1", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-rc.1.tgz", + "integrity": "sha512-yR+BS90EOXTNieasf8ce9J3TFCpm2DGqoqdbtiwQ33hon3FyIznLX7sKavAq1VmfBnOeV6It0Htg4aniv8ph1g==", "dev": true, "optional": true, "requires": { diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 3bbfb98..14b4b38 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,7 +1,6 @@ diff --git a/frontend/src/components/event/EventCardComponent.vue b/frontend/src/components/event/EventCardComponent.vue index 77639e9..9e8f7b2 100644 --- a/frontend/src/components/event/EventCardComponent.vue +++ b/frontend/src/components/event/EventCardComponent.vue @@ -1,247 +1,268 @@ -/* -* -* Created by: Martin Gajdos -* Date: 26. 10. 2020 -* -* Description: This component takes in all the event data coming from EventListComponent and renders -* them in a card-like style. -* -*/ +/* * * Created by: Martin Gajdos * Date: 26. 10. 2020 * * Description: This +component takes in all the event data coming from EventListComponent and renders +* them in a card-like style. * */ \ No newline at end of file +.card-container { + max-width: 500px; +} + +.alignLeft { + float: left !important; +} +.alignRight { + float: right !important; +} + +.column { + margin: 20px; + + .panel .panel-heading { + color: white; + } +} + +.tagsSection { + padding: 10px; + margin: 0; + width: max-content; +} + +._card { + padding: 0px; + margin: 10px; + border-radius: 10px; + -webkit-box-shadow: 0px 18px 42px -17px rgba(0, 0, 0, 0.74); + -moz-box-shadow: 0px 18px 42px -17px rgba(0, 0, 0, 0.74); + box-shadow: 0px 18px 42px -17px rgba(0, 0, 0, 0.74); +} + +.quickDetailsHeader { + padding: 7px 20px 7px 20px; +} + +.eventDetails { + padding: 20px; + text-align: justify; + height: 200px; + max-height: 200px; +} + +.eventTags { + padding: 10px; + + .button { + margin-right: 5px; + padding: 10px; + opacity: 0.9; + } + + .tags { + padding: 5px; + border-radius: 20px; + margin: 0px; + } +} + +.eventBackColorFPV { + background: #55c8d9; +} +.eventBackColorFF { + background: #ffc161; +} +.eventBackColorFSS { + background: #26cb86; +} + +.eventDetailsHeaderColorFPV { + background: #d5f8fe; +} +.eventDetailsHeaderColorFF { + background: #f8e3c4; +} +.eventDetailsHeaderColorFSS { + background: #aadcc7; +} + +.panel { + transition: all 0.14s ease-in-out; +} +.panel:hover { + transform: scale(1.05); + cursor: pointer; +} + +/* Media queries */ +@media only screen and (max-width: 1072px) { + .card-container { + max-width: fit-content; + width: auto; + } +} + diff --git a/frontend/src/components/event/EventDetailsComponent.vue b/frontend/src/components/event/EventDetailsComponent.vue index 3ef8727..9a7a277 100644 --- a/frontend/src/components/event/EventDetailsComponent.vue +++ b/frontend/src/components/event/EventDetailsComponent.vue @@ -1,497 +1,546 @@ -/* -* -* Created by: Martin Gajdos -* Date: 26. 10. 2020 -* -* Description: This component takes in data from EventListComponent and renders them in a -* detailed format. -* -*/ +/* * * Created by: Martin Gajdos * Date: 26. 10. 2020 * * Description: This +component takes in data from EventListComponent and renders them in a * detailed +format. * */ \ No newline at end of file + .forLabel { + font-weight: bold; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + } + + .by { + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + } + } + } +} + +.row { + display: flex; + flex-wrap: wrap; + padding: 0 4px; +} + +.imageLink { + cursor: pointer; +} + +.section4-separator-line { + margin-top: 5px; + margin-bottom: 5px; + background: #d1d1d1; + height: 1px; + width: auto; +} + +.separator-line { + margin-top: 10px; + margin-bottom: 10px; + background: #d1d1d1; + height: 1px; + width: 100%; +} + +.separator-line-section-4 { + margin-top: 15px; + margin-bottom: 15px; + background: #d1d1d1; + height: 1px; + width: 100%; +} + +/* Scrollbar style */ +/* Width */ +::-webkit-scrollbar { + width: 10px; +} +/* Track */ +::-webkit-scrollbar-track { + background: #f1f1f1; + border-radius: 10px; +} +/* Handle */ +::-webkit-scrollbar-thumb { + background: #888; + border-radius: 10px; +} +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { + background: #555; +} + diff --git a/frontend/src/components/event/EventListComponent.vue b/frontend/src/components/event/EventListComponent.vue index 7b95084..2e40d88 100644 --- a/frontend/src/components/event/EventListComponent.vue +++ b/frontend/src/components/event/EventListComponent.vue @@ -1,128 +1,152 @@ -/* -* -* Created by: Martin Gajdos -* Date: 26. 10. 2020 -* -* Description: This component contains data about every event & renders event cards -* and event details accordingly. -* -*/ +/* * * Created by: Martin Gajdos * Date: 26. 10. 2020 * * Description: This +component contains data about every event & renders event cards * and event +details accordingly. * */ \ No newline at end of file + .panel .panel-heading { + color: white; + } +} + diff --git a/frontend/src/components/map/HereMap.vue b/frontend/src/components/map/HereMap.vue index 0d25b25..f195ea5 100644 --- a/frontend/src/components/map/HereMap.vue +++ b/frontend/src/components/map/HereMap.vue @@ -1,75 +1,69 @@ -/* -* -* Created by: Martin Gajdos -* Date: 26. 10. 2020 -* -* Description: -* -*/ +/* * * Created by: Martin Gajdos * Date: 26. 10. 2020 * * Description: * */ \ No newline at end of file +#map { + width: 60vw; + min-width: 360px; + text-align: center; + margin: 5% auto; + background-color: #ccc; +} + diff --git a/frontend/src/httpClient.js b/frontend/src/httpClient.js new file mode 100644 index 0000000..8426ca7 --- /dev/null +++ b/frontend/src/httpClient.js @@ -0,0 +1,10 @@ +import axios from "axios"; + +const httpClient = axios.create({ + baseURL: process.env.VUE_APP_BACKEND_URL, + headers: { + "Content-Type": "application/json", + } +}); + +export default httpClient; diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 494becc..2d675e4 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -2,5 +2,6 @@ "language": "EN", "ukf": "My UKF", "login": "Log in", - "ukfNitra": "UKF in Nitra" + "ukfNitra": "UKF in Nitra", + "addEvent": "Add event" } diff --git a/frontend/src/locales/sk.json b/frontend/src/locales/sk.json index 5b1ea6e..2a79249 100644 --- a/frontend/src/locales/sk.json +++ b/frontend/src/locales/sk.json @@ -2,5 +2,6 @@ "language": "SK", "ukf": "Moja UKF", "login": "Prihlásiť sa", - "ukfNitra": "UKF v Nitre" + "ukfNitra": "UKF v Nitre", + "addEvent": "Pridať event" } diff --git a/frontend/src/router.js b/frontend/src/router.js index 6089a00..23f05a0 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -1,6 +1,7 @@ import Vue from "vue"; import Router from "vue-router"; import Home from "./views/Home.vue"; +import ManageEvent from "./views/ManageEvent.vue"; Vue.use(Router); @@ -12,6 +13,11 @@ export default new Router({ path: "/", name: "home", component: Home + }, + { + path: "/pridat", + name: "addEvent", + component: ManageEvent } ] }); diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index 3567c9e..884b8b7 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -1,16 +1,18 @@ diff --git a/frontend/src/views/ManageEvent.vue b/frontend/src/views/ManageEvent.vue new file mode 100644 index 0000000..105237f --- /dev/null +++ b/frontend/src/views/ManageEvent.vue @@ -0,0 +1,405 @@ + + + + +