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
54 changes: 54 additions & 0 deletions .env.testing.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
APP_NAME=Laravel
APP_ENV=testing
APP_KEY=base64:0seVKONUETkjLw9vg/z3jnfW/4pxqxsf35A81sNEPwE=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=mysql_testing
DB_PORT=3306
DB_DATABASE=retro_board
DB_USERNAME=root
DB_PASSWORD=

SESSION_DRIVER=array
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync

CACHE_STORE=database
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

MAIL_MAILER=log
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"
147 changes: 147 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: CI

on:
pull_request:
branches:
- develop
- master
types:
- opened
- reopened
- synchronize
- edited

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
checks:
name: Validate Formatting and Tests
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ''
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: laravel
MYSQL_USER: sail
MYSQL_PASSWORD: password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Checkout
uses: actions/checkout@v4

- name: Install Node dependencies
run: npm ci

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
tools: composer:v2
extensions: mbstring, intl, pdo_mysql, bcmath, fileinfo

- name: Install Composer dependencies (cached)
uses: ramsey/composer-install@v3
with:
composer-options: --no-ansi --no-interaction --no-progress --prefer-dist

- name: Prepare environment
run: |
cp .env.example .env
php artisan key:generate --ansi

- name: Build JS
run: npm run build

- name: Configure DB for tests
run: |
php -r 'file_put_contents(".env", preg_replace([
"/^DB_CONNECTION=.*/m",
"/^DB_HOST=.*/m",
"/^DB_PORT=.*/m",
"/^DB_DATABASE=.*/m",
"/^DB_USERNAME=.*/m",
"/^DB_PASSWORD=.*/m",
], [
"DB_CONNECTION=mysql",
"DB_HOST=127.0.0.1",
"DB_PORT=3306",
"DB_DATABASE=laravel",
"DB_USERNAME=root",
"DB_PASSWORD=",
], file_get_contents(".env")));'

- name: Wait for MySQL
run: |
for i in {1..20}; do
if mysqladmin ping -h 127.0.0.1 -u root --silent; then
echo "MySQL is ready"; break
fi
echo "Waiting for MySQL... ($i)"; sleep 3
done

- name: Run migrations
run: php artisan migrate --no-interaction -vvv

- name: PHP formatting (Pint --test)
run: |
if [ -x "vendor/bin/pint" ]; then
vendor/bin/pint --test
else
echo "Laravel Pint not found in vendor/bin. Please require laravel/pint as a dev dependency."; exit 1
fi

- name: Run PHPUnit
env:
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: laravel
DB_USERNAME: root
DB_PASSWORD: ''
QUEUE_CONNECTION: redis
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
run: php artisan test

- name: Prettier (check)
run: npx prettier --check "resources/js/**/*"

- name: Run JS tests (Vitest)
run: npx vitest run --coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ yarn-error.log
/.idea
/.vscode
tink.php
/resources/js/coverage
103 changes: 37 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,37 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>

<p align="center">
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>

## About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

Laravel is accessible, powerful, and provides tools required for large, robust applications.

## Learning Laravel

Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

## Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).

### Premium Partners

- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[WebReinvent](https://webreinvent.com/)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
- **[Jump24](https://jump24.co.uk)**
- **[Redberry](https://redberry.international/laravel/)**
- **[Active Logic](https://activelogic.com)**
- **[byte5](https://byte5.de)**
- **[OP.GG](https://op.gg)**

## Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).

## Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [[email protected]](mailto:[email protected]). All security vulnerabilities will be promptly addressed.

## License

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
# Retro Board

Team retrospective board built with Laravel 11, Jetstream, Inertia + Vue 3, Tailwind, MySQL, Redis, and Laravel Reverb for real-time updates. Everything can run in Docker; the only host tool you need beyond Docker is Node via `nvm`.

## Prerequisites
- Docker + Docker Compose
- `nvm` (uses the Node version pinned in `.nvmrc`, currently 20.11.0)

## Initial setup
1. Clone the repo and enter it.
2. Copy env vars and set local defaults for Sail:
```
cp .env.example .env
```
3. Install PHP dependencies using Sail’s Composer image (no local PHP required):
```
docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/var/www/html" -w /var/www/html laravelsail/php83-composer:latest composer install --ignore-platform-reqs
```
4. Start the stack: `./vendor/bin/sail up -d`
5. Generate keys/links: `./vendor/bin/sail artisan key:generate && ./vendor/bin/sail artisan storage:link`
6. Prepare the database: `./vendor/bin/sail artisan migrate --seed`
- Seeded users: `[email protected]` and `[email protected]` (password: `password`)
7. Run background workers needed for real-time updates:
- Queue worker or Horizon: `./vendor/bin/sail artisan horizon` (or `queue:work`)
- Reverb websocket server: `./vendor/bin/sail artisan reverb:start`
8. Set up Node and the Vite dev server on the host:
```
nvm install
npm install
npm run dev
```
- Vite runs on port 5173 by default (published in `docker-compose.yml`); visit http://localhost.

## Useful commands
- Stop the stack: `./vendor/bin/sail down`
- Backend tests: `./vendor/bin/sail artisan test`
- Frontend tests: `npm test`
3 changes: 3 additions & 0 deletions app/Http/Controllers/BoardColumnCardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use App\Models\Card;
use App\Models\Column;
use Illuminate\Support\Facades\Gate;
use Symfony\Component\HttpFoundation\Response;

class BoardColumnCardController extends Controller
{
Expand Down Expand Up @@ -49,5 +50,7 @@ public function destroy(Board $board, Column $column, Card $card)
$card->delete();

CardDeleted::dispatch($column->board);

return response(null, Response::HTTP_NO_CONTENT);
}
}
5 changes: 5 additions & 0 deletions app/Http/Controllers/BoardColumnController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Models\Board;
use App\Models\Column;
use Illuminate\Support\Facades\Gate;
use Symfony\Component\HttpFoundation\Response;

class BoardColumnController extends Controller
{
Expand All @@ -21,6 +22,8 @@ public function store(StoreColumnRequest $request, Board $board)
]);

ColumnCreated::dispatch($board);

return response(null, Response::HTTP_NO_CONTENT);
}

public function update(UpdateColumnRequest $request, Board $board, Column $column)
Expand All @@ -30,5 +33,7 @@ public function update(UpdateColumnRequest $request, Board $board, Column $colum
$column->update([
'title' => $request->title,
]);

return response(null, Response::HTTP_NO_CONTENT);
}
}
16 changes: 0 additions & 16 deletions app/Http/Controllers/BoardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use App\Models\Board;
use Illuminate\Support\Facades\Gate;
use Inertia\Inertia;
use Nette\NotImplementedException;

class BoardController extends Controller
{
Expand All @@ -20,11 +19,6 @@ public function index()
]);
}

public function create()
{
throw new NotImplementedException;
}

public function store(StoreBoardRequest $request)
{
Board::create([
Expand All @@ -47,11 +41,6 @@ public function show(Board $board)
]);
}

public function edit(string $id)
{
throw new NotImplementedException;
}

public function update(UpdateBoardRequest $request, Board $board)
{
Gate::authorize('update', $board);
Expand All @@ -60,9 +49,4 @@ public function update(UpdateBoardRequest $request, Board $board)

BoardUpdated::dispatch($board);
}

public function destroy(string $id)
{
throw new NotImplementedException;
}
}
Loading
Loading