Initial commit: Laravel 8 skeleton
commit a0982184d39ceca779175a97f5d0ca331fe14bb1
8 changed files with 124 additions and 0 deletions
.env.example ADDED
| @@ -0,0 +1,17 @@ | ||
| 1 | +APP_NAME=glibcode | |
| 2 | +APP_ENV=local | |
| 3 | +APP_KEY= | |
| 4 | +APP_DEBUG=true | |
| 5 | +APP_URL=http://localhost | |
| 6 | + | |
| 7 | +DB_CONNECTION=mysql | |
| 8 | +DB_HOST=127.0.0.1 | |
| 9 | +DB_PORT=3306 | |
| 10 | +DB_DATABASE=glibcode | |
| 11 | +DB_USERNAME=root | |
| 12 | +DB_PASSWORD= | |
| 13 | + | |
| 14 | +MAIL_MAILER=log | |
| 15 | +RUNNER_URL=http://127.0.0.1:8088 | |
| 16 | +STRIPE_KEY= | |
| 17 | +STRIPE_SECRET= | |
.gitignore ADDED
| @@ -0,0 +1,9 @@ | ||
| 1 | +/node_modules | |
| 2 | +/public/hot | |
| 3 | +/public/storage | |
| 4 | +/storage/*.key | |
| 5 | +/vendor | |
| 6 | +.env | |
| 7 | +.env.backup | |
| 8 | +.phpunit.result.cache | |
| 9 | +npm-debug.log | |
README.md ADDED
| @@ -0,0 +1,19 @@ | ||
| 1 | +# glibcode.net | |
| 2 | + | |
| 3 | +The school website: course pages, lessons, accounts, checkout and the playground frontend. Laravel 8, PHP 7.4, MySQL. | |
| 4 | + | |
| 5 | +## Local setup | |
| 6 | + | |
| 7 | +```sh | |
| 8 | +composer install | |
| 9 | +cp .env.example .env | |
| 10 | +php artisan key:generate | |
| 11 | +php artisan migrate --seed | |
| 12 | +php artisan serve | |
| 13 | +``` | |
| 14 | + | |
| 15 | +The playground needs the runner from [glibcode/playground](https://git.glibcode.net/glibcode/playground). | |
| 16 | + | |
| 17 | +## Deploy | |
| 18 | + | |
| 19 | +Pushes to `main` deploy through the workflow in `.gitea/workflows/deploy.yml` (scripts in glibcode-ops/deploy). | |
artisan ADDED
| @@ -0,0 +1,13 @@ | ||
| 1 | +#!/usr/bin/env php | |
| 2 | +<?php | |
| 3 | + | |
| 4 | +define('LARAVEL_START', microtime(true)); | |
| 5 | + | |
| 6 | +require __DIR__.'/vendor/autoload.php'; | |
| 7 | + | |
| 8 | +$app = require_once __DIR__.'/bootstrap/app.php'; | |
| 9 | +$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); | |
| 10 | + | |
| 11 | +$status = $kernel->handle($input = new Symfony\Component\Console\Input\ArgvInput, new Symfony\Component\Console\Output\ConsoleOutput); | |
| 12 | +$kernel->terminate($input, $status); | |
| 13 | +exit($status); | |
composer.json ADDED
| @@ -0,0 +1,21 @@ | ||
| 1 | +{ | |
| 2 | + "name": "glibcode/website", | |
| 3 | + "type": "project", | |
| 4 | + "description": "glibcode.net", | |
| 5 | + "require": { | |
| 6 | + "php": "^7.4", | |
| 7 | + "guzzlehttp/guzzle": "^7.0.1", | |
| 8 | + "laravel/framework": "^8.75", | |
| 9 | + "laravel/sanctum": "^2.11", | |
| 10 | + "stripe/stripe-php": "^10.0", | |
| 11 | + "league/commonmark": "^2.4" | |
| 12 | + }, | |
| 13 | + "require-dev": { | |
| 14 | + "fakerphp/faker": "^1.9.1", | |
| 15 | + "phpunit/phpunit": "^9.5.10" | |
| 16 | + }, | |
| 17 | + "autoload": { | |
| 18 | + "psr-4": {"App\\": "app/"} | |
| 19 | + }, | |
| 20 | + "config": {"optimize-autoloader": true, "sort-packages": true} | |
| 21 | +} | |
config/database.php ADDED
| @@ -0,0 +1,18 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +return [ | |
| 4 | + 'default' => env('DB_CONNECTION', 'mysql'), | |
| 5 | + 'connections' => [ | |
| 6 | + 'mysql' => [ | |
| 7 | + 'driver' => 'mysql', | |
| 8 | + 'host' => env('DB_HOST', '127.0.0.1'), | |
| 9 | + 'port' => env('DB_PORT', '3306'), | |
| 10 | + 'database' => env('DB_DATABASE', 'glibcode'), | |
| 11 | + 'username' => env('DB_USERNAME', 'root'), | |
| 12 | + 'password' => env('DB_PASSWORD', ''), | |
| 13 | + 'charset' => 'utf8mb4', | |
| 14 | + 'collation' => 'utf8mb4_unicode_ci', | |
| 15 | + ], | |
| 16 | + ], | |
| 17 | + 'migrations' => 'migrations', | |
| 18 | +]; | |
phpunit.xml ADDED
| @@ -0,0 +1,13 @@ | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<phpunit bootstrap="vendor/autoload.php" colors="true"> | |
| 3 | + <testsuites> | |
| 4 | + <testsuite name="Feature"> | |
| 5 | + <directory>tests/Feature</directory> | |
| 6 | + </testsuite> | |
| 7 | + </testsuites> | |
| 8 | + <php> | |
| 9 | + <env name="APP_ENV" value="testing"/> | |
| 10 | + <env name="DB_CONNECTION" value="sqlite"/> | |
| 11 | + <env name="DB_DATABASE" value=":memory:"/> | |
| 12 | + </php> | |
| 13 | +</phpunit> | |
public/index.php ADDED
| @@ -0,0 +1,14 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +use Illuminate\Contracts\Http\Kernel; | |
| 4 | +use Illuminate\Http\Request; | |
| 5 | + | |
| 6 | +define('LARAVEL_START', microtime(true)); | |
| 7 | + | |
| 8 | +require __DIR__.'/../vendor/autoload.php'; | |
| 9 | + | |
| 10 | +$app = require_once __DIR__.'/../bootstrap/app.php'; | |
| 11 | +$kernel = $app->make(Kernel::class); | |
| 12 | + | |
| 13 | +$response = $kernel->handle($request = Request::capture())->send(); | |
| 14 | +$kernel->terminate($request, $response); | |