Compare commits
8 Commits
feature/bu
...
feature/bu
| Author | SHA1 | Date | |
|---|---|---|---|
| 399e7be3a9 | |||
| 0adaadd9ed | |||
| 2405160046 | |||
| 27f3cee855 | |||
| 7a858b52af | |||
| 7a70b44931 | |||
| 18f9ec85e7 | |||
| 02f2fc506d |
@@ -9,6 +9,11 @@ APP_FALLBACK_LOCALE=pt_BR
|
|||||||
APP_FAKER_LOCALE=pt_BR
|
APP_FAKER_LOCALE=pt_BR
|
||||||
APP_TIMEZONE=America/Fortaleza
|
APP_TIMEZONE=America/Fortaleza
|
||||||
|
|
||||||
|
# Freeze application clock outside production (visual regression / deterministic seeds).
|
||||||
|
# Example: APP_FROZEN_NOW=2026-03-15T12:00:00-03:00
|
||||||
|
# Ignored when APP_ENV=production.
|
||||||
|
# APP_FROZEN_NOW=
|
||||||
|
|
||||||
APP_MAINTENANCE_DRIVER=file
|
APP_MAINTENANCE_DRIVER=file
|
||||||
# APP_MAINTENANCE_STORE=database
|
# APP_MAINTENANCE_STORE=database
|
||||||
|
|
||||||
|
|||||||
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- uses: shivammathur/setup-php@v2
|
- uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: "8.4"
|
php-version: "8.4"
|
||||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, sodium
|
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, sodium, gd
|
||||||
coverage: none
|
coverage: none
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
- uses: shivammathur/setup-php@v2
|
- uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: "8.4"
|
php-version: "8.4"
|
||||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, sodium
|
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, sodium, gd
|
||||||
coverage: none
|
coverage: none
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
@@ -97,7 +97,7 @@ jobs:
|
|||||||
- uses: shivammathur/setup-php@v2
|
- uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: "8.4"
|
php-version: "8.4"
|
||||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, sodium
|
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, sodium, gd
|
||||||
coverage: none
|
coverage: none
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
@@ -141,7 +141,7 @@ jobs:
|
|||||||
- uses: shivammathur/setup-php@v2
|
- uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: "8.4"
|
php-version: "8.4"
|
||||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, sodium
|
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, sodium, gd
|
||||||
coverage: none
|
coverage: none
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
@@ -161,11 +161,15 @@ jobs:
|
|||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npx playwright install chromium --with-deps
|
- run: npx playwright install chromium --with-deps
|
||||||
- run: php artisan migrate --force
|
- run: php artisan migrate --force
|
||||||
|
- run: php artisan db:seed --class=VisualContentSeeder --force
|
||||||
|
- run: php artisan storage:link
|
||||||
|
|
||||||
- name: Build application image
|
- name: Build application image
|
||||||
run: docker build -t amare-app:ci .
|
run: docker build -t amare-app:ci .
|
||||||
|
|
||||||
- name: Run browser tests against FrankenPHP container
|
- name: Run browser tests against FrankenPHP container
|
||||||
|
env:
|
||||||
|
APP_FROZEN_NOW: "2026-03-15T12:00:00-03:00"
|
||||||
run: |
|
run: |
|
||||||
docker run -d --name amare-web \
|
docker run -d --name amare-web \
|
||||||
-e APP_ENV=testing \
|
-e APP_ENV=testing \
|
||||||
@@ -174,6 +178,7 @@ jobs:
|
|||||||
-e APP_LOCALE=pt_BR \
|
-e APP_LOCALE=pt_BR \
|
||||||
-e APP_FALLBACK_LOCALE=pt_BR \
|
-e APP_FALLBACK_LOCALE=pt_BR \
|
||||||
-e APP_TIMEZONE=America/Fortaleza \
|
-e APP_TIMEZONE=America/Fortaleza \
|
||||||
|
-e APP_FROZEN_NOW="${APP_FROZEN_NOW}" \
|
||||||
-e DB_CONNECTION=pgsql \
|
-e DB_CONNECTION=pgsql \
|
||||||
-e DB_HOST=host.docker.internal \
|
-e DB_HOST=host.docker.internal \
|
||||||
-e DB_PORT=5432 \
|
-e DB_PORT=5432 \
|
||||||
@@ -184,6 +189,7 @@ jobs:
|
|||||||
-e CACHE_STORE=database \
|
-e CACHE_STORE=database \
|
||||||
-e QUEUE_CONNECTION=database \
|
-e QUEUE_CONNECTION=database \
|
||||||
--add-host=host.docker.internal:host-gateway \
|
--add-host=host.docker.internal:host-gateway \
|
||||||
|
-v "${GITHUB_WORKSPACE}/storage/app/public:/app/storage/app/public" \
|
||||||
-p 8000:8000 \
|
-p 8000:8000 \
|
||||||
amare-app:ci
|
amare-app:ci
|
||||||
|
|
||||||
@@ -197,6 +203,23 @@ jobs:
|
|||||||
curl -fsS http://127.0.0.1:8000/up
|
curl -fsS http://127.0.0.1:8000/up
|
||||||
./vendor/bin/pest --testsuite=Browser
|
./vendor/bin/pest --testsuite=Browser
|
||||||
|
|
||||||
|
- name: Collect failure diagnostics
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
mkdir -p artifacts/browser
|
||||||
|
docker logs amare-web > artifacts/browser/container.log 2>&1 || true
|
||||||
|
cp -R storage/logs artifacts/browser/app-logs 2>/dev/null || true
|
||||||
|
cp -R tests/Browser/Screenshots artifacts/browser/screenshots 2>/dev/null || true
|
||||||
|
cp -R tests/.pest artifacts/browser/pest 2>/dev/null || true
|
||||||
|
|
||||||
|
- name: Upload browser failure artifacts
|
||||||
|
if: failure()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: browser-failure-artifacts
|
||||||
|
path: artifacts/browser
|
||||||
|
if-no-files-found: ignore
|
||||||
|
|
||||||
container:
|
container:
|
||||||
name: container
|
name: container
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -206,7 +229,7 @@ jobs:
|
|||||||
- name: Build production image
|
- name: Build production image
|
||||||
run: docker build -t amare-app:ci .
|
run: docker build -t amare-app:ci .
|
||||||
|
|
||||||
- name: Verify container healthcheck
|
- name: Verify container healthcheck and storage link
|
||||||
run: |
|
run: |
|
||||||
docker run -d --name amare-health \
|
docker run -d --name amare-health \
|
||||||
-e APP_ENV=production \
|
-e APP_ENV=production \
|
||||||
@@ -224,6 +247,7 @@ jobs:
|
|||||||
|
|
||||||
for i in $(seq 1 30); do
|
for i in $(seq 1 30); do
|
||||||
if curl -fsS http://127.0.0.1:8000/up; then
|
if curl -fsS http://127.0.0.1:8000/up; then
|
||||||
|
docker exec amare-health test -L /app/public/storage
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -25,3 +25,4 @@ _ide_helper.php
|
|||||||
Homestead.json
|
Homestead.json
|
||||||
Homestead.yaml
|
Homestead.yaml
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
.worktrees/
|
||||||
|
|||||||
32
AGENTS.md
Normal file
32
AGENTS.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Repository Guidelines
|
||||||
|
|
||||||
|
## Project Structure & Module Organization
|
||||||
|
|
||||||
|
This is a Laravel 13 application for an event-planning consultancy. Application code lives in `app/`: domain rules belong in `app/Domain`, HTTP entry points in `app/Http`, and the internal Filament 5 panel in `app/Filament`. Blade views, JavaScript, and Tailwind CSS are under `resources/`; Vite publishes browser assets to `public/`. Database migrations, factories, and seeders live in `database/`. Tests are grouped into `tests/Unit`, `tests/Architecture`, `tests/Feature`, and `tests/Browser`. Treat `SPEC.md` as the product source of truth and use `openspec/` for planned changes.
|
||||||
|
|
||||||
|
## Build, Test, and Development Commands
|
||||||
|
|
||||||
|
- `composer setup` installs PHP and npm dependencies, creates `.env`, migrates, and builds assets.
|
||||||
|
- `docker compose up -d` starts the local PostgreSQL service.
|
||||||
|
- `composer dev` runs Laravel, the queue listener, logs, and Vite together.
|
||||||
|
- `npm run build` creates the production frontend bundle.
|
||||||
|
- `composer quality` runs formatting checks, PHPStan level 5, dependency audit, and every test suite.
|
||||||
|
- `composer test:unit`, `composer test:feature`, or `composer test:browser` run focused suites.
|
||||||
|
|
||||||
|
Feature and browser tests require the `amare_test` PostgreSQL database configured in `phpunit.xml`.
|
||||||
|
|
||||||
|
## Coding Style & Naming Conventions
|
||||||
|
|
||||||
|
Follow PSR-4 and Laravel conventions: PascalCase classes, camelCase methods, and snake_case database columns. Use four spaces (two in YAML, except four in Compose files), LF endings, and UTF-8 as defined by `.editorconfig`. Every project-owned PHP file must place `declare(strict_types=1);` immediately after `<?php`. Keep domain code independent of Filament and Livewire. Run `composer pint` to format and `composer phpstan` before review.
|
||||||
|
|
||||||
|
## Testing Guidelines
|
||||||
|
|
||||||
|
Tests use Pest 4; browser coverage uses Pest Browser/Playwright. Name files by behavior, ending in `Test.php`, and add tests in the suite matching the changed layer. Feature tests use `RefreshDatabase`. Add architecture coverage for dependency-boundary changes. No numeric coverage threshold is enforced, but changed behavior must have regression coverage.
|
||||||
|
|
||||||
|
## Commit & Pull Request Guidelines
|
||||||
|
|
||||||
|
History follows Conventional Commit-style subjects, for example `feat: Fase 0 — Fundação`. Use `<type>: <imperative summary>` (`feat`, `fix`, `docs`, `test`, `chore`) and keep commits focused. Pull requests should explain scope, link the relevant issue or OpenSpec requirement, list verification commands, and include screenshots for UI changes. Ensure all CI jobs pass.
|
||||||
|
|
||||||
|
## Security & Configuration
|
||||||
|
|
||||||
|
Copy `.env.example`; never commit secrets or production credentials. Development seed credentials are local-only. Validate uploads and authorization through Laravel policies, and run `composer security-audit` after dependency changes.
|
||||||
@@ -35,7 +35,8 @@ RUN install-php-extensions \
|
|||||||
opcache \
|
opcache \
|
||||||
pcntl \
|
pcntl \
|
||||||
bcmath \
|
bcmath \
|
||||||
sodium
|
sodium \
|
||||||
|
gd
|
||||||
|
|
||||||
RUN useradd --create-home --shell /usr/sbin/nologin --uid 1000 appuser
|
RUN useradd --create-home --shell /usr/sbin/nologin --uid 1000 appuser
|
||||||
|
|
||||||
|
|||||||
28
SPEC.md
28
SPEC.md
@@ -2330,21 +2330,21 @@ O agente deve implementar na sequência, salvo instrução explícita.
|
|||||||
|
|
||||||
### Fase 1 — Site e CMS
|
### Fase 1 — Site e CMS
|
||||||
|
|
||||||
- [ ] `site_settings`;
|
- [x] `site_settings`;
|
||||||
- [ ] serviços;
|
- [x] serviços;
|
||||||
- [ ] portfólio e galeria;
|
- [x] portfólio e galeria;
|
||||||
- [ ] depoimentos;
|
- [x] depoimentos;
|
||||||
- [ ] home;
|
- [x] home;
|
||||||
- [ ] listagem e detalhe de serviços;
|
- [x] listagem e detalhe de serviços;
|
||||||
- [ ] listagem e detalhe de portfólio;
|
- [x] listagem e detalhe de portfólio;
|
||||||
- [ ] sobre;
|
- [x] sobre;
|
||||||
- [ ] privacidade;
|
- [x] privacidade;
|
||||||
- [ ] SEO;
|
- [x] SEO;
|
||||||
- [ ] mídia otimizada;
|
- [x] mídia otimizada;
|
||||||
- [ ] snapshots desktop/mobile;
|
- [x] snapshots desktop/mobile;
|
||||||
- [ ] testes de acessibilidade.
|
- [x] testes de acessibilidade.
|
||||||
|
|
||||||
**Critério de saída:** conteúdo gerenciável no Filament e site público aprovado visualmente.
|
**Critério de saída:** conteúdo gerenciável no Filament e site público aprovado visualmente (baselines em `tests/.pest/snapshots/`; aprovação humana do diff visual no PR).
|
||||||
|
|
||||||
### Fase 2 — Leads
|
### Fase 2 — Leads
|
||||||
|
|
||||||
|
|||||||
26
app/Application/Data/HomeContent.php
Normal file
26
app/Application/Data/HomeContent.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Application\Data;
|
||||||
|
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
use App\Models\Service;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use App\Models\Testimonial;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
|
||||||
|
final readonly class HomeContent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param Collection<int, Service> $featuredServices
|
||||||
|
* @param Collection<int, PortfolioCase> $featuredCases
|
||||||
|
* @param Collection<int, Testimonial> $testimonials
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
public SiteSetting $settings,
|
||||||
|
public Collection $featuredServices,
|
||||||
|
public Collection $featuredCases,
|
||||||
|
public Collection $testimonials,
|
||||||
|
) {}
|
||||||
|
}
|
||||||
103
app/Application/Data/PageMeta.php
Normal file
103
app/Application/Data/PageMeta.php
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Application\Data;
|
||||||
|
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
final readonly class PageMeta
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param array<string, mixed>|null $jsonLd
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
public string $title,
|
||||||
|
public string $description,
|
||||||
|
public string $canonical,
|
||||||
|
public string $ogType = 'website',
|
||||||
|
public ?string $ogImageUrl = null,
|
||||||
|
public ?string $ogImageAlt = null,
|
||||||
|
public ?array $jsonLd = null,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array<string, mixed>|null $jsonLd
|
||||||
|
*/
|
||||||
|
public static function forPage(
|
||||||
|
string $canonical,
|
||||||
|
SiteSetting $settings,
|
||||||
|
?string $title = null,
|
||||||
|
?string $description = null,
|
||||||
|
?string $ogImageUrl = null,
|
||||||
|
?string $ogImageAlt = null,
|
||||||
|
string $ogType = 'website',
|
||||||
|
?array $jsonLd = null,
|
||||||
|
): self {
|
||||||
|
return new self(
|
||||||
|
title: filled($title) ? (string) $title : self::defaultTitle($settings),
|
||||||
|
description: filled($description) ? (string) $description : self::defaultDescription($settings),
|
||||||
|
canonical: $canonical,
|
||||||
|
ogType: $ogType,
|
||||||
|
ogImageUrl: $ogImageUrl ?? self::defaultOgImageUrl($settings),
|
||||||
|
ogImageAlt: $ogImageAlt ?? $settings->default_og_image_alt,
|
||||||
|
jsonLd: $jsonLd,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array<string, mixed>|null $jsonLd
|
||||||
|
*/
|
||||||
|
public static function forCase(
|
||||||
|
PortfolioCase $case,
|
||||||
|
string $canonical,
|
||||||
|
SiteSetting $settings,
|
||||||
|
?array $jsonLd = null,
|
||||||
|
): self {
|
||||||
|
$title = filled($case->meta_title) ? (string) $case->meta_title : (string) $case->title;
|
||||||
|
$description = filled($case->meta_description)
|
||||||
|
? (string) $case->meta_description
|
||||||
|
: (filled($case->summary) ? (string) $case->summary : self::defaultDescription($settings));
|
||||||
|
|
||||||
|
$ogImageUrl = filled($case->cover_image_path)
|
||||||
|
? url(Storage::disk('public')->url((string) $case->cover_image_path))
|
||||||
|
: self::defaultOgImageUrl($settings);
|
||||||
|
|
||||||
|
$ogImageAlt = filled($case->cover_image_alt)
|
||||||
|
? (string) $case->cover_image_alt
|
||||||
|
: $settings->default_og_image_alt;
|
||||||
|
|
||||||
|
return new self(
|
||||||
|
title: $title,
|
||||||
|
description: $description,
|
||||||
|
canonical: $canonical,
|
||||||
|
ogType: 'article',
|
||||||
|
ogImageUrl: $ogImageUrl,
|
||||||
|
ogImageAlt: $ogImageAlt,
|
||||||
|
jsonLd: $jsonLd,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function defaultTitle(SiteSetting $settings): string
|
||||||
|
{
|
||||||
|
return filled($settings->default_meta_title)
|
||||||
|
? (string) $settings->default_meta_title
|
||||||
|
: (string) $settings->brand_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function defaultDescription(SiteSetting $settings): string
|
||||||
|
{
|
||||||
|
return (string) ($settings->default_meta_description ?? '');
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function defaultOgImageUrl(SiteSetting $settings): ?string
|
||||||
|
{
|
||||||
|
if (! filled($settings->default_og_image_path)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return url(Storage::disk('public')->url((string) $settings->default_og_image_path));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Application\Queries\Marketing;
|
||||||
|
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
|
||||||
|
final class FindPublishedPortfolioCaseBySlug
|
||||||
|
{
|
||||||
|
public function __invoke(string $slug): ?PortfolioCase
|
||||||
|
{
|
||||||
|
return PortfolioCase::query()
|
||||||
|
->published()
|
||||||
|
->with(['images'])
|
||||||
|
->where('slug', $slug)
|
||||||
|
->first();
|
||||||
|
}
|
||||||
|
}
|
||||||
36
app/Application/Queries/Marketing/GetHomeContent.php
Normal file
36
app/Application/Queries/Marketing/GetHomeContent.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Application\Queries\Marketing;
|
||||||
|
|
||||||
|
use App\Application\Data\HomeContent;
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
use App\Models\Service;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use App\Models\Testimonial;
|
||||||
|
|
||||||
|
final class GetHomeContent
|
||||||
|
{
|
||||||
|
public function __invoke(): HomeContent
|
||||||
|
{
|
||||||
|
return new HomeContent(
|
||||||
|
settings: SiteSetting::instance(),
|
||||||
|
featuredServices: Service::query()
|
||||||
|
->published()
|
||||||
|
->where('is_featured', true)
|
||||||
|
->orderBy('sort_order')
|
||||||
|
->get(),
|
||||||
|
featuredCases: PortfolioCase::query()
|
||||||
|
->published()
|
||||||
|
->where('is_featured', true)
|
||||||
|
->with(['images'])
|
||||||
|
->orderBy('sort_order')
|
||||||
|
->get(),
|
||||||
|
testimonials: Testimonial::query()
|
||||||
|
->published()
|
||||||
|
->orderBy('sort_order')
|
||||||
|
->get(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Application\Queries\Marketing;
|
||||||
|
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
|
||||||
|
final class GetPublishedPortfolioCases
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return Collection<int, PortfolioCase>
|
||||||
|
*/
|
||||||
|
public function __invoke(): Collection
|
||||||
|
{
|
||||||
|
return PortfolioCase::query()
|
||||||
|
->published()
|
||||||
|
->with(['images'])
|
||||||
|
->orderBy('sort_order')
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
}
|
||||||
22
app/Application/Queries/Marketing/GetPublishedServices.php
Normal file
22
app/Application/Queries/Marketing/GetPublishedServices.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Application\Queries\Marketing;
|
||||||
|
|
||||||
|
use App\Models\Service;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
|
||||||
|
final class GetPublishedServices
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return Collection<int, Service>
|
||||||
|
*/
|
||||||
|
public function __invoke(): Collection
|
||||||
|
{
|
||||||
|
return Service::query()
|
||||||
|
->published()
|
||||||
|
->orderBy('sort_order')
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
}
|
||||||
43
app/Application/Queries/Marketing/GetSitemapEntries.php
Normal file
43
app/Application/Queries/Marketing/GetSitemapEntries.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Application\Queries\Marketing;
|
||||||
|
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
|
final class GetSitemapEntries
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return list<array{loc: string, lastmod: string|null}>
|
||||||
|
*/
|
||||||
|
public function __invoke(): array
|
||||||
|
{
|
||||||
|
$entries = [
|
||||||
|
['loc' => route('home'), 'lastmod' => null],
|
||||||
|
['loc' => route('services.index'), 'lastmod' => null],
|
||||||
|
['loc' => route('portfolio.index'), 'lastmod' => null],
|
||||||
|
['loc' => route('about'), 'lastmod' => null],
|
||||||
|
['loc' => route('privacy'), 'lastmod' => null],
|
||||||
|
['loc' => route('contact'), 'lastmod' => null],
|
||||||
|
];
|
||||||
|
|
||||||
|
$cases = PortfolioCase::query()
|
||||||
|
->published()
|
||||||
|
->orderBy('sort_order')
|
||||||
|
->get(['slug', 'updated_at']);
|
||||||
|
|
||||||
|
foreach ($cases as $case) {
|
||||||
|
/** @var Carbon|null $updatedAt */
|
||||||
|
$updatedAt = $case->updated_at;
|
||||||
|
|
||||||
|
$entries[] = [
|
||||||
|
'loc' => route('portfolio.show', $case->slug),
|
||||||
|
'lastmod' => $updatedAt?->toAtomString(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $entries;
|
||||||
|
}
|
||||||
|
}
|
||||||
78
app/Console/Commands/MediaGenerateVariantsCommand.php
Normal file
78
app/Console/Commands/MediaGenerateVariantsCommand.php
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
use App\Models\PortfolioImage;
|
||||||
|
use App\Models\Service;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use App\Models\Testimonial;
|
||||||
|
use App\Support\PublicImageUploadRules;
|
||||||
|
use App\Support\ResponsiveImage;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
final class MediaGenerateVariantsCommand extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'media:generate-variants';
|
||||||
|
|
||||||
|
protected $description = 'Generate responsive image variants for existing public media';
|
||||||
|
|
||||||
|
public function handle(): int
|
||||||
|
{
|
||||||
|
$disk = PublicImageUploadRules::disk();
|
||||||
|
$paths = $this->collectPaths();
|
||||||
|
$generated = 0;
|
||||||
|
$skipped = 0;
|
||||||
|
|
||||||
|
foreach ($paths as $path) {
|
||||||
|
if (! Storage::disk($disk)->exists($path)) {
|
||||||
|
$this->warn("Missing file: {$path}");
|
||||||
|
$skipped++;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ResponsiveImage::generate($path, $disk);
|
||||||
|
$generated++;
|
||||||
|
$this->line("Generated variants for {$path}");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info("Done. Generated: {$generated}. Skipped: {$skipped}.");
|
||||||
|
|
||||||
|
return self::SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list<string>
|
||||||
|
*/
|
||||||
|
private function collectPaths(): array
|
||||||
|
{
|
||||||
|
$paths = [];
|
||||||
|
|
||||||
|
$settings = SiteSetting::query()->first();
|
||||||
|
if ($settings && filled($settings->default_og_image_path)) {
|
||||||
|
$paths[] = (string) $settings->default_og_image_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (Service::query()->whereNotNull('cover_image_path')->pluck('cover_image_path') as $path) {
|
||||||
|
$paths[] = (string) $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (PortfolioCase::query()->whereNotNull('cover_image_path')->pluck('cover_image_path') as $path) {
|
||||||
|
$paths[] = (string) $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (PortfolioImage::query()->whereNotNull('path')->pluck('path') as $path) {
|
||||||
|
$paths[] = (string) $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (Testimonial::query()->whereNotNull('photo_path')->pluck('photo_path') as $path) {
|
||||||
|
$paths[] = (string) $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_values(array_unique($paths));
|
||||||
|
}
|
||||||
|
}
|
||||||
38
app/Http/Controllers/PublicSite/HomeController.php
Normal file
38
app/Http/Controllers/PublicSite/HomeController.php
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\PublicSite;
|
||||||
|
|
||||||
|
use App\Application\Data\PageMeta;
|
||||||
|
use App\Application\Queries\Marketing\GetHomeContent;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
|
||||||
|
final class HomeController extends Controller
|
||||||
|
{
|
||||||
|
public function __invoke(GetHomeContent $getHomeContent): View
|
||||||
|
{
|
||||||
|
$content = $getHomeContent();
|
||||||
|
|
||||||
|
return view('pages.home', [
|
||||||
|
'content' => $content,
|
||||||
|
'siteSettings' => $content->settings,
|
||||||
|
'pageMeta' => PageMeta::forPage(
|
||||||
|
canonical: route('home'),
|
||||||
|
settings: $content->settings,
|
||||||
|
jsonLd: [
|
||||||
|
'@context' => 'https://schema.org',
|
||||||
|
'@type' => 'Organization',
|
||||||
|
'name' => $content->settings->brand_name,
|
||||||
|
'email' => $content->settings->email,
|
||||||
|
'telephone' => $content->settings->phone,
|
||||||
|
'address' => [
|
||||||
|
'@type' => 'PostalAddress',
|
||||||
|
'addressLocality' => $content->settings->city,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
58
app/Http/Controllers/PublicSite/PageController.php
Normal file
58
app/Http/Controllers/PublicSite/PageController.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\PublicSite;
|
||||||
|
|
||||||
|
use App\Application\Data\PageMeta;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
|
||||||
|
final class PageController extends Controller
|
||||||
|
{
|
||||||
|
public function about(): View
|
||||||
|
{
|
||||||
|
$settings = SiteSetting::instance();
|
||||||
|
|
||||||
|
return view('pages.about', [
|
||||||
|
'siteSettings' => $settings,
|
||||||
|
'pageMeta' => PageMeta::forPage(
|
||||||
|
canonical: route('about'),
|
||||||
|
settings: $settings,
|
||||||
|
title: 'Sobre',
|
||||||
|
description: $settings->about_summary ?: ('Conheça a '.$settings->brand_name.'.'),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function privacy(): View
|
||||||
|
{
|
||||||
|
$settings = SiteSetting::instance();
|
||||||
|
|
||||||
|
return view('pages.privacy', [
|
||||||
|
'siteSettings' => $settings,
|
||||||
|
'pageMeta' => PageMeta::forPage(
|
||||||
|
canonical: route('privacy'),
|
||||||
|
settings: $settings,
|
||||||
|
title: 'Política de privacidade',
|
||||||
|
description: 'Política de privacidade da '.$settings->brand_name.'.',
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function contact(): View
|
||||||
|
{
|
||||||
|
$settings = SiteSetting::instance();
|
||||||
|
|
||||||
|
return view('pages.contact', [
|
||||||
|
'siteSettings' => $settings,
|
||||||
|
'pageMeta' => PageMeta::forPage(
|
||||||
|
canonical: route('contact'),
|
||||||
|
settings: $settings,
|
||||||
|
title: 'Contato',
|
||||||
|
description: 'Fale com a '.$settings->brand_name.'.',
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
71
app/Http/Controllers/PublicSite/PortfolioController.php
Normal file
71
app/Http/Controllers/PublicSite/PortfolioController.php
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\PublicSite;
|
||||||
|
|
||||||
|
use App\Application\Data\PageMeta;
|
||||||
|
use App\Application\Queries\Marketing\FindPublishedPortfolioCaseBySlug;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
|
|
||||||
|
final class PortfolioController extends Controller
|
||||||
|
{
|
||||||
|
public function index(): View
|
||||||
|
{
|
||||||
|
$settings = SiteSetting::instance();
|
||||||
|
|
||||||
|
/** @var LengthAwarePaginator<int, PortfolioCase> $cases */
|
||||||
|
$cases = PortfolioCase::query()
|
||||||
|
->published()
|
||||||
|
->with(['images'])
|
||||||
|
->orderBy('sort_order')
|
||||||
|
->paginate(9);
|
||||||
|
|
||||||
|
return view('pages.portfolio.index', [
|
||||||
|
'cases' => $cases,
|
||||||
|
'siteSettings' => $settings,
|
||||||
|
'pageMeta' => PageMeta::forPage(
|
||||||
|
canonical: route('portfolio.index'),
|
||||||
|
settings: $settings,
|
||||||
|
title: 'Portfólio',
|
||||||
|
description: 'Casos reais de eventos conduzidos pela '.$settings->brand_name.'.',
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show(string $slug, FindPublishedPortfolioCaseBySlug $findPublishedPortfolioCaseBySlug): View|Response
|
||||||
|
{
|
||||||
|
$case = $findPublishedPortfolioCaseBySlug($slug);
|
||||||
|
|
||||||
|
if ($case === null) {
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$settings = SiteSetting::instance();
|
||||||
|
$canonical = route('portfolio.show', $case->slug);
|
||||||
|
|
||||||
|
return view('pages.portfolio.show', [
|
||||||
|
'case' => $case,
|
||||||
|
'siteSettings' => $settings,
|
||||||
|
'pageMeta' => PageMeta::forCase(
|
||||||
|
case: $case,
|
||||||
|
canonical: $canonical,
|
||||||
|
settings: $settings,
|
||||||
|
jsonLd: [
|
||||||
|
'@context' => 'https://schema.org',
|
||||||
|
'@type' => 'Article',
|
||||||
|
'headline' => $case->title,
|
||||||
|
'description' => $case->summary,
|
||||||
|
'url' => $canonical,
|
||||||
|
'datePublished' => $case->published_at?->toAtomString(),
|
||||||
|
'dateModified' => $case->updated_at?->toAtomString(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
25
app/Http/Controllers/PublicSite/RobotsController.php
Normal file
25
app/Http/Controllers/PublicSite/RobotsController.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\PublicSite;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
|
final class RobotsController extends Controller
|
||||||
|
{
|
||||||
|
public function __invoke(): Response
|
||||||
|
{
|
||||||
|
$body = implode("\n", [
|
||||||
|
'User-agent: *',
|
||||||
|
'Allow: /',
|
||||||
|
'Sitemap: '.url('/sitemap.xml'),
|
||||||
|
'',
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response($body, 200, [
|
||||||
|
'Content-Type' => 'text/plain; charset=UTF-8',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
31
app/Http/Controllers/PublicSite/ServiceController.php
Normal file
31
app/Http/Controllers/PublicSite/ServiceController.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\PublicSite;
|
||||||
|
|
||||||
|
use App\Application\Data\PageMeta;
|
||||||
|
use App\Application\Queries\Marketing\GetPublishedServices;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
|
||||||
|
final class ServiceController extends Controller
|
||||||
|
{
|
||||||
|
public function index(GetPublishedServices $getPublishedServices): View
|
||||||
|
{
|
||||||
|
$settings = SiteSetting::instance();
|
||||||
|
$services = $getPublishedServices();
|
||||||
|
|
||||||
|
return view('pages.services.index', [
|
||||||
|
'services' => $services,
|
||||||
|
'siteSettings' => $settings,
|
||||||
|
'pageMeta' => PageMeta::forPage(
|
||||||
|
canonical: route('services.index'),
|
||||||
|
settings: $settings,
|
||||||
|
title: 'Serviços',
|
||||||
|
description: 'Conheça os serviços de assessoria de eventos da '.$settings->brand_name.'.',
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
app/Http/Controllers/PublicSite/SitemapController.php
Normal file
22
app/Http/Controllers/PublicSite/SitemapController.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\PublicSite;
|
||||||
|
|
||||||
|
use App\Application\Queries\Marketing\GetSitemapEntries;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
|
final class SitemapController extends Controller
|
||||||
|
{
|
||||||
|
public function __invoke(GetSitemapEntries $getSitemapEntries): Response
|
||||||
|
{
|
||||||
|
return response()
|
||||||
|
->view('pages.sitemap', [
|
||||||
|
'entries' => $getSitemapEntries(),
|
||||||
|
], 200, [
|
||||||
|
'Content-Type' => 'application/xml',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use App\Application\Data\PageMeta;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use Carbon\CarbonImmutable;
|
||||||
|
use Illuminate\Support\Facades\View;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\View\View as ViewInstance;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@@ -19,6 +26,38 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
//
|
$this->freezeClockWhenConfigured();
|
||||||
|
|
||||||
|
View::composer('layouts.public', function (ViewInstance $view): void {
|
||||||
|
$settings = $view->offsetExists('siteSettings')
|
||||||
|
? $view->offsetGet('siteSettings')
|
||||||
|
: SiteSetting::instance();
|
||||||
|
|
||||||
|
if (! $view->offsetExists('siteSettings')) {
|
||||||
|
$view->with('siteSettings', $settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $view->offsetExists('pageMeta')) {
|
||||||
|
$view->with('pageMeta', PageMeta::forPage(
|
||||||
|
canonical: url()->current(),
|
||||||
|
settings: $settings,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function freezeClockWhenConfigured(): void
|
||||||
|
{
|
||||||
|
if ($this->app->environment('production')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$frozenNow = config('app.frozen_now');
|
||||||
|
|
||||||
|
if (! filled($frozenNow)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CarbonImmutable::setTestNow(CarbonImmutable::parse((string) $frozenNow));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Support;
|
namespace App\Support;
|
||||||
|
|
||||||
|
use Filament\Forms\Components\BaseFileUpload;
|
||||||
use Filament\Forms\Components\FileUpload;
|
use Filament\Forms\Components\FileUpload;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Schemas\Components\Utilities\Get;
|
use Filament\Schemas\Components\Utilities\Get;
|
||||||
use Illuminate\Validation\Rules\File;
|
use Illuminate\Validation\Rules\File;
|
||||||
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
|
||||||
final class PublicImageUploadRules
|
final class PublicImageUploadRules
|
||||||
{
|
{
|
||||||
@@ -31,7 +33,19 @@ final class PublicImageUploadRules
|
|||||||
->validationMessages(self::validationMessages())
|
->validationMessages(self::validationMessages())
|
||||||
->getUploadedFileNameForStorageUsing(
|
->getUploadedFileNameForStorageUsing(
|
||||||
fn ($file): string => (string) str()->uuid().'.'.$file->getClientOriginalExtension(),
|
fn ($file): string => (string) str()->uuid().'.'.$file->getClientOriginalExtension(),
|
||||||
);
|
)
|
||||||
|
->saveUploadedFileUsing(function (BaseFileUpload $component, TemporaryUploadedFile $file): ?string {
|
||||||
|
$path = $component->saveUploadedFile($file);
|
||||||
|
|
||||||
|
if (filled($path)) {
|
||||||
|
ResponsiveImage::generate((string) $path, $component->getDiskName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $path;
|
||||||
|
})
|
||||||
|
->deleteUploadedFileUsing(function (BaseFileUpload $component, string $file): void {
|
||||||
|
ResponsiveImage::delete($file, $component->getDiskName());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function altTextField(string $name, string $imageField, string $label = 'Texto alternativo'): TextInput
|
public static function altTextField(string $name, string $imageField, string $label = 'Texto alternativo'): TextInput
|
||||||
|
|||||||
151
app/Support/ResponsiveImage.php
Normal file
151
app/Support/ResponsiveImage.php
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Support;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\Filesystem\Filesystem;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Intervention\Image\Drivers\Gd\Driver;
|
||||||
|
use Intervention\Image\ImageManager;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
|
final class ResponsiveImage
|
||||||
|
{
|
||||||
|
/** @var list<int> */
|
||||||
|
public const WIDTHS = [480, 960, 1440];
|
||||||
|
|
||||||
|
public static function generate(string $path, ?string $disk = null): void
|
||||||
|
{
|
||||||
|
$filesystem = self::filesystem($disk);
|
||||||
|
|
||||||
|
if (! $filesystem->exists($path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$manager = new ImageManager(new Driver);
|
||||||
|
$contents = $filesystem->get($path);
|
||||||
|
|
||||||
|
if ($contents === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$extension = strtolower(pathinfo($path, PATHINFO_EXTENSION));
|
||||||
|
|
||||||
|
foreach (self::WIDTHS as $width) {
|
||||||
|
$variantPath = self::variantPath($path, $width);
|
||||||
|
$variant = $manager->read($contents);
|
||||||
|
|
||||||
|
if ($variant->width() > $width) {
|
||||||
|
$variant->scale(width: $width);
|
||||||
|
}
|
||||||
|
|
||||||
|
$encoded = match ($extension) {
|
||||||
|
'png' => $variant->toPng(),
|
||||||
|
'webp' => $variant->toWebp(quality: 82),
|
||||||
|
default => $variant->toJpeg(quality: 82),
|
||||||
|
};
|
||||||
|
|
||||||
|
$filesystem->put($variantPath, (string) $encoded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function deleteVariants(string $path, ?string $disk = null): void
|
||||||
|
{
|
||||||
|
$filesystem = self::filesystem($disk);
|
||||||
|
|
||||||
|
foreach (self::WIDTHS as $width) {
|
||||||
|
$variantPath = self::variantPath($path, $width);
|
||||||
|
|
||||||
|
if ($filesystem->exists($variantPath)) {
|
||||||
|
$filesystem->delete($variantPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function delete(string $path, ?string $disk = null): void
|
||||||
|
{
|
||||||
|
$filesystem = self::filesystem($disk);
|
||||||
|
|
||||||
|
self::deleteVariants($path, $disk);
|
||||||
|
|
||||||
|
if ($filesystem->exists($path)) {
|
||||||
|
$filesystem->delete($path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function replace(string $previousPath, string $newPath, ?string $disk = null): void
|
||||||
|
{
|
||||||
|
if ($previousPath !== '' && $previousPath !== $newPath) {
|
||||||
|
self::delete($previousPath, $disk);
|
||||||
|
}
|
||||||
|
|
||||||
|
self::generate($newPath, $disk);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function variantPath(string $path, int $width): string
|
||||||
|
{
|
||||||
|
$directory = trim(dirname($path), '.');
|
||||||
|
$filename = pathinfo($path, PATHINFO_FILENAME);
|
||||||
|
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
||||||
|
$variantName = $filename.'-'.$width.($extension !== '' ? '.'.$extension : '');
|
||||||
|
|
||||||
|
return $directory === '' ? $variantName : $directory.'/'.$variantName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list<array{path: string, width: int}>
|
||||||
|
*/
|
||||||
|
public static function availableVariants(string $path, ?string $disk = null): array
|
||||||
|
{
|
||||||
|
$filesystem = self::filesystem($disk);
|
||||||
|
$variants = [];
|
||||||
|
|
||||||
|
foreach (self::WIDTHS as $width) {
|
||||||
|
$variantPath = self::variantPath($path, $width);
|
||||||
|
|
||||||
|
if ($filesystem->exists($variantPath)) {
|
||||||
|
$variants[] = [
|
||||||
|
'path' => $variantPath,
|
||||||
|
'width' => $width,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $variants;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array{width: int, height: int}|null
|
||||||
|
*/
|
||||||
|
public static function dimensions(string $path, ?string $disk = null): ?array
|
||||||
|
{
|
||||||
|
$filesystem = self::filesystem($disk);
|
||||||
|
|
||||||
|
if (! $filesystem->exists($path)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$contents = $filesystem->get($path);
|
||||||
|
|
||||||
|
if ($contents === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$image = (new ImageManager(new Driver))->read($contents);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'width' => $image->width(),
|
||||||
|
'height' => $image->height(),
|
||||||
|
];
|
||||||
|
} catch (Throwable) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function filesystem(?string $disk): Filesystem
|
||||||
|
{
|
||||||
|
return Storage::disk($disk ?? PublicImageUploadRules::disk());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.3",
|
"php": "^8.3",
|
||||||
"filament/filament": "^5.0",
|
"filament/filament": "^5.0",
|
||||||
|
"intervention/image": "^3.0",
|
||||||
"laravel/framework": "^13.8",
|
"laravel/framework": "^13.8",
|
||||||
"laravel/tinker": "^3.0"
|
"laravel/tinker": "^3.0"
|
||||||
},
|
},
|
||||||
@@ -69,7 +70,7 @@
|
|||||||
"vendor/bin/pint --test"
|
"vendor/bin/pint --test"
|
||||||
],
|
],
|
||||||
"phpstan": [
|
"phpstan": [
|
||||||
"vendor/bin/phpstan analyse --memory-limit=1G"
|
"vendor/bin/phpstan analyse --memory-limit=1G --debug"
|
||||||
],
|
],
|
||||||
"security-audit": [
|
"security-audit": [
|
||||||
"composer audit --no-interaction"
|
"composer audit --no-interaction"
|
||||||
@@ -81,7 +82,7 @@
|
|||||||
"@test"
|
"@test"
|
||||||
],
|
],
|
||||||
"visual:update": [
|
"visual:update": [
|
||||||
"@php artisan test --testsuite=Browser -- --update-snapshots"
|
"@php artisan test --testsuite=Browser --update-snapshots"
|
||||||
],
|
],
|
||||||
"post-autoload-dump": [
|
"post-autoload-dump": [
|
||||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
|
|||||||
146
composer.lock
generated
146
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "f86a5740384eb06ae059db6a1d6b3d7f",
|
"content-hash": "b7cd97df13085158d9ecb6ad877a600f",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "anourvalar/eloquent-serialize",
|
"name": "anourvalar/eloquent-serialize",
|
||||||
@@ -2026,6 +2026,150 @@
|
|||||||
],
|
],
|
||||||
"time": "2026-07-17T13:53:03+00:00"
|
"time": "2026-07-17T13:53:03+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "intervention/gif",
|
||||||
|
"version": "4.2.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Intervention/gif.git",
|
||||||
|
"reference": "c3598a16ebe7690cd55640c44144a9df383ea73c"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/Intervention/gif/zipball/c3598a16ebe7690cd55640c44144a9df383ea73c",
|
||||||
|
"reference": "c3598a16ebe7690cd55640c44144a9df383ea73c",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^8.1"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpstan/phpstan": "^2.1",
|
||||||
|
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0",
|
||||||
|
"slevomat/coding-standard": "~8.0",
|
||||||
|
"squizlabs/php_codesniffer": "^3.8"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Intervention\\Gif\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Oliver Vogel",
|
||||||
|
"email": "oliver@intervention.io",
|
||||||
|
"homepage": "https://intervention.io/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Native PHP GIF Encoder/Decoder",
|
||||||
|
"homepage": "https://github.com/intervention/gif",
|
||||||
|
"keywords": [
|
||||||
|
"animation",
|
||||||
|
"gd",
|
||||||
|
"gif",
|
||||||
|
"image"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/Intervention/gif/issues",
|
||||||
|
"source": "https://github.com/Intervention/gif/tree/4.2.4"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://paypal.me/interventionio",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Intervention",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://ko-fi.com/interventionphp",
|
||||||
|
"type": "ko_fi"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2026-01-04T09:27:23+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "intervention/image",
|
||||||
|
"version": "3.11.8",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Intervention/image.git",
|
||||||
|
"reference": "cf04c8dd245697f701057c13d4bfe140d584e738"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/Intervention/image/zipball/cf04c8dd245697f701057c13d4bfe140d584e738",
|
||||||
|
"reference": "cf04c8dd245697f701057c13d4bfe140d584e738",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"intervention/gif": "^4.2",
|
||||||
|
"php": "^8.1"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"mockery/mockery": "^1.6",
|
||||||
|
"phpstan/phpstan": "^2.1",
|
||||||
|
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0",
|
||||||
|
"slevomat/coding-standard": "~8.0",
|
||||||
|
"squizlabs/php_codesniffer": "^4"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-exif": "Recommended to be able to read EXIF data properly."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Intervention\\Image\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Oliver Vogel",
|
||||||
|
"email": "oliver@intervention.io",
|
||||||
|
"homepage": "https://intervention.io"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP Image Processing",
|
||||||
|
"homepage": "https://image.intervention.io",
|
||||||
|
"keywords": [
|
||||||
|
"gd",
|
||||||
|
"image",
|
||||||
|
"imagick",
|
||||||
|
"resize",
|
||||||
|
"thumbnail",
|
||||||
|
"watermark"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/Intervention/image/issues",
|
||||||
|
"source": "https://github.com/Intervention/image/tree/3.11.8"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://paypal.me/interventionio",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Intervention",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://ko-fi.com/interventionphp",
|
||||||
|
"type": "ko_fi"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2026-05-01T08:20:10+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "kirschbaum-development/eloquent-power-joins",
|
"name": "kirschbaum-development/eloquent-power-joins",
|
||||||
"version": "4.3.3",
|
"version": "4.3.3",
|
||||||
|
|||||||
@@ -67,6 +67,18 @@ return [
|
|||||||
|
|
||||||
'timezone' => env('APP_TIMEZONE', 'America/Fortaleza'),
|
'timezone' => env('APP_TIMEZONE', 'America/Fortaleza'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Frozen Clock (non-production)
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When set outside production, the application clock is frozen for
|
||||||
|
| deterministic rendering (visual regression / seeded content).
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'frozen_now' => env('APP_FROZEN_NOW'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Application Locale Configuration
|
| Application Locale Configuration
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ return [
|
|||||||
'public' => [
|
'public' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => storage_path('app/public'),
|
'root' => storage_path('app/public'),
|
||||||
'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/storage',
|
// Same-origin path so Pest Browser / any host:port can load media.
|
||||||
|
// Absolute URLs for OG tags should be built with url(...).
|
||||||
|
'url' => '/storage',
|
||||||
'visibility' => 'public',
|
'visibility' => 'public',
|
||||||
'throw' => false,
|
'throw' => false,
|
||||||
'report' => false,
|
'report' => false,
|
||||||
|
|||||||
172
database/seeders/VisualContentSeeder.php
Normal file
172
database/seeders/VisualContentSeeder.php
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\PortfolioCase;
|
||||||
|
use App\Models\PortfolioImage;
|
||||||
|
use App\Models\Service;
|
||||||
|
use App\Models\SiteSetting;
|
||||||
|
use App\Models\Testimonial;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deterministic content for visual regression. Keep separate from ContentSeeder demo data.
|
||||||
|
*/
|
||||||
|
class VisualContentSeeder extends Seeder
|
||||||
|
{
|
||||||
|
public const FROZEN_NOW = '2026-03-15T12:00:00-03:00';
|
||||||
|
|
||||||
|
private const SEED_TIMESTAMP = '2026-03-15 12:00:00';
|
||||||
|
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
Carbon::setTestNow(Carbon::parse(self::FROZEN_NOW));
|
||||||
|
|
||||||
|
$this->seedSiteSettings();
|
||||||
|
$this->seedServices();
|
||||||
|
$this->seedPortfolioCases();
|
||||||
|
$this->seedTestimonials();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function seedSiteSettings(): void
|
||||||
|
{
|
||||||
|
SiteSetting::query()->updateOrCreate([], [
|
||||||
|
'brand_name' => 'Amare Assessoria',
|
||||||
|
'hero_eyebrow' => 'Assessoria de eventos',
|
||||||
|
'hero_title' => 'Celebrações com propósito',
|
||||||
|
'hero_subtitle' => 'Planejamento completo para casamentos e eventos corporativos em Fortaleza.',
|
||||||
|
'hero_cta_label' => 'Solicitar orçamento',
|
||||||
|
'about_summary' => 'Assessoria boutique especializada em experiências memoráveis.',
|
||||||
|
'email' => 'contato@amare.local',
|
||||||
|
'phone' => '(85) 99999-9999',
|
||||||
|
'city' => 'Fortaleza, CE',
|
||||||
|
'social_links' => [
|
||||||
|
'instagram' => 'https://instagram.com/amare',
|
||||||
|
],
|
||||||
|
'default_meta_title' => 'Amare Assessoria de Eventos',
|
||||||
|
'default_meta_description' => 'Assessoria premium para casamentos e eventos corporativos.',
|
||||||
|
'default_og_image_path' => $this->copyFixture('og-default.jpg', 'visual/og/og-default.jpg'),
|
||||||
|
'default_og_image_alt' => 'Identidade visual da Amare Assessoria de Eventos',
|
||||||
|
'analytics_enabled' => false,
|
||||||
|
'analytics_script' => null,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function seedServices(): void
|
||||||
|
{
|
||||||
|
foreach ([
|
||||||
|
[
|
||||||
|
'title' => 'Casamentos',
|
||||||
|
'slug' => 'casamentos',
|
||||||
|
'summary' => 'Planejamento completo do grande dia.',
|
||||||
|
'description' => 'Do briefing ao último brinde, cuidamos de cada detalhe do casamento.',
|
||||||
|
'sort_order' => 1,
|
||||||
|
'is_featured' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'Eventos corporativos',
|
||||||
|
'slug' => 'eventos-corporativos',
|
||||||
|
'summary' => 'Experiências alinhadas à marca.',
|
||||||
|
'description' => 'Lançamentos, convenções e encontros corporativos com operação impecável.',
|
||||||
|
'sort_order' => 2,
|
||||||
|
'is_featured' => true,
|
||||||
|
],
|
||||||
|
] as $service) {
|
||||||
|
Service::query()->updateOrCreate(
|
||||||
|
['slug' => $service['slug']],
|
||||||
|
[
|
||||||
|
...$service,
|
||||||
|
'cover_image_path' => $this->copyFixture('service-cover.jpg', 'visual/services/'.$service['slug'].'.jpg'),
|
||||||
|
'cover_image_alt' => 'Capa do serviço '.$service['title'],
|
||||||
|
'published_at' => Carbon::parse(self::SEED_TIMESTAMP),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function seedPortfolioCases(): void
|
||||||
|
{
|
||||||
|
$cases = [
|
||||||
|
[
|
||||||
|
'title' => 'Casamento Ana e Lucas',
|
||||||
|
'slug' => 'casamento-ana-lucas',
|
||||||
|
'summary' => 'Cerimônia ao ar livre em Fortaleza.',
|
||||||
|
'event_type' => 'Casamento',
|
||||||
|
'city' => 'Fortaleza',
|
||||||
|
'venue' => 'Espaço Jardim Atlântico',
|
||||||
|
'event_date' => '2025-11-20',
|
||||||
|
'challenge' => 'Integrar cerimônia e recepção em áreas distintas.',
|
||||||
|
'solution' => 'Operação sincronizada com sinalização e timing detalhado.',
|
||||||
|
'result' => 'Experiência fluida para 180 convidados.',
|
||||||
|
'sort_order' => 1,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'Lançamento Verano',
|
||||||
|
'slug' => 'lancamento-verano',
|
||||||
|
'summary' => 'Evento corporativo de lançamento de coleção.',
|
||||||
|
'event_type' => 'Corporativo',
|
||||||
|
'city' => 'Fortaleza',
|
||||||
|
'venue' => 'Centro de Convenções',
|
||||||
|
'event_date' => '2025-09-10',
|
||||||
|
'challenge' => 'Ativar marca em ambiente multiestação.',
|
||||||
|
'solution' => 'Fluxo de convidados e fornecedores com cronograma minuto a minuto.',
|
||||||
|
'result' => 'Alta percepção de marca e cobertura de imprensa.',
|
||||||
|
'sort_order' => 2,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($cases as $caseData) {
|
||||||
|
$case = PortfolioCase::query()->updateOrCreate(
|
||||||
|
['slug' => $caseData['slug']],
|
||||||
|
[
|
||||||
|
...$caseData,
|
||||||
|
'cover_image_path' => $this->copyFixture('portfolio-cover.jpg', 'visual/portfolio/'.$caseData['slug'].'-cover.jpg'),
|
||||||
|
'cover_image_alt' => 'Capa do caso '.$caseData['title'],
|
||||||
|
'is_featured' => true,
|
||||||
|
'published_at' => Carbon::parse(self::SEED_TIMESTAMP),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
PortfolioImage::query()->where('portfolio_case_id', $case->id)->delete();
|
||||||
|
|
||||||
|
PortfolioImage::query()->create([
|
||||||
|
'portfolio_case_id' => $case->id,
|
||||||
|
'path' => $this->copyFixture('gallery.jpg', 'visual/portfolio/'.$caseData['slug'].'-gallery-1.jpg'),
|
||||||
|
'alt_text' => 'Galeria '.$caseData['title'].' 1',
|
||||||
|
'caption' => 'Detalhe da decoração',
|
||||||
|
'sort_order' => 1,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function seedTestimonials(): void
|
||||||
|
{
|
||||||
|
Testimonial::query()->updateOrCreate(
|
||||||
|
[
|
||||||
|
'author_name' => 'Ana Souza',
|
||||||
|
'quote' => 'A Amare transformou nosso casamento em uma experiência inesquecível.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'context' => 'Noiva',
|
||||||
|
'sort_order' => 1,
|
||||||
|
'is_featured' => true,
|
||||||
|
'photo_path' => $this->copyFixture('testimonial.jpg', 'visual/testimonials/ana-souza.jpg'),
|
||||||
|
'photo_alt' => 'Foto de Ana Souza',
|
||||||
|
'published_at' => Carbon::parse(self::SEED_TIMESTAMP),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function copyFixture(string $fixtureName, string $destination): string
|
||||||
|
{
|
||||||
|
$source = base_path('tests/fixtures/images/'.$fixtureName);
|
||||||
|
Storage::disk('public')->put($destination, File::get($source));
|
||||||
|
|
||||||
|
return $destination;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
docker/entrypoint.sh
Normal file → Executable file
3
docker/entrypoint.sh
Normal file → Executable file
@@ -8,6 +8,9 @@ fi
|
|||||||
|
|
||||||
mkdir -p storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache
|
mkdir -p storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache
|
||||||
|
|
||||||
|
# Idempotent public disk symlink for serving uploaded media from the container.
|
||||||
|
php artisan storage:link --force --no-interaction
|
||||||
|
|
||||||
php artisan package:discover --ansi
|
php artisan package:discover --ansi
|
||||||
php artisan config:cache
|
php artisan config:cache
|
||||||
php artisan route:cache
|
php artisan route:cache
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
schema: spec-driven
|
||||||
|
created: 2026-07-29
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
## Context
|
||||||
|
|
||||||
|
Fase 0 entregou Laravel 13, Filament 5 em `/admin`, design tokens, autenticação interna e pipeline CI. O repositório possui apenas home placeholder em [routes/web.php](../../routes/web.php). Esta change implementa a **metade CMS** da Fase 1 (SPEC §18): persistência e gestão Filament de conteúdo, sem rotas públicas.
|
||||||
|
|
||||||
|
Padrões existentes a seguir:
|
||||||
|
|
||||||
|
- Resources Filament com form/table separados ([app/Filament/Resources/Users/](../../app/Filament/Resources/Users/))
|
||||||
|
- Policies admin-only ([app/Policies/UserPolicy.php](../../app/Policies/UserPolicy.php))
|
||||||
|
- `declare(strict_types=1);` em todo PHP próprio
|
||||||
|
|
||||||
|
## Goals / Non-Goals
|
||||||
|
|
||||||
|
**Goals:**
|
||||||
|
|
||||||
|
- Assessora admin gerencia settings, serviços, portfólio e depoimentos no Filament.
|
||||||
|
- Dados persistidos conforme SPEC §8.2, prontos para consumo pela change `build-public-site`.
|
||||||
|
- Feature tests locais em PostgreSQL (jsonb, constraints reais).
|
||||||
|
- Seed determinístico parcial para desenvolvimento e testes futuros.
|
||||||
|
|
||||||
|
**Non-Goals:**
|
||||||
|
|
||||||
|
- Rotas públicas, home, SEO, sitemap, snapshots visuais, briefing.
|
||||||
|
- Actions de publicação com auditoria (`PublishPortfolioCase` etc.) — adiadas até Fase 5.
|
||||||
|
- Variantes responsivas de imagem, page builder, categorias dinâmicas.
|
||||||
|
|
||||||
|
## Decisions
|
||||||
|
|
||||||
|
### 1. Publicação via `published_at` único
|
||||||
|
|
||||||
|
**Decisão:** `published_at` nullable timestamp é a única fonte de verdade. Scope `published()` no model (`whereNotNull('published_at')`). Sem coluna `is_published`.
|
||||||
|
|
||||||
|
**Alternativa rejeitada:** boolean `is_published` + `published_at` — viola SPEC §1.1 (não persistir status derivável).
|
||||||
|
|
||||||
|
### 2. Mídia em disco `public` local, S3 em produção
|
||||||
|
|
||||||
|
**Decisão:** uploads de capa/galeria/foto usam disco Laravel configurável via `FILESYSTEM_DISK`. Local: `public` + `php artisan storage:link`. Produção: `s3`. Path gerado com UUID/hash, nunca nome original.
|
||||||
|
|
||||||
|
**Alternativa rejeitada:** blobs no PostgreSQL — proibido por SPEC §6.4.
|
||||||
|
|
||||||
|
### 3. Validação de mídia centralizada
|
||||||
|
|
||||||
|
**Decisão:** classe em `app/Support/` (ex.: `PublicImageUploadRules`) com allowlist MIME (`image/jpeg`, `image/png`, `image/webp`), extensões correspondentes, limite 10 MB, alt text obrigatório quando imagem presente. Reutilizada nos Resources Filament.
|
||||||
|
|
||||||
|
### 4. Sem Actions de domínio nesta fase
|
||||||
|
|
||||||
|
**Decisão:** Filament Resources salvam diretamente via Eloquent. Actions (`PublishPortfolioCase`, `UnpublishPortfolioCase`) só serão criadas quando auditoria (Fase 5) exigir efeito colateral transacional.
|
||||||
|
|
||||||
|
**Rationale:** SPEC §9.5 — não criar Action para CRUD sem regra adicional.
|
||||||
|
|
||||||
|
### 5. Auditoria de publicação adiada
|
||||||
|
|
||||||
|
**Decisão:** publicar/despublicar **não** grava `audit_logs` nesta change.
|
||||||
|
|
||||||
|
**Desvio documentado:** ADM-02 lista publicação como auditável, mas tabela `audit_logs` é Fase 5. Retomar em change de hardening.
|
||||||
|
|
||||||
|
### 6. Autorização admin-only para CMS
|
||||||
|
|
||||||
|
**Decisão:** Policies espelham `UserPolicy` — `$user->isAdmin()` para view/create/update/delete em conteúdo do site. Assistant recebe 403 em todos os Resources de conteúdo.
|
||||||
|
|
||||||
|
**Referência:** WEB-02 — "admin pode gerenciar; assistant não pode".
|
||||||
|
|
||||||
|
### 7. Site settings como singleton Filament Page
|
||||||
|
|
||||||
|
**Decisão:** model `SiteSetting` com método `instance()` (primeiro registro ou create default). Filament `ManageSiteSettings` page (não Resource de lista) — evita CRUD genérico de chave/valor (SPEC §WEB-06).
|
||||||
|
|
||||||
|
### 8. Slug automático a partir do título
|
||||||
|
|
||||||
|
**Decisão:** slug gerado no model (observer ou mutator) com `Str::slug()`, unique constraint no banco. Admin pode editar slug no form.
|
||||||
|
|
||||||
|
### 9. Navegação Filament
|
||||||
|
|
||||||
|
**Decisão:** grupo `Conteúdo do site` com sort order conforme SPEC §5.2:
|
||||||
|
|
||||||
|
1. Configurações (singleton page)
|
||||||
|
2. Serviços
|
||||||
|
3. Portfólio
|
||||||
|
4. Depoimentos
|
||||||
|
|
||||||
|
## Risks / Trade-offs
|
||||||
|
|
||||||
|
| Risco | Mitigação |
|
||||||
|
|---|---|
|
||||||
|
| Uploads locais sem S3 em dev | `Storage::fake()` nos testes; documentar `storage:link` no README |
|
||||||
|
| Galeria ordenada complexa no Filament | Relation manager com `sort_order` e reorderable |
|
||||||
|
| jsonb `social_links` difere SQLite | phpunit.xml já migrado para PostgreSQL |
|
||||||
|
| Conteúdo criado sem rotas públicas | seed + testes Filament validam CMS; rotas vêm em `build-public-site` |
|
||||||
|
| Auditoria ausente em publicação | desvio explícito; retomar Fase 5 |
|
||||||
|
|
||||||
|
## Migration Plan
|
||||||
|
|
||||||
|
1. Rodar migrations em ordem: `site_settings` → `services` → `portfolio_cases` + `portfolio_images` → `testimonials`.
|
||||||
|
2. Executar seed de conteúdo após migrations.
|
||||||
|
3. Sem rollback de dados em produção (greenfield); `migrate:rollback` suportado em dev.
|
||||||
|
|
||||||
|
## Open Questions
|
||||||
|
|
||||||
|
- Nenhuma bloqueante. Fontes tipográficas finais da home ficam para `build-public-site`.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
## Why
|
||||||
|
|
||||||
|
A Fase 0 — Fundação está concluída e arquivada; o próximo passo do MVP é permitir que a assessora gerencie conteúdo do site no Filament antes de expor rotas públicas. Sem modelos, migrations e Resources internos para configurações, serviços, portfólio e depoimentos, a Fase 1 não pode avançar e o site permanece estático.
|
||||||
|
|
||||||
|
## What Changes
|
||||||
|
|
||||||
|
- Criar tabelas e models conforme SPEC §8.2: `site_settings`, `services`, `portfolio_cases`, `portfolio_images`, `testimonials`.
|
||||||
|
- Implementar CMS Filament no grupo **Conteúdo do site** (SPEC §5.2) para WEB-02, WEB-03, WEB-04 e WEB-06.
|
||||||
|
- Introduzir regras compartilhadas de upload de mídia pública (allowlist MIME, limite de tamanho, path aleatório, alt text obrigatório).
|
||||||
|
- Policies admin-only para conteúdo do site; assistant não gerencia CMS (WEB-02).
|
||||||
|
- Factories e seed parcial de demonstração (3 serviços, 3 casos, 3 depoimentos, settings).
|
||||||
|
- Alinhar `phpunit.xml` para feature tests locais em PostgreSQL (delta de `quality-gates`).
|
||||||
|
|
||||||
|
## Non-Goals
|
||||||
|
|
||||||
|
Conforme [SPEC.md §4.2](../../SPEC.md) e a divisão da Fase 1:
|
||||||
|
|
||||||
|
- Rotas públicas, home editorial (WEB-01), páginas institucionais (WEB-07), briefing (WEB-05).
|
||||||
|
- SEO, sitemap, robots, snapshots visuais e testes de acessibilidade do site público.
|
||||||
|
- Page builder, CRUD de categorias, auditoria de publicação (`audit_logs` — Fase 5).
|
||||||
|
- Variantes responsivas de imagem (adiadas para change `build-public-site`).
|
||||||
|
|
||||||
|
## Capabilities
|
||||||
|
|
||||||
|
### New Capabilities
|
||||||
|
|
||||||
|
- `site-settings`: singleton tipado de configurações globais do site (WEB-06).
|
||||||
|
- `service-catalog`: CRUD de serviços publicáveis com slug único (WEB-02).
|
||||||
|
- `portfolio-cases`: casos de portfólio com galeria ordenada (WEB-03).
|
||||||
|
- `testimonials`: depoimentos publicáveis (WEB-04).
|
||||||
|
- `content-media`: validação e armazenamento compartilhado de imagens públicas (SPEC §6.4, §12.4).
|
||||||
|
|
||||||
|
### Modified Capabilities
|
||||||
|
|
||||||
|
- `quality-gates`: feature tests locais MUST usar PostgreSQL, alinhados ao CI (SPEC §14.2, §20).
|
||||||
|
|
||||||
|
## Impact
|
||||||
|
|
||||||
|
- **Cria**: migrations, models, factories, Policies, Filament Resources/Pages em `app/Filament/`, seeders, testes feature em `tests/Feature/Marketing/`.
|
||||||
|
- **Altera**: `phpunit.xml`, `DatabaseSeeder`, navegação do painel Filament.
|
||||||
|
- **Depende de**: specs arquivadas da fundação (`internal-authentication`, `design-tokens`, `quality-gates`).
|
||||||
|
- **Sem impacto** em rotas públicas existentes além do placeholder `/`.
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Public content images are validated and stored securely
|
||||||
|
|
||||||
|
The system SHALL validate public content uploads (service covers, portfolio covers/gallery, testimonial photos, site OG image) per SPEC §6.4 and §12.4. Validation MUST enforce MIME allowlist (jpeg, png, webp), matching extensions, maximum size of 10 MB, and mandatory alt text when an image is uploaded.
|
||||||
|
|
||||||
|
#### Scenario: Invalid MIME is rejected
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads a file with disallowed MIME type
|
||||||
|
- **THEN** validation MUST fail with a pt-BR error message
|
||||||
|
|
||||||
|
#### Scenario: Oversized file is rejected
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads an image exceeding 10 MB
|
||||||
|
- **THEN** validation MUST fail
|
||||||
|
|
||||||
|
#### Scenario: Storage path is not derived from original filename
|
||||||
|
|
||||||
|
- **WHEN** an image is stored
|
||||||
|
- **THEN** the physical path MUST be generated (UUID/hash based)
|
||||||
|
- **AND** MUST NOT use the original upload filename as the storage key
|
||||||
|
|
||||||
|
#### Scenario: Alt text required with image
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads a cover or gallery image without alt text
|
||||||
|
- **THEN** validation MUST fail
|
||||||
|
|
||||||
|
#### Scenario: Images are not stored in PostgreSQL
|
||||||
|
|
||||||
|
- **WHEN** content with images is persisted
|
||||||
|
- **THEN** only the filesystem path MUST be stored in the database
|
||||||
|
- **AND** binary image data MUST NOT be written to PostgreSQL columns
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Portfolio cases support editorial content and ordered gallery
|
||||||
|
|
||||||
|
The system SHALL allow admins to manage portfolio cases (SPEC WEB-03) with title, unique slug, summary, event type, optional city/venue/event date, challenge, solution, optional result, cover image with alt text, featured flag, sort order, `published_at`, and optional SEO meta fields. Each case MUST support an ordered gallery via `portfolio_images` (path, alt text, optional caption, sort order).
|
||||||
|
|
||||||
|
#### Scenario: Draft case is not publicly visible
|
||||||
|
|
||||||
|
- **WHEN** a portfolio case has `published_at` null
|
||||||
|
- **THEN** the `published()` scope MUST exclude it
|
||||||
|
|
||||||
|
#### Scenario: Published case meets acceptance criteria
|
||||||
|
|
||||||
|
- **WHEN** an admin fills required fields and sets `published_at`
|
||||||
|
- **THEN** the case MUST be included in the `published()` scope
|
||||||
|
- **AND** cover and gallery images MUST have alt text when present
|
||||||
|
|
||||||
|
#### Scenario: Gallery images maintain order
|
||||||
|
|
||||||
|
- **WHEN** an admin reorders gallery images in Filament
|
||||||
|
- **THEN** `sort_order` MUST reflect the chosen order per `portfolio_case_id`
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot manage portfolio
|
||||||
|
|
||||||
|
- **WHEN** an assistant attempts to access portfolio cases
|
||||||
|
- **THEN** access MUST be denied with HTTP 403
|
||||||
|
|
||||||
|
#### Scenario: Cascade delete removes gallery images
|
||||||
|
|
||||||
|
- **WHEN** a portfolio case is deleted
|
||||||
|
- **THEN** associated `portfolio_images` records MUST be removed (FK cascade)
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Local feature tests use PostgreSQL
|
||||||
|
|
||||||
|
The system SHALL configure `phpunit.xml` so that the Feature test suite uses PostgreSQL with the same connection parameters as CI (`DB_CONNECTION=pgsql`, host, port, database `amare_test`, credentials). Local feature tests MUST NOT default to SQLite `:memory:`.
|
||||||
|
|
||||||
|
#### Scenario: Developer runs feature tests locally
|
||||||
|
|
||||||
|
- **WHEN** a developer runs `composer test:feature` with PostgreSQL available
|
||||||
|
- **THEN** tests MUST execute against PostgreSQL
|
||||||
|
- **AND** MUST NOT silently fall back to SQLite
|
||||||
|
|
||||||
|
#### Scenario: Feature tests exercise PostgreSQL-specific types
|
||||||
|
|
||||||
|
- **WHEN** feature tests persist records with jsonb columns (e.g., `social_links`)
|
||||||
|
- **THEN** migrations and constraints MUST be validated against PostgreSQL semantics
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Services are managed in Filament with publication control
|
||||||
|
|
||||||
|
The system SHALL allow admins to create, update, and delete services (SPEC WEB-02). Each service MUST have title, unique slug, summary, description, optional cover image with alt text, sort order, featured flag, and `published_at`.
|
||||||
|
|
||||||
|
#### Scenario: Unpublished service is not publicly visible
|
||||||
|
|
||||||
|
- **WHEN** a service has `published_at` null
|
||||||
|
- **THEN** the `published()` scope MUST exclude it from public queries
|
||||||
|
|
||||||
|
#### Scenario: Published service is queryable
|
||||||
|
|
||||||
|
- **WHEN** an admin sets `published_at` on a service with required fields
|
||||||
|
- **THEN** the service MUST be included in the `published()` scope
|
||||||
|
|
||||||
|
#### Scenario: Slug uniqueness is enforced
|
||||||
|
|
||||||
|
- **WHEN** an admin attempts to save two services with the same slug
|
||||||
|
- **THEN** validation or database constraint MUST reject the duplicate
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot manage services
|
||||||
|
|
||||||
|
- **WHEN** an assistant attempts to access the services Resource
|
||||||
|
- **THEN** access MUST be denied with HTTP 403
|
||||||
|
|
||||||
|
#### Scenario: Delete requires confirmation
|
||||||
|
|
||||||
|
- **WHEN** an admin deletes a service in Filament
|
||||||
|
- **THEN** the UI MUST require explicit confirmation before deletion
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Site settings singleton is manageable by admin only
|
||||||
|
|
||||||
|
The system SHALL persist site-wide settings in a `site_settings` table as a typed singleton (SPEC WEB-06, §8.2). Fields MUST include brand name, hero copy (eyebrow, title, subtitle, CTA label), about summary, contact email/phone/city, social links (jsonb), default meta title/description, default OG image path and alt text, and optional analytics fields disabled by default.
|
||||||
|
|
||||||
|
#### Scenario: Admin updates site settings
|
||||||
|
|
||||||
|
- **WHEN** an admin saves the site settings form in Filament
|
||||||
|
- **THEN** the singleton record is updated
|
||||||
|
- **AND** labels and validation messages are in pt-BR
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot access site settings
|
||||||
|
|
||||||
|
- **WHEN** an assistant navigates to site settings in Filament
|
||||||
|
- **THEN** access MUST be denied with HTTP 403
|
||||||
|
|
||||||
|
#### Scenario: Default OG image requires alt text
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads a default OG image without alt text
|
||||||
|
- **THEN** validation MUST fail with a pt-BR error message
|
||||||
|
- **AND** alt text MUST remain optional when no default OG image is present
|
||||||
|
|
||||||
|
#### Scenario: Singleton avoids generic key-value store
|
||||||
|
|
||||||
|
- **WHEN** site settings are stored
|
||||||
|
- **THEN** the system MUST use typed columns on `site_settings`
|
||||||
|
- **AND** MUST NOT introduce a generic key/value configuration table
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Testimonials are managed with publication control
|
||||||
|
|
||||||
|
The system SHALL allow admins to manage testimonials (SPEC WEB-04) with quote text, author name, optional context, optional photo with alt text, sort order, featured flag, and `published_at`.
|
||||||
|
|
||||||
|
#### Scenario: Unpublished testimonial is excluded
|
||||||
|
|
||||||
|
- **WHEN** a testimonial has `published_at` null
|
||||||
|
- **THEN** the `published()` scope MUST exclude it
|
||||||
|
|
||||||
|
#### Scenario: Published testimonial is queryable
|
||||||
|
|
||||||
|
- **WHEN** an admin sets `published_at` with required quote and author name
|
||||||
|
- **THEN** the testimonial MUST be included in the `published()` scope
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot manage testimonials
|
||||||
|
|
||||||
|
- **WHEN** an assistant attempts to access the testimonials Resource
|
||||||
|
- **THEN** access MUST be denied with HTTP 403
|
||||||
|
|
||||||
|
#### Scenario: Featured testimonials are filterable
|
||||||
|
|
||||||
|
- **WHEN** content is queried with featured filter
|
||||||
|
- **THEN** records with `is_featured` true MUST be retrievable independently of sort order
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
## 1. Pré-requisitos e alinhamento de testes
|
||||||
|
|
||||||
|
- [x] 1.1 Confirmar `phpunit.xml` com PostgreSQL (`amare_test`) e documentar criação do banco de teste no README
|
||||||
|
- [x] 1.2 Registrar Policies de conteúdo no `AppServiceProvider` ou descoberta automática
|
||||||
|
- [x] 1.3 Criar diretório `tests/Feature/Marketing/` para testes desta change
|
||||||
|
|
||||||
|
## 2. Content media (content-media)
|
||||||
|
|
||||||
|
- [x] 2.1 Criar `app/Support/PublicImageUploadRules.php` com allowlist MIME/extensão, limite 10 MB e regra de alt text obrigatório
|
||||||
|
- [x] 2.2 Escrever teste unitário ou feature validando rejeição de MIME inválido e arquivo oversize
|
||||||
|
- [x] 2.3 Documentar `php artisan storage:link` e disco `public` no README
|
||||||
|
- [x] 2.4 Reforçar uploads Filament com validação compartilhada de MIME, extensão e limite de 10 MB, incluindo mensagens em pt-BR e testes regressivos
|
||||||
|
|
||||||
|
## 3. Site settings (site-settings / WEB-06)
|
||||||
|
|
||||||
|
- [x] 3.1 Criar migration `site_settings` conforme SPEC §8.2 (incluindo `social_links` jsonb)
|
||||||
|
- [x] 3.2 Criar model `SiteSetting` com `instance()` singleton e casts (jsonb, timestamps)
|
||||||
|
- [x] 3.3 Criar `SiteSettingPolicy` admin-only
|
||||||
|
- [x] 3.4 Criar Filament Page `ManageSiteSettings` no grupo **Conteúdo do site** com form tipado (hero, contato, meta, OG image, analytics desabilitados por padrão)
|
||||||
|
- [x] 3.5 Escrever feature tests: admin salva settings; assistant recebe 403
|
||||||
|
- [x] 3.6 Adicionar alt text condicional à imagem OG padrão na migration, model, formulário, seed determinístico e testes
|
||||||
|
|
||||||
|
## 4. Service catalog (service-catalog / WEB-02)
|
||||||
|
|
||||||
|
- [x] 4.1 Criar migration `services` com índices em `slug`, `sort_order`, `is_featured`, `published_at`
|
||||||
|
- [x] 4.2 Criar model `Service` com scope `published()`, slug único e fillable conforme SPEC
|
||||||
|
- [x] 4.3 Criar `ServiceFactory` e `ServicePolicy` admin-only
|
||||||
|
- [x] 4.4 Criar `ServiceResource` Filament (form, table, confirmação de exclusão, upload de capa com alt text via PublicImageUploadRules)
|
||||||
|
- [x] 4.5 Escrever feature tests: slug único, publicação via `published_at`, assistant 403
|
||||||
|
|
||||||
|
## 5. Portfolio cases (portfolio-cases / WEB-03)
|
||||||
|
|
||||||
|
- [x] 5.1 Criar migrations `portfolio_cases` e `portfolio_images` (FK cascade, índice composto `portfolio_case_id, sort_order`)
|
||||||
|
- [x] 5.2 Criar models `PortfolioCase` e `PortfolioImage` com relação hasMany ordenada e scope `published()`
|
||||||
|
- [x] 5.3 Criar factories e `PortfolioCasePolicy` admin-only
|
||||||
|
- [x] 5.4 Criar `PortfolioCaseResource` com relation manager de galeria (reorderable, alt text, caption opcional)
|
||||||
|
- [x] 5.5 Escrever feature tests: publicação, ordem da galeria, cascade delete, assistant 403
|
||||||
|
|
||||||
|
## 6. Testimonials (testimonials / WEB-04)
|
||||||
|
|
||||||
|
- [x] 6.1 Criar migration `testimonials` conforme SPEC §8.2
|
||||||
|
- [x] 6.2 Criar model `Testimonial` com scope `published()` e `TestimonialFactory`
|
||||||
|
- [x] 6.3 Criar `TestimonialPolicy` e `TestimonialResource` Filament
|
||||||
|
- [x] 6.4 Escrever feature tests: publicação, featured filter, assistant 403
|
||||||
|
|
||||||
|
## 7. Seed de conteúdo de demonstração
|
||||||
|
|
||||||
|
- [x] 7.1 Criar `ContentSeeder` ou estender `DatabaseSeeder` com settings padrão, 3 serviços, 3 casos (com galeria), 3 depoimentos
|
||||||
|
- [x] 7.2 Adicionar imagens fixture versionadas em `tests/fixtures/images/` e referenciá-las no seed
|
||||||
|
- [x] 7.3 Garantir datas e conteúdo determinísticos para testes visuais futuros (SPEC §17.3)
|
||||||
|
|
||||||
|
## 8. Verificação final
|
||||||
|
|
||||||
|
- [x] 8.1 Executar `composer pint:check` e `composer phpstan`
|
||||||
|
- [x] 8.2 Executar `composer test:feature` contra PostgreSQL local
|
||||||
|
- [x] 8.3 Executar `composer quality` e corrigir falhas
|
||||||
|
- [x] 8.4 Reportar conclusão no formato SPEC §24 (requisitos WEB-02/03/04/06, alterações, testes, comandos, aceite, pendências)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
schema: spec-driven
|
||||||
|
created: 2026-07-28
|
||||||
124
openspec/changes/archive/2026-07-29-setup-foundation/design.md
Normal file
124
openspec/changes/archive/2026-07-29-setup-foundation/design.md
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
## Context
|
||||||
|
|
||||||
|
Repositório greenfield: contém [SPEC.md](../../../SPEC.md) (especificação normativa aprovada), scaffold OpenSpec e um commit inicial. Não existe aplicação Laravel, banco, CI ou contêiner.
|
||||||
|
|
||||||
|
Versões-alvo confirmadas no Packagist (jul/2026): Laravel 13.23, Filament 5.7, Livewire 4.3, Pest 4.7, Larastan 3.10, Pint 1.29. Ambiente local: PHP 8.5.8, Composer 2.9.5, Node 22, Docker 29 + Compose v5.3.
|
||||||
|
|
||||||
|
ADRs ADR-001..ADR-010 do SPEC §21 são aceitas e serão registradas em `docs/adr/` sem reabertura de decisões.
|
||||||
|
|
||||||
|
## Goals / Non-Goals
|
||||||
|
|
||||||
|
**Goals:**
|
||||||
|
|
||||||
|
- Entregar esqueleto Laravel funcional com Filament autenticado, Livewire/Tailwind configurados e Postgres local.
|
||||||
|
- Estabelecer gates de qualidade (Pint, Larastan, Pest, arch tests) e scripts Composer padronizados.
|
||||||
|
- Produzir imagem Docker FrankenPHP reproduzível com healthcheck e processos web/queue/scheduler.
|
||||||
|
- CI verde nos 5 jobs bloqueantes antes de avançar para Fase 1.
|
||||||
|
- Design tokens mínimos e layout público placeholder para validar pipeline visual futuro.
|
||||||
|
|
||||||
|
**Non-Goals:**
|
||||||
|
|
||||||
|
- Implementar requisitos funcionais das Fases 1–5 (site, CRM, eventos, financeiro, documentos).
|
||||||
|
- Deploy em staging ou produção (adiado).
|
||||||
|
- FrankenPHP worker mode, Redis, S3 em produção, integração de e-mail transacional.
|
||||||
|
- Qualquer item listado em SPEC §4.2 "Fora do MVP".
|
||||||
|
|
||||||
|
## Decisions
|
||||||
|
|
||||||
|
### 1. Bootstrap via `composer create-project` em diretório temporário
|
||||||
|
|
||||||
|
**Decisão:** Instalar Laravel 13 com `composer create-project laravel/laravel` em diretório temporário e mover arquivos para a raiz, preservando `SPEC.md`, `openspec/` e `.codex/`.
|
||||||
|
|
||||||
|
**Alternativas:** Instalar na raiz (conflita com arquivos existentes); copiar skeleton manualmente (mais erro-prone).
|
||||||
|
|
||||||
|
**Rationale:** Padrão Laravel garante estrutura correta; evita sobrescrever artefatos de spec.
|
||||||
|
|
||||||
|
### 2. PostgreSQL 17 via Docker Compose local
|
||||||
|
|
||||||
|
**Decisão:** Serviço `postgres:17` no Compose com volume nomeado, healthcheck e credenciais em `.env.example`.
|
||||||
|
|
||||||
|
**Alternativas:** SQLite local (proibido pelo SPEC §14.2 para integração); Postgres instalado no host (sem `psql` no ambiente).
|
||||||
|
|
||||||
|
**Rationale:** Alinha dev local com CI; evita diferenças SQLite/Postgres.
|
||||||
|
|
||||||
|
### 3. Sessão, cache e fila em `database`
|
||||||
|
|
||||||
|
**Decisão:** `SESSION_DRIVER=database`, `CACHE_STORE=database`, `QUEUE_CONNECTION=database`.
|
||||||
|
|
||||||
|
**Alternativas:** Redis (fora do MVP, ADR-008); file/cookie session (menos alinhado com deploy containerizado).
|
||||||
|
|
||||||
|
**Rationale:** ADR-008; sem dependência extra; migrations padrão Laravel cobrem tabelas.
|
||||||
|
|
||||||
|
### 4. Papéis via enum `UserRole` na coluna `users.role`
|
||||||
|
|
||||||
|
**Decisão:** Enum PHP `UserRole: admin|assistant` + coluna `is_active` boolean. Filament `canAccessPanel()` nega inativos.
|
||||||
|
|
||||||
|
**Alternativas:** Spatie Permission (proibido pelo SPEC §3.4); flags booleanas separadas.
|
||||||
|
|
||||||
|
**Rationale:** YAGNI; atende ADM-01 e §12.2 sem complexidade.
|
||||||
|
|
||||||
|
### 5. Design tokens como CSS custom properties + Tailwind theme extension
|
||||||
|
|
||||||
|
**Decisão:** Arquivo `resources/css/tokens.css` com custom properties; `tailwind.config.js` referencia tokens via `theme.extend`.
|
||||||
|
|
||||||
|
**Alternativas:** SCSS variables espalhadas; JSON tokens com build step extra.
|
||||||
|
|
||||||
|
**Rationale:** Centraliza SPEC §6.3; Tailwind consome nativamente; sem dependência extra.
|
||||||
|
|
||||||
|
### 6. Isolamento visual: layout público separado do painel Filament
|
||||||
|
|
||||||
|
**Decisão:** Layout Blade público em `resources/views/layouts/public.blade.php` com tokens próprios; Filament usa tema padrão do painel.
|
||||||
|
|
||||||
|
**Alternativas:** Tema Filament customizado para site (mistura concerns); component library compartilhada prematura.
|
||||||
|
|
||||||
|
**Rationale:** Mitiga conflito Tailwind 4 / Filament 5 / tema público premium.
|
||||||
|
|
||||||
|
### 7. FrankenPHP regular mode, multi-stage Dockerfile
|
||||||
|
|
||||||
|
**Decisão:** Dockerfile com stages `composer`, `frontend`, `runtime` (FrankenPHP). PHP fixado conforme suporte Laravel 13 no momento da instalação (8.4 ou 8.5). `config:cache` apenas no entrypoint/deploy, nunca em stage sem env final.
|
||||||
|
|
||||||
|
**Alternativas:** Nginx + PHP-FPM (SPEC exige FrankenPHP); worker mode (ADR-006 proíbe no MVP).
|
||||||
|
|
||||||
|
**Rationale:** ADR-006; imagem única para web/queue/scheduler (§15.2).
|
||||||
|
|
||||||
|
### 8. CI em GitHub Actions com PostgreSQL service container
|
||||||
|
|
||||||
|
**Decisão:** Workflow `.github/workflows/ci.yml` com jobs `static`, `unit`, `feature`, `browser`, `container`. Feature tests usam Postgres service; browser job builda imagem e roda Pest Browser com locale `pt-BR`, TZ `America/Fortaleza`, animações desabilitadas.
|
||||||
|
|
||||||
|
**Alternativas:** GitLab CI; CircleCI (remote já é GitHub).
|
||||||
|
|
||||||
|
**Rationale:** Remote `manoel-freitas/amore-site`; SPEC §14.1.
|
||||||
|
|
||||||
|
### 9. Estrutura de diretórios modular preparada, não populada
|
||||||
|
|
||||||
|
**Decisão:** Criar apenas diretórios quando primeiro arquivo for adicionado (SPEC §9.4). Na Fase 0, garantir `tests/Architecture/` e namespace base; não criar `app/Application/`, `app/Domain/` vazios.
|
||||||
|
|
||||||
|
**Rationale:** YAGNI; arch tests validam boundary quando Domain existir na Fase 2+.
|
||||||
|
|
||||||
|
## Risks / Trade-offs
|
||||||
|
|
||||||
|
| Risco | Mitigação |
|
||||||
|
|---|---|
|
||||||
|
| Conflito Tailwind 4 + Filament 5 + tema público | Layouts separados; Vite entries distintos se necessário |
|
||||||
|
| Snapshots visuais instáveis no CI | Imagem Linux fixa, fontes instaladas, relógio congelado, seed determinístico (preparação na Fase 1) |
|
||||||
|
| `config:cache` congela env incorreto | Cache apenas no entrypoint com env final do deploy |
|
||||||
|
| PHP 8.5 muito novo para alguma extensão | Fixar versão PHP no Dockerfile conforme matriz Laravel 13; testar build no job `container` |
|
||||||
|
| Filament panel + Livewire 4 coexistência | Seguir docs oficiais de instalação Filament 5; testes feature de login |
|
||||||
|
|
||||||
|
## Migration Plan
|
||||||
|
|
||||||
|
1. Bootstrap Laravel em diretório temp → mover para raiz.
|
||||||
|
2. Configurar `.env` / `.env.example` com Postgres e locale.
|
||||||
|
3. Instalar Filament, Pest, Larastan, Pint; configurar scripts Composer.
|
||||||
|
4. Adicionar Compose, Dockerfile, CI workflow.
|
||||||
|
5. Seed admin local; documentar credenciais apenas para dev.
|
||||||
|
6. Validar `composer quality` e jobs CI no PR.
|
||||||
|
|
||||||
|
**Rollback:** Reverter commit da Fase 0; repo volta ao estado spec-only.
|
||||||
|
|
||||||
|
## Open Questions
|
||||||
|
|
||||||
|
- **Staging target:** VPS próprio, Fly.io, Render ou Railway — decisão adiada; change futura para deploy.
|
||||||
|
- **Registry de imagem:** GitHub Container Registry vs Docker Hub — definir na change de deploy.
|
||||||
|
- **Provedor S3-compatible:** necessário na Fase 1+ para mídia pública; local usa `storage/app/public` ou MinIO opcional no Compose.
|
||||||
|
- **Provedor de e-mail:** necessário na Fase 2 (notificação de leads); Fase 0 usa `log` driver ou Mailpit no Compose opcional.
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
## Why
|
||||||
|
|
||||||
|
O repositório contém apenas a especificação normativa ([SPEC.md](../../SPEC.md)) e o scaffold OpenSpec, sem aplicação Laravel executável. Nenhuma fase funcional (site, CRM, eventos, financeiro) pode ser implementada com segurança sem esqueleto de projeto, gates de qualidade e imagem de contêiner reproduzível. A Fase 0 — Fundação (SPEC §18) é o pré-requisito obrigatório para validar o produto.
|
||||||
|
|
||||||
|
## What Changes
|
||||||
|
|
||||||
|
- Bootstrap de aplicação **Laravel 13** com **Filament 5** (`/admin`), **Livewire 4**, **Tailwind/Vite** e locale `pt-BR` / timezone `America/Fortaleza`.
|
||||||
|
- **PostgreSQL** local via Docker Compose; sessão, cache e fila em `database` (ADR-008).
|
||||||
|
- Papéis internos `admin` e `assistant` via enum `UserRole` (SPEC §3.4, ADM-01); usuário inativo bloqueado no painel.
|
||||||
|
- Ferramentas de qualidade: **Pint**, **Larastan**, **Pest 4**, **Pest Browser**, testes de arquitetura (SPEC §13.6).
|
||||||
|
- Scripts Composer padronizados: `test:unit`, `test:feature`, `test:browser`, `test`, `quality` (SPEC §13.9).
|
||||||
|
- **Dockerfile** multi-stage com **FrankenPHP** em modo regular (ADR-006); processos web, queue e scheduler na mesma imagem.
|
||||||
|
- Rota pública **`GET /up`** para healthcheck (SPEC §5.1, §15.5).
|
||||||
|
- **Design tokens** mínimos centralizados para o site público (SPEC §6.3).
|
||||||
|
- **Seed de admin** local documentado (SPEC §17.2 parcial — apenas usuário admin).
|
||||||
|
- **Pipeline CI** com jobs bloqueantes: `static`, `unit`, `feature`, `browser`, `container` (SPEC §14.1).
|
||||||
|
- Índice de **ADRs aceitas** (ADR-001..ADR-010) em `docs/adr/`.
|
||||||
|
|
||||||
|
## Non-Goals
|
||||||
|
|
||||||
|
Conforme [SPEC.md §4.2](../../SPEC.md), **não** fazem parte desta change:
|
||||||
|
|
||||||
|
- Site público, CMS, briefing, CRM, eventos, fornecedores, financeiro, documentos, dashboard operacional.
|
||||||
|
- Deploy em staging ou produção (adiado; critério de saída limitado a CI verde + build de imagem + healthcheck validado no contêiner).
|
||||||
|
- Microserviços, Redis, API pública, multi-tenancy, pagamentos online, portal do cliente.
|
||||||
|
- FrankenPHP worker mode (ADR-006).
|
||||||
|
|
||||||
|
## Capabilities
|
||||||
|
|
||||||
|
### New Capabilities
|
||||||
|
|
||||||
|
- `internal-authentication`: login no painel Filament, papéis `admin`/`assistant`, bloqueio de usuário inativo, reset de senha (SPEC §3.4, ADM-01, §12.1–12.2).
|
||||||
|
- `health-check`: endpoint `GET /up` sem autenticação para verificação de disponibilidade (SPEC §5.1, §15.5).
|
||||||
|
- `design-tokens`: tokens visuais centralizados para o site público (SPEC §6.3, §6.5).
|
||||||
|
- `quality-gates`: comandos Composer, testes de arquitetura e pipeline CI bloqueante (SPEC §13.6, §13.9, §14.1–14.2).
|
||||||
|
- `container-runtime`: imagem Docker multi-stage FrankenPHP com processos web/queue/scheduler (SPEC §15.1–15.4).
|
||||||
|
|
||||||
|
### Modified Capabilities
|
||||||
|
|
||||||
|
- _(nenhuma — repositório sem specs existentes em `openspec/specs/`)_
|
||||||
|
|
||||||
|
## Impact
|
||||||
|
|
||||||
|
- **Cria**: árvore Laravel completa (`app/`, `config/`, `database/`, `resources/`, `routes/`, `tests/`), `docker/`, `Dockerfile`, `docker-compose.yml`, `.github/workflows/`, `docs/adr/`.
|
||||||
|
- **Dependências novas**: Laravel 13, Filament 5, Livewire 4, Pest 4, Larastan, Pint, FrankenPHP.
|
||||||
|
- **Infraestrutura**: PostgreSQL em Compose local; CI em GitHub Actions contra o remote `manoel-freitas/amore-site`.
|
||||||
|
- **Sem impacto** em capabilities existentes (greenfield).
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Production image uses multi-stage FrankenPHP build
|
||||||
|
|
||||||
|
The system SHALL provide a multi-stage Dockerfile that builds Composer dependencies, frontend assets, and a FrankenPHP runtime image serving `public/`.
|
||||||
|
|
||||||
|
#### Scenario: Image builds reproducibly in CI
|
||||||
|
|
||||||
|
- **WHEN** the `container` CI job builds the Docker image from a clean checkout
|
||||||
|
- **THEN** the build completes successfully and produces a runnable image
|
||||||
|
|
||||||
|
### Requirement: FrankenPHP runs in regular mode only
|
||||||
|
|
||||||
|
The system MUST NOT enable FrankenPHP worker mode in the MVP. The runtime SHALL use FrankenPHP in regular mode (ADR-006).
|
||||||
|
|
||||||
|
#### Scenario: Runtime configuration is regular mode
|
||||||
|
|
||||||
|
- **WHEN** the production image starts the web process
|
||||||
|
- **THEN** FrankenPHP serves requests in regular mode without worker persistence
|
||||||
|
|
||||||
|
### Requirement: Runtime image runs as non-root when supported
|
||||||
|
|
||||||
|
The system SHALL configure the production runtime to run as a non-root user when the base image supports it.
|
||||||
|
|
||||||
|
#### Scenario: Container process is non-root
|
||||||
|
|
||||||
|
- **WHEN** the web container is running in production configuration
|
||||||
|
- **THEN** the primary process MUST NOT run as root
|
||||||
|
|
||||||
|
### Requirement: Same image supports web queue and scheduler processes
|
||||||
|
|
||||||
|
The system SHALL use the same application image for web, queue worker, and scheduler processes with distinct commands (SPEC §15.2).
|
||||||
|
|
||||||
|
#### Scenario: Queue worker starts from application image
|
||||||
|
|
||||||
|
- **WHEN** the queue process is started with `php artisan queue:work`
|
||||||
|
- **THEN** it uses the same built image as the web process
|
||||||
|
|
||||||
|
### Requirement: Production image contains no secrets in layers
|
||||||
|
|
||||||
|
The system MUST NOT embed secrets, credentials, or private keys in Docker image layers.
|
||||||
|
|
||||||
|
#### Scenario: Image inspection finds no embedded secrets
|
||||||
|
|
||||||
|
- **WHEN** the image is built in CI
|
||||||
|
- **THEN** build arguments and layers MUST NOT contain production secrets or `.env` values
|
||||||
|
|
||||||
|
### Requirement: Container healthcheck validates application availability
|
||||||
|
|
||||||
|
The system SHALL define a container healthcheck that verifies application availability via the `/up` endpoint or equivalent boot check.
|
||||||
|
|
||||||
|
#### Scenario: Unhealthy container is detected
|
||||||
|
|
||||||
|
- **WHEN** the application inside the container fails to respond healthy on `/up`
|
||||||
|
- **THEN** the container healthcheck MUST report unhealthy status
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Design tokens are centralized for the public site
|
||||||
|
|
||||||
|
The system SHALL define minimum design tokens in a single source consumed by the public site layout and components. Tokens MUST cover typography families, font scale, spacing, border radius, container width, background/text/border/accent/state colors, shadows, and transition duration/easing.
|
||||||
|
|
||||||
|
#### Scenario: Public layout uses shared tokens
|
||||||
|
|
||||||
|
- **WHEN** a public page is rendered
|
||||||
|
- **THEN** visual properties MUST be derived from the centralized token definitions rather than arbitrary inline values
|
||||||
|
|
||||||
|
### Requirement: Public site respects reduced motion preference
|
||||||
|
|
||||||
|
The system SHALL honor `prefers-reduced-motion` by disabling or minimizing non-essential animations and transitions on the public site.
|
||||||
|
|
||||||
|
#### Scenario: User prefers reduced motion
|
||||||
|
|
||||||
|
- **WHEN** a visitor has `prefers-reduced-motion: reduce` enabled
|
||||||
|
- **THEN** the public site MUST NOT play non-essential motion effects
|
||||||
|
|
||||||
|
### Requirement: Public site meets baseline accessibility contrast
|
||||||
|
|
||||||
|
The system SHALL use color combinations on the public site that meet WCAG AA contrast requirements for text and interactive elements defined in the token palette.
|
||||||
|
|
||||||
|
#### Scenario: Primary text is readable
|
||||||
|
|
||||||
|
- **WHEN** primary body text is rendered on its background color
|
||||||
|
- **THEN** the contrast ratio MUST meet WCAG AA minimums
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Public health endpoint responds without authentication
|
||||||
|
|
||||||
|
The system SHALL expose `GET /up` as a public healthcheck endpoint that does not require authentication.
|
||||||
|
|
||||||
|
#### Scenario: Application is healthy
|
||||||
|
|
||||||
|
- **WHEN** a client sends `GET /up` while the application is running normally
|
||||||
|
- **THEN** the system responds with HTTP 200 in a timely manner
|
||||||
|
|
||||||
|
#### Scenario: Health endpoint exposes no secrets
|
||||||
|
|
||||||
|
- **WHEN** a client sends `GET /up`
|
||||||
|
- **THEN** the response MUST NOT include credentials, tokens, stack traces, or environment secrets
|
||||||
|
|
||||||
|
### Requirement: Health endpoint reflects application failure
|
||||||
|
|
||||||
|
The system SHALL return a failure status when the application cannot initialize properly.
|
||||||
|
|
||||||
|
#### Scenario: Application cannot boot
|
||||||
|
|
||||||
|
- **WHEN** the application fails to boot due to misconfiguration or missing dependencies
|
||||||
|
- **THEN** the health endpoint MUST NOT return HTTP 200
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Internal users authenticate via Filament panel
|
||||||
|
|
||||||
|
The system SHALL provide authenticated access to the internal panel at `/admin` using Laravel's session-based authentication integrated with Filament 5.
|
||||||
|
|
||||||
|
#### Scenario: Active admin logs in successfully
|
||||||
|
|
||||||
|
- **WHEN** an active user with role `admin` submits valid credentials on the login page
|
||||||
|
- **THEN** the system authenticates the user and redirects to the Filament dashboard
|
||||||
|
|
||||||
|
#### Scenario: Active assistant logs in successfully
|
||||||
|
|
||||||
|
- **WHEN** an active user with role `assistant` submits valid credentials on the login page
|
||||||
|
- **THEN** the system authenticates the user and redirects to the Filament dashboard
|
||||||
|
|
||||||
|
#### Scenario: Inactive user is denied panel access
|
||||||
|
|
||||||
|
- **WHEN** a user with `is_active` set to false submits valid credentials
|
||||||
|
- **THEN** the system MUST NOT grant access to the Filament panel
|
||||||
|
|
||||||
|
### Requirement: User roles are limited to admin and assistant
|
||||||
|
|
||||||
|
The system SHALL store user roles using the `UserRole` enum with exactly two cases: `admin` and `assistant`. The system MUST NOT implement a granular permission system in the MVP.
|
||||||
|
|
||||||
|
#### Scenario: User is created with a valid role
|
||||||
|
|
||||||
|
- **WHEN** an administrator creates a user with role `admin` or `assistant`
|
||||||
|
- **THEN** the role is persisted and enforced on subsequent authorization checks
|
||||||
|
|
||||||
|
### Requirement: Email addresses are unique per user
|
||||||
|
|
||||||
|
The system SHALL enforce a unique constraint on user email addresses.
|
||||||
|
|
||||||
|
#### Scenario: Duplicate email rejected
|
||||||
|
|
||||||
|
- **WHEN** a user is created or updated with an email already assigned to another user
|
||||||
|
- **THEN** the system MUST reject the operation with a validation error
|
||||||
|
|
||||||
|
### Requirement: Password reset is available for internal users
|
||||||
|
|
||||||
|
The system SHALL support secure password reset for internal users using Laravel's built-in reset flow.
|
||||||
|
|
||||||
|
#### Scenario: User requests password reset
|
||||||
|
|
||||||
|
- **WHEN** a user submits a registered email on the password reset form
|
||||||
|
- **THEN** the system sends a reset link without revealing whether the email exists
|
||||||
|
|
||||||
|
### Requirement: Only admin manages internal users
|
||||||
|
|
||||||
|
The system SHALL restrict user management (create, update, deactivate) to users with role `admin`. Users with role `assistant` MUST NOT manage other users.
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot access user management
|
||||||
|
|
||||||
|
- **WHEN** an authenticated assistant attempts to access user management in the panel
|
||||||
|
- **THEN** the system MUST deny access via authorization policy
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Standardized Composer test scripts exist
|
||||||
|
|
||||||
|
The system SHALL expose Composer scripts equivalent to `test:unit`, `test:feature`, `test:browser`, `test`, and `quality` with the composition defined in SPEC §13.9.
|
||||||
|
|
||||||
|
#### Scenario: Developer runs full quality gate locally
|
||||||
|
|
||||||
|
- **WHEN** a developer runs `composer quality`
|
||||||
|
- **THEN** the command executes static analysis, audits, and the applicable test suites
|
||||||
|
|
||||||
|
### Requirement: Architecture tests enforce domain boundaries
|
||||||
|
|
||||||
|
The system SHALL include Pest architecture tests that verify `App\Domain` uses strict types and does not depend on `App\Filament` or `App\Livewire`.
|
||||||
|
|
||||||
|
#### Scenario: Domain layer violates boundary
|
||||||
|
|
||||||
|
- **WHEN** code in `App\Domain` imports from `App\Filament` or `App\Livewire`
|
||||||
|
- **THEN** the architecture test suite MUST fail
|
||||||
|
|
||||||
|
### Requirement: CI pipeline blocks merge on five jobs
|
||||||
|
|
||||||
|
The system SHALL run a CI pipeline with blocking jobs named `static`, `unit`, `feature`, `browser`, and `container` as defined in SPEC §14.1.
|
||||||
|
|
||||||
|
#### Scenario: Static analysis fails on pull request
|
||||||
|
|
||||||
|
- **WHEN** a pull request introduces a Pint, PHPStan/Larastan, or Composer audit failure
|
||||||
|
- **THEN** the `static` job MUST fail and block merge
|
||||||
|
|
||||||
|
#### Scenario: Feature tests use PostgreSQL
|
||||||
|
|
||||||
|
- **WHEN** the `feature` CI job runs integration tests
|
||||||
|
- **THEN** the job MUST use PostgreSQL and MUST NOT substitute SQLite
|
||||||
|
|
||||||
|
### Requirement: Browser tests run against FrankenPHP-served application
|
||||||
|
|
||||||
|
The system SHALL execute browser tests using Pest Browser/Playwright against an application served by FrankenPHP in CI.
|
||||||
|
|
||||||
|
#### Scenario: Browser job validates served application
|
||||||
|
|
||||||
|
- **WHEN** the `browser` CI job runs
|
||||||
|
- **THEN** tests execute against the built application artifact or equivalent production-like image
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
## 1. Bootstrap do projeto
|
||||||
|
|
||||||
|
- [x] 1.1 Criar app Laravel 13 via `composer create-project` em diretório temporário e mover para raiz preservando `SPEC.md`, `openspec/` e `.codex/`
|
||||||
|
- [x] 1.2 Configurar `.env` e `.env.example` com `APP_LOCALE=pt_BR`, `APP_TIMEZONE=America/Fortaleza`, `DB_CONNECTION=pgsql`
|
||||||
|
- [x] 1.3 Adicionar `declare(strict_types=1);` como convenção documentada e habilitar strict types nos arquivos PHP criados nesta fase
|
||||||
|
- [x] 1.4 Criar índice de ADRs aceitas em `docs/adr/` referenciando ADR-001..ADR-010 do SPEC §21
|
||||||
|
|
||||||
|
## 2. Banco de dados e Docker Compose local
|
||||||
|
|
||||||
|
- [x] 2.1 Adicionar `docker-compose.yml` com serviço PostgreSQL 17, volume nomeado e healthcheck
|
||||||
|
- [x] 2.2 Configurar conexão PostgreSQL no Laravel e validar `php artisan migrate` em banco limpo
|
||||||
|
- [x] 2.3 Configurar `SESSION_DRIVER=database`, `CACHE_STORE=database`, `QUEUE_CONNECTION=database`
|
||||||
|
- [x] 2.4 Documentar comandos locais (`docker compose up`, `artisan migrate`) no README
|
||||||
|
|
||||||
|
## 3. Filament, autenticação e papéis
|
||||||
|
|
||||||
|
- [x] 3.1 Instalar Filament 5 com painel em `/admin` e autenticação habilitada
|
||||||
|
- [x] 3.2 Criar migration adicionando `role` (varchar indexed) e `is_active` (boolean default true) em `users`
|
||||||
|
- [x] 3.3 Implementar enum `UserRole` (`admin`, `assistant`) e integrar ao model `User`
|
||||||
|
- [x] 3.4 Implementar `canAccessPanel()` negando usuários inativos
|
||||||
|
- [x] 3.5 Criar `UserResource` restrito a admin via Policy
|
||||||
|
- [x] 3.6 Criar `DatabaseSeeder` com usuário admin local (credenciais documentadas apenas para dev)
|
||||||
|
- [x] 3.7 Escrever feature tests: login admin, login assistant, bloqueio de inativo, assistant sem acesso a usuários
|
||||||
|
|
||||||
|
## 4. Livewire, Tailwind, Vite e design tokens
|
||||||
|
|
||||||
|
- [x] 4.1 Instalar Livewire 4 e configurar Vite + Tailwind para site público
|
||||||
|
- [x] 4.2 Criar `resources/css/tokens.css` com custom properties (tipografia, escala, espaçamento, raio, container, cores, sombras, transições)
|
||||||
|
- [x] 4.3 Estender `tailwind.config.js` para consumir tokens centralizados
|
||||||
|
- [x] 4.4 Criar layout público mínimo (`resources/views/layouts/public.blade.php`) com `prefers-reduced-motion` e contraste AA
|
||||||
|
- [x] 4.5 Criar rota `/` com página placeholder usando layout público e tokens
|
||||||
|
- [x] 4.6 Escrever teste feature validando renderização da home sem erro
|
||||||
|
|
||||||
|
## 5. Healthcheck
|
||||||
|
|
||||||
|
- [x] 5.1 Garantir rota `GET /up` respondendo HTTP 200 sem autenticação
|
||||||
|
- [x] 5.2 Validar que resposta não expõe segredos ou stack traces
|
||||||
|
- [x] 5.3 Escrever feature test para endpoint `/up`
|
||||||
|
|
||||||
|
## 6. Qualidade: Pint, Larastan, Pest, arch tests e scripts Composer
|
||||||
|
|
||||||
|
- [x] 6.1 Instalar e configurar Laravel Pint com script `composer pint` / check no CI
|
||||||
|
- [x] 6.2 Instalar Larastan/PHPStan com nível definido e script no CI job `static`
|
||||||
|
- [x] 6.3 Instalar Pest 4 e Pest Browser; configurar `phpunit.xml` / `Pest.php`
|
||||||
|
- [x] 6.4 Criar testes de arquitetura: `App\Domain` strict types, sem dependência de Filament/Livewire
|
||||||
|
- [x] 6.5 Adicionar scripts Composer: `test:unit`, `test:feature`, `test:browser`, `test`, `quality` conforme SPEC §13.9
|
||||||
|
- [x] 6.6 Configurar `composer audit` no job `static`
|
||||||
|
|
||||||
|
## 7. Docker multi-stage FrankenPHP
|
||||||
|
|
||||||
|
- [x] 7.1 Criar Dockerfile multi-stage (composer → frontend → runtime FrankenPHP regular mode)
|
||||||
|
- [x] 7.2 Fixar versão PHP compatível com Laravel 13; usuário non-root quando suportado
|
||||||
|
- [x] 7.3 Definir comandos para processos web, queue (`queue:work`) e scheduler (`schedule:work`)
|
||||||
|
- [x] 7.4 Adicionar healthcheck do contêiner apontando para `/up`
|
||||||
|
- [x] 7.5 Garantir que nenhum secret ou `.env` de produção entra em layer da imagem
|
||||||
|
- [x] 7.6 Validar build local e no CI
|
||||||
|
|
||||||
|
## 8. CI GitHub Actions
|
||||||
|
|
||||||
|
- [x] 8.1 Criar workflow `.github/workflows/ci.yml` com jobs `static`, `unit`, `feature`, `browser`, `container`
|
||||||
|
- [x] 8.2 Job `feature`: PostgreSQL service container (nunca SQLite)
|
||||||
|
- [x] 8.3 Job `browser`: build de imagem, servir via FrankenPHP, rodar Pest Browser com locale `pt_BR` e TZ `America/Fortaleza`
|
||||||
|
- [x] 8.4 Job `container`: build da imagem final + healthcheck
|
||||||
|
- [x] 8.5 Configurar cache seguro de Composer e npm nos jobs
|
||||||
|
|
||||||
|
## 9. Verificação final e critério de saída
|
||||||
|
|
||||||
|
- [x] 9.1 Executar `composer quality` localmente e corrigir falhas
|
||||||
|
- [x] 9.2 Executar `composer test:browser` (smoke mínimo: home + login)
|
||||||
|
- [x] 9.3 Confirmar critério de saída da Fase 0: pipeline CI verde + build de imagem + healthcheck validado no contêiner
|
||||||
|
- [x] 9.4 Reportar conclusão no formato SPEC §24 (requisito, alterações, testes, comandos, aceite, pendências)
|
||||||
2
openspec/changes/build-public-site/.openspec.yaml
Normal file
2
openspec/changes/build-public-site/.openspec.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
schema: spec-driven
|
||||||
|
created: 2026-07-29
|
||||||
108
openspec/changes/build-public-site/design.md
Normal file
108
openspec/changes/build-public-site/design.md
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
## Context
|
||||||
|
|
||||||
|
O repositório está no fim da Fase 1: CMS completo no Filament (`site_settings`, `services`, `portfolio_cases`, `portfolio_images`, `testimonials`), Policies admin-only, factories, `ContentSeeder` e testes feature. O site público, porém, ainda é o placeholder da Fase 0: `routes/web.php` tem apenas `Route::view('/', 'pages.home')`, o layout `resources/views/layouts/public.blade.php` só emite `@yield('title')`, não existe `app/Application/`, não existem componentes Blade de conteúdo, nem snapshots visuais, nem testes de acessibilidade.
|
||||||
|
|
||||||
|
Restrições relevantes já materializadas no repositório e que condicionam o desenho:
|
||||||
|
|
||||||
|
- Runtime é `dunglas/frankenphp:1-php8.4-bookworm` **sem extensão `gd`/`imagick`** e **sem fontes instaladas**.
|
||||||
|
- `docker/entrypoint.sh` faz apenas `config:cache`, `route:cache`, `view:cache`; **não executa `storage:link`**, então o disco `public` não é servido pelo contêiner.
|
||||||
|
- O job `browser` do CI sobe o contêiner apontando para o mesmo PostgreSQL do runner, roda `php artisan migrate --force` no host e **não executa seed** — hoje as páginas testadas não dependem de conteúdo.
|
||||||
|
- `PublicImageUploadRules` grava um único arquivo por upload, com nome UUID, no disco `public` (ou `s3` quando padrão).
|
||||||
|
- Tailwind 4 sem `tailwind.config.js`; tokens em `resources/css/tokens.css` mapeados por `@theme` em `app.css`, com bloco `prefers-reduced-motion` já presente.
|
||||||
|
|
||||||
|
## Goals / Non-Goals
|
||||||
|
|
||||||
|
**Goals:**
|
||||||
|
|
||||||
|
- Entregar as rotas públicas do SPEC §5.1 que faltam, renderizando somente conteúdo publicado.
|
||||||
|
- Home editorial dirigida por `site_settings` e conteúdo publicado, na ordem do SPEC §6.2.
|
||||||
|
- SEO renderizado por página (title, description, canonical, Open Graph, JSON-LD), `sitemap.xml` e `robots.txt` por rota.
|
||||||
|
- Mídia responsiva com variantes, `srcset`, lazy loading e dimensões reservadas.
|
||||||
|
- Regressão visual determinística e verificação automatizada de acessibilidade nas rotas públicas, plugadas no gate `browser`.
|
||||||
|
|
||||||
|
**Non-Goals:**
|
||||||
|
|
||||||
|
- Briefing/lead (WEB-05, Fase 2), page builder, busca no site, i18n, PWA.
|
||||||
|
- CDN, cache HTTP/edge, otimização além do necessário para as metas do SPEC §6.6.
|
||||||
|
- Refatorar o CMS existente além do hook de variantes de imagem.
|
||||||
|
|
||||||
|
## Decisions
|
||||||
|
|
||||||
|
### D1 — Páginas públicas em Blade + controllers finos, sem Livewire
|
||||||
|
|
||||||
|
Rotas apontam para controllers em `app/Http/Controllers/PublicSite/` (`HomeController`, `ServiceController`, `PortfolioController`, `PageController`, `SitemapController`, `RobotsController`). Nenhuma seção pública tem estado ou interação, e o SPEC §11.1 é explícito em não transformar seção estática em componente Livewire.
|
||||||
|
|
||||||
|
*Alternativas:* componentes Livewire full-page (rejeitado: overhead sem estado, prejudica cache de view e snapshots); rotas `Route::view` (rejeitado: precisam de dados e de metadados de SEO).
|
||||||
|
|
||||||
|
### D2 — Leitura via Queries finas na camada Application
|
||||||
|
|
||||||
|
`app/Application/Queries/Marketing/`: `GetHomeContent`, `GetPublishedServices`, `GetPublishedPortfolioCases`, `FindPublishedPortfolioCaseBySlug`, `GetSitemapEntries`. Usam Eloquent direto com `published()` + eager loading explícito, conforme SPEC §9.3 e §9.6. Sem repositórios genéricos, sem Actions (não há escrita nesta change).
|
||||||
|
|
||||||
|
`GetHomeContent` retorna um DTO readonly (`app/Application/Data/HomeContent.php`) para o controller não montar array solto.
|
||||||
|
|
||||||
|
*Alternativa:* consultar Models direto na view (rejeitado: N+1 e regra de publicação espalhada).
|
||||||
|
|
||||||
|
### D3 — SEO por DTO + partial único no layout
|
||||||
|
|
||||||
|
Cada controller monta `App\Application\Data\PageMeta` (title, description, canonical, ogType, ogImageUrl, ogImageAlt, jsonLd) com fallback para `site_settings`. O layout renderiza um partial `components/seo/meta.blade.php`. A escolha de fallback fica em um único lugar (`PageMeta::forPage()` / `::forCase()`), testável em unit test sem banco.
|
||||||
|
|
||||||
|
*Alternativa:* pacote de SEO (rejeitado: dependência desnecessária para 7 rotas); `@section('meta')` por página (rejeitado: duplicação e fallback inconsistente).
|
||||||
|
|
||||||
|
### D4 — Sitemap e robots por rota, sem pacote
|
||||||
|
|
||||||
|
`/sitemap.xml` retorna uma view Blade XML com `Content-Type: application/xml`, alimentada por `GetSitemapEntries` (rotas estáticas + slugs publicados com `updated_at`). `/robots.txt` vira rota `text/plain` referenciando o sitemap absoluto; o arquivo estático `public/robots.txt` é removido para não sombrear a rota no Caddy.
|
||||||
|
|
||||||
|
### D5 — Variantes responsivas geradas no upload, nomeadas por convenção
|
||||||
|
|
||||||
|
Novo `App\Support\ResponsiveImage`:
|
||||||
|
|
||||||
|
- Larguras fixas: 480, 960, 1440. Formato mantido (jpeg/png/webp), qualidade fixa.
|
||||||
|
- Nome derivado do original: `<uuid>.jpg` → `<uuid>-480.jpg`, `<uuid>-960.jpg`, `<uuid>-1440.jpg`, sem coluna nova no banco.
|
||||||
|
- Geração síncrona no hook `saveUploadedFileUsing` das FileUploads de `PublicImageUploadRules`, portanto vale para todos os Resources do CMS sem duplicação.
|
||||||
|
- Componente Blade `<x-media.image>` monta `srcset`/`sizes`, `width`/`height`, `alt` e `loading` (eager só no hero).
|
||||||
|
- Comando `php artisan media:generate-variants` para backfill de imagens já existentes e para o seed.
|
||||||
|
|
||||||
|
Requer extensão **`gd`** no `Dockerfile`, no CI e no ambiente local, e a dependência `intervention/image` (v3, driver GD).
|
||||||
|
|
||||||
|
*Alternativas:* coluna `jsonb` com variantes (rejeitado: migração e sincronização de estado por um dado derivável do nome); resize on-the-fly por rota (rejeitado: CPU por request, cache e risco de path traversal); `spatie/laravel-medialibrary` (rejeitado: peso e reescrita do CMS já entregue); checar existência de variante em cada render (rejeitado: `stat`/HEAD por imagem, caro no S3 — por isso a geração é garantida no upload e no backfill).
|
||||||
|
|
||||||
|
### D6 — Determinismo visual: relógio congelado por env, seed dedicado e fontes self-hosted
|
||||||
|
|
||||||
|
- `APP_FROZEN_NOW`: quando definido e `APP_ENV !== 'production'`, um provider chama `CarbonImmutable::setTestNow()`. Isso congela o relógio **do servidor**, que é o processo que renderiza — `travelTo()` no processo de teste não afeta o contêiner FrankenPHP.
|
||||||
|
- `VisualContentSeeder`: conteúdo fixo (textos, datas, ordem, imagens fixture versionadas em `tests/fixtures/images/`), executado no job `browser` antes da suíte.
|
||||||
|
- Fontes **self-hosted** via Vite, sem CDN, e `font-family` sem depender de fonte do sistema — o Chromium do Playwright roda no runner, não na imagem da aplicação, então fonte do sistema seria não determinística.
|
||||||
|
- Animações desabilitadas reutilizando o bloco `prefers-reduced-motion` já existente em `tokens.css`, com o Playwright emulando `reduce`. Sem código condicional de teste na aplicação.
|
||||||
|
|
||||||
|
### D7 — Acessibilidade via axe-core na suíte browser
|
||||||
|
|
||||||
|
Verificação automatizada nas rotas cobertas usando a assertion de acessibilidade do Pest Browser quando disponível; caso contrário, injetar `axe-core` (devDependency npm) na página e falhar em issues `critical`/`serious`. Regras estruturais baratas (um `h1`, landmarks, `alt` presente) ficam também em feature tests de HTML, que rodam sem browser e falham mais cedo.
|
||||||
|
|
||||||
|
### D8 — Infra de suporte: `storage:link` e seed no CI
|
||||||
|
|
||||||
|
- `docker/entrypoint.sh` passa a executar `php artisan storage:link` de forma idempotente, senão as imagens do disco `public` não são servidas pelo contêiner e todo snapshot com imagem falha.
|
||||||
|
- Job `browser` do CI passa a rodar `php artisan db:seed --class=VisualContentSeeder --force` antes dos testes e a publicar screenshots, diffs, logs da aplicação e logs do browser em falha (`if: failure()`).
|
||||||
|
|
||||||
|
### D9 — Páginas de erro
|
||||||
|
|
||||||
|
`resources/views/errors/404.blade.php` e `500.blade.php` usando o layout público. A 500 não recebe dados da exceção; em produção `APP_DEBUG=false` garante o handler genérico. Um feature test força uma exceção em rota de teste para verificar ausência de stack trace.
|
||||||
|
|
||||||
|
## Risks / Trade-offs
|
||||||
|
|
||||||
|
- **Snapshot instável por ambiente de renderização** → fontes self-hosted, viewport fixo, relógio congelado, seed determinístico, `reduce` motion, mesma imagem de aplicação do deploy; baseline só muda por `composer visual:update` com revisão humana.
|
||||||
|
- **`gd` + `intervention/image` aumentam a imagem e o tempo de upload** → três larguras fixas, sem editor de imagem, sem fila; se o upload ficar lento na prática, mover para job em fila é mudança local no hook.
|
||||||
|
- **Variantes órfãs ao trocar/excluir imagem** → remoção das variantes junto do original no mesmo hook; backfill pelo comando artisan quando houver divergência.
|
||||||
|
- **`route:cache` no entrypoint com nova rota `/robots.txt`** → remover o arquivo estático evita que o Caddy sirva o arquivo antes da aplicação; teste feature garante que a rota responde.
|
||||||
|
- **Seed no CI acopla o job `browser` a dados fixos** → seeder dedicado e versionado, separado do `ContentSeeder` de demonstração, para que mudança de demo não quebre snapshot.
|
||||||
|
- **Metas de LCP/CLS não são medidas automaticamente nesta change** → mitigado parcialmente por dimensões reservadas, lazy loading e hero eager; medição formal fica na Fase 5 (performance).
|
||||||
|
|
||||||
|
## Migration Plan
|
||||||
|
|
||||||
|
1. Sem migração de banco: nenhuma coluna nova.
|
||||||
|
2. Deploy exige `gd` na imagem e `storage:link` no entrypoint — ambos entram no mesmo build, validados pelo job `container`.
|
||||||
|
3. Após o deploy, rodar `php artisan media:generate-variants` uma vez para as imagens já enviadas; a renderização usa o original enquanto o backfill não roda.
|
||||||
|
4. Rollback: promover a imagem anterior. Variantes extras no storage ficam inertes e não quebram a versão antiga.
|
||||||
|
|
||||||
|
## Open Questions
|
||||||
|
|
||||||
|
- A API de acessibilidade do Pest Browser 4 cobre axe (`critical`/`serious`) ou será necessário injetar `axe-core` manualmente? Resolver na primeira fatia da suíte browser.
|
||||||
|
- Fonte tipográfica definitiva da marca (arquivo self-hosted) ainda não foi escolhida; até lá, usar a stack de tokens atual e ajustar antes de gravar as baselines.
|
||||||
45
openspec/changes/build-public-site/proposal.md
Normal file
45
openspec/changes/build-public-site/proposal.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
## Why
|
||||||
|
|
||||||
|
O CMS da Fase 1 está concluído (`site-settings`, `service-catalog`, `portfolio-cases`, `testimonials`, `content-media`), mas nenhum conteúdo publicado chega ao visitante: a única rota pública é `/` com um placeholder estático "Em breve". Sem o site público, o critério de saída da Fase 1 ("site público aprovado visualmente") não é atendido, a hipótese de aquisição do SPEC §2.2 não pode ser testada e a Fase 2 (briefing/leads) não tem onde ancorar o CTA.
|
||||||
|
|
||||||
|
## What Changes
|
||||||
|
|
||||||
|
- Implementar as rotas públicas do SPEC §5.1 ainda ausentes: `/servicos`, `/portfolio`, `/portfolio/{slug}`, `/sobre`, `/privacidade`, `/contato` (shell) e `/sitemap.xml`.
|
||||||
|
- Substituir a home placeholder por home editorial dirigida por conteúdo publicado, na ordem do SPEC §6.2 (WEB-01).
|
||||||
|
- Renderizar SEO por página: title, meta description, canonical, Open Graph, dados estruturados básicos, `robots.txt` servido por rota e sitemap com slugs publicados (SPEC §6.6).
|
||||||
|
- Injetar script de analytics apenas quando `analytics_enabled` estiver ativo em `site_settings` (WEB-06).
|
||||||
|
- Entregar mídia responsiva: variantes geradas no upload, `srcset`/`sizes`, `loading="lazy"` fora da primeira dobra e dimensões reservadas contra CLS (SPEC §6.4).
|
||||||
|
- Páginas de erro 404 com identidade visual e 500 sem stack trace em produção (WEB-07).
|
||||||
|
- Adicionar regressão visual determinística desktop/mobile para as telas do SPEC §13.5 já existentes nesta fase e testes automatizados de acessibilidade nas rotas públicas (SPEC §6.5, §13.8).
|
||||||
|
- Elevar o gate `browser` do CI para incluir snapshots visuais e acessibilidade, publicando artefatos diagnósticos em falha.
|
||||||
|
|
||||||
|
## Non-Goals
|
||||||
|
|
||||||
|
Conforme [SPEC.md §4.2](../../SPEC.md) e a divisão de fases:
|
||||||
|
|
||||||
|
- Formulário de briefing (WEB-05) e captura de lead — Fase 2. Esta change entrega apenas a página `/contato` com dados de contato do `site_settings`; o componente Livewire do briefing e as jornadas E2E-01/E2E-02 ficam para `build-lead-capture`.
|
||||||
|
- Snapshots de Briefing, Login, Dashboard e Detalhe do evento (SPEC §13.5) — dependem de telas de fases posteriores.
|
||||||
|
- Page builder, editor visual de páginas, busca no site, i18n, PWA.
|
||||||
|
- Password reset do painel interno (lacuna conhecida de `internal-authentication`, sem relação com o site público).
|
||||||
|
- Auditoria de publicação/despublicação (ADM-02) — Fase 5.
|
||||||
|
|
||||||
|
## Capabilities
|
||||||
|
|
||||||
|
### New Capabilities
|
||||||
|
|
||||||
|
- `public-site-pages`: rotas, layout e páginas públicas que exibem somente conteúdo publicado (WEB-01, WEB-02, WEB-03, WEB-04, WEB-07, SPEC §19).
|
||||||
|
- `public-seo`: metadados por página, canonical, Open Graph, dados estruturados, sitemap, robots e analytics condicional (SPEC §6.6, WEB-06).
|
||||||
|
- `visual-regression`: snapshots determinísticos desktop/mobile das telas públicas (SPEC §13.5).
|
||||||
|
- `web-accessibility`: verificação automatizada de acessibilidade das rotas públicas (SPEC §6.5, §13.8).
|
||||||
|
|
||||||
|
### Modified Capabilities
|
||||||
|
|
||||||
|
- `content-media`: além de validar upload, o sistema MUST gerar/servir variantes responsivas, aplicar lazy loading fora da primeira dobra e reservar dimensões (SPEC §6.4).
|
||||||
|
- `quality-gates`: o gate `browser` MUST executar snapshots visuais e acessibilidade e publicar artefatos diagnósticos em falha (SPEC §13.4, §14.1).
|
||||||
|
|
||||||
|
## Impact
|
||||||
|
|
||||||
|
- **Cria**: `routes/web.php` (rotas públicas), controllers em `app/Http/Controllers/PublicSite/`, Queries em `app/Application/Queries/Marketing/`, componentes Blade em `resources/views/components/` e páginas em `resources/views/pages/`, testes em `tests/Feature/PublicSite/` e `tests/Browser/`, baselines de snapshot versionadas.
|
||||||
|
- **Altera**: `resources/views/layouts/public.blade.php` (head SEO, landmarks, skip link), `app/Support/PublicImageUploadRules.php` e Filament Resources (geração de variantes), `ContentSeeder` (dados determinísticos para snapshots), `.github/workflows/ci.yml`, `public/robots.txt` (substituído por rota), `composer.json` se novo script for necessário.
|
||||||
|
- **Depende de**: specs `site-settings`, `service-catalog`, `portfolio-cases`, `testimonials`, `content-media`, `design-tokens`.
|
||||||
|
- **Risco**: instabilidade de snapshot (mitigada por relógio congelado, seed determinístico, fontes na imagem e animações desabilitadas — SPEC §13.5, §20).
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Public images are served in responsive variants
|
||||||
|
|
||||||
|
The system SHALL generate or serve responsive variants for public content images (service covers, portfolio covers and gallery, testimonial photos) and reference them with `srcset` and `sizes` so browsers download an appropriately sized file (SPEC §6.4). Variant generation MUST happen on upload, not on each request.
|
||||||
|
|
||||||
|
#### Scenario: Variants are produced on upload
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads a public content image
|
||||||
|
- **THEN** responsive variants MUST be generated and stored alongside the original
|
||||||
|
- **AND** the database MUST keep only paths, never binary data
|
||||||
|
|
||||||
|
#### Scenario: Public markup offers multiple sources
|
||||||
|
|
||||||
|
- **WHEN** a public page renders a content image
|
||||||
|
- **THEN** the `img` element MUST expose `srcset` with the available variants
|
||||||
|
- **AND** MUST expose a `sizes` attribute matching the layout
|
||||||
|
|
||||||
|
#### Scenario: Missing variant falls back to the original
|
||||||
|
|
||||||
|
- **GIVEN** an image stored before variant generation existed
|
||||||
|
- **WHEN** it is rendered on a public page
|
||||||
|
- **THEN** the original file MUST be used without breaking the page
|
||||||
|
|
||||||
|
### Requirement: Public images avoid layout shift and defer offscreen loading
|
||||||
|
|
||||||
|
Public content images SHALL reserve their space through explicit `width` and `height` (or equivalent aspect-ratio styling) and MUST use `loading="lazy"` when rendered below the fold. Above-the-fold hero imagery MUST NOT be lazy loaded (SPEC §6.4, §6.6).
|
||||||
|
|
||||||
|
#### Scenario: Offscreen image is lazy loaded
|
||||||
|
|
||||||
|
- **WHEN** a page renders an image below the first viewport
|
||||||
|
- **THEN** the `img` element MUST carry `loading="lazy"`
|
||||||
|
|
||||||
|
#### Scenario: Hero image loads eagerly
|
||||||
|
|
||||||
|
- **WHEN** the home hero image is rendered
|
||||||
|
- **THEN** it MUST NOT carry `loading="lazy"`
|
||||||
|
|
||||||
|
#### Scenario: Dimensions are reserved
|
||||||
|
|
||||||
|
- **WHEN** any public content image is rendered
|
||||||
|
- **THEN** width and height (or aspect ratio) MUST be declared so layout does not shift after load
|
||||||
|
|
||||||
|
### Requirement: Production images are not served from ephemeral container disk
|
||||||
|
|
||||||
|
Public image variants SHALL be stored on the configured filesystem disk (S3-compatible in production) and referenced by URL, so a container restart or redeploy does not lose media (SPEC §6.4).
|
||||||
|
|
||||||
|
#### Scenario: Media survives container replacement
|
||||||
|
|
||||||
|
- **GIVEN** production uses the S3-compatible disk
|
||||||
|
- **WHEN** the application container is replaced
|
||||||
|
- **THEN** previously uploaded images and variants MUST remain reachable
|
||||||
90
openspec/changes/build-public-site/specs/public-seo/spec.md
Normal file
90
openspec/changes/build-public-site/specs/public-seo/spec.md
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Every public page emits title, description and canonical
|
||||||
|
|
||||||
|
The system SHALL render a unique `<title>`, a `<meta name="description">` and a `<link rel="canonical">` on every public route (SPEC §6.6, §19). Portfolio cases MUST use `meta_title`/`meta_description` when filled and fall back to title/summary otherwise. Pages without page-level metadata MUST fall back to `default_meta_title` and `default_meta_description` from `site_settings`.
|
||||||
|
|
||||||
|
#### Scenario: Page-level metadata overrides defaults
|
||||||
|
|
||||||
|
- **GIVEN** a published case with `meta_title` and `meta_description` filled
|
||||||
|
- **WHEN** a visitor loads the case detail
|
||||||
|
- **THEN** the rendered title and description MUST use the case values
|
||||||
|
|
||||||
|
#### Scenario: Missing metadata falls back to site defaults
|
||||||
|
|
||||||
|
- **GIVEN** a published case without `meta_title`
|
||||||
|
- **WHEN** a visitor loads the case detail
|
||||||
|
- **THEN** the rendered title MUST be derived from the case title
|
||||||
|
- **AND** the description MUST fall back to the case summary or the site default
|
||||||
|
|
||||||
|
#### Scenario: Canonical points to the absolute route URL
|
||||||
|
|
||||||
|
- **WHEN** any public page is rendered
|
||||||
|
- **THEN** the canonical URL MUST be the absolute URL of that route without query parameters
|
||||||
|
|
||||||
|
### Requirement: Open Graph metadata is emitted for sharing
|
||||||
|
|
||||||
|
The system SHALL emit Open Graph tags (`og:title`, `og:description`, `og:type`, `og:url`, `og:image`) on public pages. The image MUST use the page cover image when available and `default_og_image_path` from `site_settings` otherwise.
|
||||||
|
|
||||||
|
#### Scenario: Case detail uses its cover as OG image
|
||||||
|
|
||||||
|
- **GIVEN** a published case with a cover image
|
||||||
|
- **WHEN** the case detail is rendered
|
||||||
|
- **THEN** `og:image` MUST reference the case cover image URL
|
||||||
|
|
||||||
|
#### Scenario: Pages without cover use the default OG image
|
||||||
|
|
||||||
|
- **WHEN** a page without its own image is rendered
|
||||||
|
- **THEN** `og:image` MUST reference `default_og_image_path`
|
||||||
|
|
||||||
|
### Requirement: Sitemap and robots are served by the application
|
||||||
|
|
||||||
|
The system SHALL serve `/sitemap.xml` listing the home, institutional routes, the services listing, the portfolio listing and every published case slug with its last modification date. `/robots.txt` MUST be served by an application route referencing the sitemap URL.
|
||||||
|
|
||||||
|
#### Scenario: Sitemap contains only published slugs
|
||||||
|
|
||||||
|
- **GIVEN** one published case and one draft case
|
||||||
|
- **WHEN** `/sitemap.xml` is requested
|
||||||
|
- **THEN** the response MUST include the published slug
|
||||||
|
- **AND** MUST NOT include the draft slug
|
||||||
|
|
||||||
|
#### Scenario: Newly published case enters the sitemap
|
||||||
|
|
||||||
|
- **WHEN** an admin publishes a case
|
||||||
|
- **THEN** the case slug MUST appear in `/sitemap.xml` on the next request
|
||||||
|
|
||||||
|
#### Scenario: Robots references the sitemap
|
||||||
|
|
||||||
|
- **WHEN** `/robots.txt` is requested
|
||||||
|
- **THEN** the response MUST be `text/plain`
|
||||||
|
- **AND** MUST contain the absolute `/sitemap.xml` URL
|
||||||
|
|
||||||
|
### Requirement: Basic structured data is emitted where applicable
|
||||||
|
|
||||||
|
The system SHALL emit JSON-LD structured data: `Organization` on the home using `site_settings`, and `Article` or equivalent creative work on the case detail.
|
||||||
|
|
||||||
|
#### Scenario: Home exposes organization data
|
||||||
|
|
||||||
|
- **WHEN** the home is rendered
|
||||||
|
- **THEN** a JSON-LD block of type `Organization` MUST be present with brand name and contact data
|
||||||
|
|
||||||
|
#### Scenario: Structured data is valid JSON
|
||||||
|
|
||||||
|
- **WHEN** any public page emits JSON-LD
|
||||||
|
- **THEN** the script content MUST parse as valid JSON
|
||||||
|
|
||||||
|
### Requirement: Analytics script is injected only when explicitly enabled
|
||||||
|
|
||||||
|
The system SHALL render the analytics snippet from `site_settings` only when `analytics_enabled` is true and the script field is non-empty (WEB-06). Analytics MUST be disabled by default.
|
||||||
|
|
||||||
|
#### Scenario: Analytics disabled emits nothing
|
||||||
|
|
||||||
|
- **GIVEN** `analytics_enabled` is false
|
||||||
|
- **WHEN** any public page is rendered
|
||||||
|
- **THEN** the analytics snippet MUST NOT appear in the HTML
|
||||||
|
|
||||||
|
#### Scenario: Analytics enabled injects the configured snippet
|
||||||
|
|
||||||
|
- **GIVEN** `analytics_enabled` is true and a snippet is configured
|
||||||
|
- **WHEN** a public page is rendered
|
||||||
|
- **THEN** the snippet MUST be present exactly once
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Public routes serve published content without authentication
|
||||||
|
|
||||||
|
The system SHALL expose the public routes of SPEC §5.1: `home` (`/`), `services.index` (`/servicos`), `portfolio.index` (`/portfolio`), `portfolio.show` (`/portfolio/{slug}`), `about` (`/sobre`), `contact` (`/contato`) and `privacy` (`/privacidade`). Every public route MUST respond without authentication and MUST NOT expose unpublished content, internal fields, or internal notes (SPEC §19).
|
||||||
|
|
||||||
|
#### Scenario: Guest reaches every public route
|
||||||
|
|
||||||
|
- **WHEN** an unauthenticated visitor requests any public route
|
||||||
|
- **THEN** the response status MUST be 200
|
||||||
|
- **AND** no redirect to `/admin/login` MUST occur
|
||||||
|
|
||||||
|
#### Scenario: Unpublished content is invisible
|
||||||
|
|
||||||
|
- **GIVEN** a service, portfolio case, or testimonial with `published_at` null
|
||||||
|
- **WHEN** a visitor loads the corresponding public page
|
||||||
|
- **THEN** the record MUST NOT appear in the rendered output
|
||||||
|
|
||||||
|
#### Scenario: Unpublished case detail returns 404
|
||||||
|
|
||||||
|
- **GIVEN** a portfolio case saved as draft
|
||||||
|
- **WHEN** a visitor requests `/portfolio/{slug}` for that case
|
||||||
|
- **THEN** the response status MUST be 404
|
||||||
|
|
||||||
|
#### Scenario: Published case detail becomes reachable
|
||||||
|
|
||||||
|
- **GIVEN** a portfolio case saved as draft
|
||||||
|
- **WHEN** an admin fills the required fields and publishes the case
|
||||||
|
- **THEN** `/portfolio/{slug}` MUST respond 200
|
||||||
|
- **AND** the case MUST appear in the `/portfolio` listing
|
||||||
|
|
||||||
|
### Requirement: Home renders the editorial structure from CMS content
|
||||||
|
|
||||||
|
The home page SHALL render, in the order defined by SPEC §6.2, header/navigation, hero, featured visual proof, services summary, working method, selected cases, testimonials, final briefing CTA, and footer with contact, social links and legal links (WEB-01). Hero copy, brand name and contact data MUST come from `site_settings`; services, cases and testimonials MUST come from published records.
|
||||||
|
|
||||||
|
#### Scenario: Published content is displayed in configured order
|
||||||
|
|
||||||
|
- **GIVEN** published services, cases and testimonials exist
|
||||||
|
- **WHEN** a visitor loads the home
|
||||||
|
- **THEN** the published content MUST be displayed following the `sort_order` and featured flags
|
||||||
|
- **AND** the hero MUST show the values stored in `site_settings`
|
||||||
|
|
||||||
|
#### Scenario: CTA leads to the briefing page
|
||||||
|
|
||||||
|
- **WHEN** a visitor activates the primary or final CTA on the home
|
||||||
|
- **THEN** the visitor MUST be taken to the `contact` route
|
||||||
|
|
||||||
|
#### Scenario: Empty content does not break the home
|
||||||
|
|
||||||
|
- **GIVEN** no published services, cases or testimonials
|
||||||
|
- **WHEN** a visitor loads the home
|
||||||
|
- **THEN** the response MUST be 200
|
||||||
|
- **AND** the affected sections MUST be omitted instead of rendering empty containers
|
||||||
|
|
||||||
|
#### Scenario: Home has no console errors
|
||||||
|
|
||||||
|
- **WHEN** the home is loaded in a real browser at desktop and mobile viewports
|
||||||
|
- **THEN** the browser console MUST contain no JavaScript errors
|
||||||
|
|
||||||
|
### Requirement: Listing and detail pages exist for catalog content
|
||||||
|
|
||||||
|
The system SHALL render a services listing (WEB-02) and a portfolio listing plus case detail (WEB-03). The case detail MUST present summary, event type, optional city/venue/date, challenge, solution, optional result, cover image and the ordered gallery.
|
||||||
|
|
||||||
|
#### Scenario: Services listing shows published services
|
||||||
|
|
||||||
|
- **WHEN** a visitor loads `/servicos`
|
||||||
|
- **THEN** every published service MUST be listed with title and summary in `sort_order`
|
||||||
|
|
||||||
|
#### Scenario: Gallery respects stored order
|
||||||
|
|
||||||
|
- **GIVEN** a published case with multiple gallery images
|
||||||
|
- **WHEN** a visitor loads the case detail
|
||||||
|
- **THEN** the images MUST be rendered ordered by `sort_order`
|
||||||
|
|
||||||
|
#### Scenario: Listings paginate open-ended growth
|
||||||
|
|
||||||
|
- **WHEN** the number of published cases exceeds the page size
|
||||||
|
- **THEN** `/portfolio` MUST paginate instead of rendering all records
|
||||||
|
|
||||||
|
### Requirement: Institutional and error pages have brand identity
|
||||||
|
|
||||||
|
The system SHALL provide the Sobre and Política de privacidade pages and branded error pages (WEB-07). The 404 page MUST use the public layout, and the 500 page MUST NOT expose stack traces or internal details when `APP_DEBUG` is false.
|
||||||
|
|
||||||
|
#### Scenario: Unknown URL renders branded 404
|
||||||
|
|
||||||
|
- **WHEN** a visitor requests a non-existent public URL
|
||||||
|
- **THEN** the response status MUST be 404
|
||||||
|
- **AND** the page MUST use the public layout and offer navigation back to the home
|
||||||
|
|
||||||
|
#### Scenario: Server error hides internals in production
|
||||||
|
|
||||||
|
- **GIVEN** `APP_DEBUG` is false
|
||||||
|
- **WHEN** an unhandled exception occurs on a public route
|
||||||
|
- **THEN** the response MUST be a generic branded error page
|
||||||
|
- **AND** MUST NOT contain a stack trace, file path, or environment variable
|
||||||
|
|
||||||
|
### Requirement: Contact page presents contact data as briefing placeholder
|
||||||
|
|
||||||
|
The `contact` route SHALL render the contact page using `site_settings` (e-mail, phone, city, social links) so the home CTA has a valid destination before the briefing form exists. The page MUST NOT create leads in this change.
|
||||||
|
|
||||||
|
#### Scenario: Contact page shows configured contact data
|
||||||
|
|
||||||
|
- **WHEN** a visitor loads `/contato`
|
||||||
|
- **THEN** the e-mail and phone stored in `site_settings` MUST be displayed
|
||||||
|
- **AND** no lead record MUST be created
|
||||||
|
|
||||||
|
### Requirement: Public pages avoid N+1 queries
|
||||||
|
|
||||||
|
Public pages SHALL load related content with explicit eager loading through dedicated read Queries in the Application layer. Rendering a page MUST NOT issue one query per related record (SPEC §19).
|
||||||
|
|
||||||
|
#### Scenario: Case detail loads gallery in bounded queries
|
||||||
|
|
||||||
|
- **WHEN** a case detail page with many gallery images is rendered
|
||||||
|
- **THEN** the gallery MUST be loaded with eager loading
|
||||||
|
- **AND** the query count MUST NOT grow with the number of images
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
## MODIFIED Requirements
|
||||||
|
|
||||||
|
### Requirement: Browser tests run against FrankenPHP-served application
|
||||||
|
|
||||||
|
The system SHALL execute browser tests using Pest Browser/Playwright against an application served by FrankenPHP in CI. The `browser` job MUST cover the E2E journeys available in the current phase, the visual regression assertions and the automated accessibility checks for public routes, and MUST run in assertion mode without regenerating baselines (SPEC §13.4, §13.5, §13.8, §14.1).
|
||||||
|
|
||||||
|
#### Scenario: Browser job validates served application
|
||||||
|
|
||||||
|
- **WHEN** the `browser` CI job runs
|
||||||
|
- **THEN** tests execute against the built application artifact or equivalent production-like image
|
||||||
|
|
||||||
|
#### Scenario: Browser job covers visual and accessibility assertions
|
||||||
|
|
||||||
|
- **WHEN** the `browser` CI job runs
|
||||||
|
- **THEN** it MUST execute the visual regression suite and the accessibility suite
|
||||||
|
- **AND** a failing snapshot or a critical/serious accessibility issue MUST block merge
|
||||||
|
|
||||||
|
#### Scenario: Browser failures publish diagnostics
|
||||||
|
|
||||||
|
- **WHEN** a browser test fails in CI
|
||||||
|
- **THEN** the job MUST publish screenshots, snapshot diffs, application logs and browser logs as artifacts
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Public screens have desktop and mobile visual baselines
|
||||||
|
|
||||||
|
The system SHALL keep versioned screenshot baselines for the public screens available in this phase (SPEC §13.5): Home, Serviços, Portfólio and Detalhe do portfólio, at 1440×1000 desktop and 390×844 mobile. A rendering change that alters those screens MUST fail the browser suite until the diff is reviewed.
|
||||||
|
|
||||||
|
#### Scenario: Unintended visual change fails the suite
|
||||||
|
|
||||||
|
- **GIVEN** approved baselines exist
|
||||||
|
- **WHEN** a code change alters the rendering of a covered screen
|
||||||
|
- **THEN** the visual assertion MUST fail and report the diff
|
||||||
|
|
||||||
|
#### Scenario: Both viewports are covered
|
||||||
|
|
||||||
|
- **WHEN** the visual suite runs
|
||||||
|
- **THEN** each covered screen MUST be asserted at 1440×1000 and 390×844
|
||||||
|
|
||||||
|
### Requirement: Visual runs are deterministic
|
||||||
|
|
||||||
|
Visual runs SHALL be deterministic per SPEC §13.5: fixed Chromium and Linux image, fixed viewport, timezone `America/Fortaleza`, locale `pt-BR`, fonts installed in the image, frozen clock, deterministic seed, animations and transitions disabled, and no dependency on external network.
|
||||||
|
|
||||||
|
#### Scenario: Repeated run without code change produces no diff
|
||||||
|
|
||||||
|
- **WHEN** the visual suite runs twice against the same commit and seed
|
||||||
|
- **THEN** both runs MUST pass with no pixel diff
|
||||||
|
|
||||||
|
#### Scenario: Time-dependent content does not cause drift
|
||||||
|
|
||||||
|
- **GIVEN** the clock is frozen and the seed is deterministic
|
||||||
|
- **WHEN** the suite runs on a different calendar day
|
||||||
|
- **THEN** rendered dates MUST remain identical to the baseline
|
||||||
|
|
||||||
|
#### Scenario: Motion is disabled during capture
|
||||||
|
|
||||||
|
- **WHEN** a screenshot is captured
|
||||||
|
- **THEN** CSS animations and transitions MUST be disabled
|
||||||
|
|
||||||
|
### Requirement: Baseline updates are explicit and reviewed
|
||||||
|
|
||||||
|
Baselines SHALL only be updated through the explicit `composer visual:update` command, and the resulting diff MUST be reviewed by a human before merge. Baselines MUST NOT be regenerated automatically to make CI pass.
|
||||||
|
|
||||||
|
#### Scenario: CI does not regenerate baselines
|
||||||
|
|
||||||
|
- **WHEN** the `browser` CI job runs
|
||||||
|
- **THEN** it MUST run in assertion mode
|
||||||
|
- **AND** MUST NOT write new baselines
|
||||||
|
|
||||||
|
#### Scenario: Developer updates baselines intentionally
|
||||||
|
|
||||||
|
- **WHEN** a developer runs `composer visual:update`
|
||||||
|
- **THEN** the updated baseline files MUST be written to the versioned baseline directory for review
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
## ADDED Requirements
|
||||||
|
|
||||||
|
### Requirement: Public routes have no critical or serious accessibility issues
|
||||||
|
|
||||||
|
The system SHALL run automated accessibility checks on the public routes covered by the browser suite (SPEC §6.5, §13.8). A critical or serious issue MUST fail the suite.
|
||||||
|
|
||||||
|
#### Scenario: Critical issue blocks the suite
|
||||||
|
|
||||||
|
- **WHEN** the automated accessibility check reports a critical or serious issue on a covered route
|
||||||
|
- **THEN** the browser suite MUST fail and report the offending rule and selector
|
||||||
|
|
||||||
|
#### Scenario: Covered routes are checked
|
||||||
|
|
||||||
|
- **WHEN** the accessibility suite runs
|
||||||
|
- **THEN** the home, services listing, portfolio listing and case detail MUST each be checked
|
||||||
|
|
||||||
|
### Requirement: Public pages use accessible semantic structure
|
||||||
|
|
||||||
|
Public pages SHALL provide semantic landmarks, exactly one `h1` per page, a coherent heading order, alt text on every content image, and visible focus on interactive elements (SPEC §6.5).
|
||||||
|
|
||||||
|
#### Scenario: Single h1 per page
|
||||||
|
|
||||||
|
- **WHEN** any public page is rendered
|
||||||
|
- **THEN** exactly one `h1` element MUST be present
|
||||||
|
|
||||||
|
#### Scenario: Landmarks are present
|
||||||
|
|
||||||
|
- **WHEN** any public page is rendered
|
||||||
|
- **THEN** `header`, `main`, `nav` and `footer` landmarks MUST be present
|
||||||
|
|
||||||
|
#### Scenario: Content images expose alt text
|
||||||
|
|
||||||
|
- **WHEN** a page renders a cover or gallery image
|
||||||
|
- **THEN** the `alt` attribute MUST contain the stored alt text
|
||||||
|
|
||||||
|
### Requirement: Public pages are fully keyboard operable
|
||||||
|
|
||||||
|
Visitors SHALL be able to reach and activate every interactive element with the keyboard, with a visible focus indicator and a skip link to the main content.
|
||||||
|
|
||||||
|
#### Scenario: Keyboard reaches the primary CTA
|
||||||
|
|
||||||
|
- **WHEN** a visitor navigates the home with the Tab key
|
||||||
|
- **THEN** the primary CTA MUST receive focus with a visible indicator
|
||||||
|
- **AND** activating it with the keyboard MUST navigate to the contact route
|
||||||
|
|
||||||
|
#### Scenario: Skip link bypasses navigation
|
||||||
|
|
||||||
|
- **WHEN** a visitor focuses the first element of a public page
|
||||||
|
- **THEN** a skip link to the main content MUST be available
|
||||||
|
|
||||||
|
### Requirement: Reduced motion preference is honored
|
||||||
|
|
||||||
|
The system SHALL suppress non-essential animation and transition when the user agent reports `prefers-reduced-motion: reduce`.
|
||||||
|
|
||||||
|
#### Scenario: Reduced motion disables transitions
|
||||||
|
|
||||||
|
- **GIVEN** the browser reports `prefers-reduced-motion: reduce`
|
||||||
|
- **WHEN** a public page is loaded
|
||||||
|
- **THEN** decorative transitions and animations MUST NOT run
|
||||||
|
|
||||||
|
### Requirement: Public pages emit no console errors
|
||||||
|
|
||||||
|
Covered public routes SHALL load without JavaScript console errors in a real browser (SPEC §13.8, §19).
|
||||||
|
|
||||||
|
#### Scenario: Console stays clean on covered routes
|
||||||
|
|
||||||
|
- **WHEN** a covered public route is loaded in the browser suite
|
||||||
|
- **THEN** the console MUST contain no error-level messages
|
||||||
72
openspec/changes/build-public-site/tasks.md
Normal file
72
openspec/changes/build-public-site/tasks.md
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
## 1. Fundação de leitura e layout público
|
||||||
|
|
||||||
|
- [x] 1.1 Criar `app/Application/Queries/Marketing/GetPublishedServices` e `GetPublishedPortfolioCases` (scope `published()`, ordenação por `sort_order`, eager loading explícito) com feature tests cobrindo exclusão de rascunho e ordem
|
||||||
|
- [x] 1.2 Criar `FindPublishedPortfolioCaseBySlug` retornando `null` para rascunho, com teste
|
||||||
|
- [x] 1.3 Criar `app/Application/Data/PageMeta` com fallback para `site_settings` e unit test sem banco (title/description/canonical/OG)
|
||||||
|
- [x] 1.4 Estender `layouts/public.blade.php` com head de SEO (`components/seo/meta.blade.php`), landmarks completos, navegação e footer alimentados por `site_settings`; feature test do head
|
||||||
|
- [x] 1.5 Rodar `composer pint`, `composer phpstan` e `composer test:feature`
|
||||||
|
|
||||||
|
## 2. Mídia responsiva
|
||||||
|
|
||||||
|
- [x] 2.1 Adicionar extensão `gd` ao `Dockerfile` e às matrizes de PHP do CI; adicionar `intervention/image` ao `composer.json`
|
||||||
|
- [x] 2.2 Criar `app/Support/ResponsiveImage` gerando variantes 480/960/1440 com nome derivado do original, e removendo variantes quando o original é substituído/excluído; unit test com `Storage::fake`
|
||||||
|
- [x] 2.3 Plugar a geração no `saveUploadedFileUsing` de `PublicImageUploadRules` e cobrir com feature test em um Resource do CMS
|
||||||
|
- [x] 2.4 Criar componente `<x-media.image>` com `srcset`, `sizes`, `width`/`height`, `alt` e `loading` configurável; feature test verificando lazy fora da dobra e eager no hero
|
||||||
|
- [x] 2.5 Criar comando `php artisan media:generate-variants` para backfill, com teste
|
||||||
|
- [x] 2.6 Adicionar `php artisan storage:link` idempotente ao `docker/entrypoint.sh` e validar no job `container`
|
||||||
|
- [x] 2.7 Rodar `composer quality`
|
||||||
|
|
||||||
|
## 3. Home editorial (WEB-01)
|
||||||
|
|
||||||
|
- [x] 3.1 Criar `GetHomeContent` + DTO `HomeContent` (hero de `site_settings`, serviços/casos em destaque, depoimentos publicados) com feature test
|
||||||
|
- [x] 3.2 Criar `HomeController` e substituir `Route::view('/')` pela rota nomeada `home`
|
||||||
|
- [x] 3.3 Implementar as seções do SPEC §6.2 como componentes Blade reutilizáveis (hero, prova visual, serviços, método, casos, depoimentos, CTA final)
|
||||||
|
- [x] 3.4 Feature tests: conteúdo publicado exibido em ordem, rascunho ausente, seções omitidas quando não há conteúdo, CTA aponta para a rota `contact`
|
||||||
|
- [x] 3.5 Rodar `composer quality`
|
||||||
|
|
||||||
|
## 4. Serviços, portfólio e páginas institucionais (WEB-02, WEB-03, WEB-07)
|
||||||
|
|
||||||
|
- [x] 4.1 Rota + controller + view de `/servicos` listando serviços publicados; feature test
|
||||||
|
- [x] 4.2 Rota + controller + view de `/portfolio` com paginação; feature test incluindo paginação e exclusão de rascunho
|
||||||
|
- [x] 4.3 Rota + view de `/portfolio/{slug}` com desafio, solução, resultado e galeria ordenada; feature tests de 200 publicado, 404 rascunho e ordem da galeria
|
||||||
|
- [x] 4.4 Rotas + views de `/sobre` e `/privacidade` usando `site_settings`; feature tests
|
||||||
|
- [x] 4.5 Rota + view de `/contato` exibindo e-mail, telefone e redes de `site_settings`, sem criação de lead; feature test
|
||||||
|
- [x] 4.6 Views `errors/404.blade.php` e `errors/500.blade.php` com layout público; feature tests de 404 branded e de 500 sem stack trace com `APP_DEBUG=false`
|
||||||
|
- [x] 4.7 Teste de contagem de queries no detalhe do caso para garantir ausência de N+1
|
||||||
|
- [x] 4.8 Rodar `composer quality`
|
||||||
|
|
||||||
|
## 5. SEO, sitemap e analytics
|
||||||
|
|
||||||
|
- [x] 5.1 Aplicar `PageMeta` em todos os controllers públicos (title, description, canonical, OG) com feature tests de override por caso e de fallback para os padrões do site
|
||||||
|
- [x] 5.2 Emitir JSON-LD `Organization` na home e `Article`/creative work no detalhe do caso; feature test validando JSON parseável
|
||||||
|
- [x] 5.3 Criar `GetSitemapEntries`, rota `/sitemap.xml` e view XML; feature tests de inclusão de publicado, exclusão de rascunho e entrada após publicação
|
||||||
|
- [x] 5.4 Substituir `public/robots.txt` por rota `text/plain` referenciando o sitemap absoluto; feature test
|
||||||
|
- [x] 5.5 Injetar o snippet de analytics apenas com `analytics_enabled` verdadeiro; feature tests dos dois estados
|
||||||
|
- [x] 5.6 Rodar `composer quality`
|
||||||
|
|
||||||
|
## 6. Acessibilidade
|
||||||
|
|
||||||
|
- [x] 6.1 Feature tests estruturais de HTML: um único `h1`, landmarks `header/nav/main/footer`, `alt` presente nas imagens de conteúdo
|
||||||
|
- [x] 6.2 Garantir skip link funcional e foco visível em todos os elementos interativos das páginas novas
|
||||||
|
- [x] 6.3 Adicionar verificação axe na suíte browser para home, serviços, portfólio e detalhe do caso, falhando em issues `critical`/`serious`
|
||||||
|
- [x] 6.4 Teste browser de navegação por teclado até o CTA principal e ativação por teclado
|
||||||
|
- [x] 6.5 Teste browser garantindo ausência de erros no console nas rotas cobertas
|
||||||
|
- [x] 6.6 Verificar `prefers-reduced-motion: reduce` desabilitando transições; teste browser com emulação
|
||||||
|
- [x] 6.7 Rodar `composer test:browser`
|
||||||
|
|
||||||
|
## 7. Regressão visual
|
||||||
|
|
||||||
|
- [x] 7.1 Adicionar fontes self-hosted via Vite e remover qualquer dependência de fonte de sistema ou CDN
|
||||||
|
- [x] 7.2 Implementar `APP_FROZEN_NOW` (provider que chama `CarbonImmutable::setTestNow()` fora de produção) e documentar em `.env.example`; unit test do provider
|
||||||
|
- [x] 7.3 Criar `VisualContentSeeder` determinístico (textos, datas e imagens fixture fixas), separado do `ContentSeeder`
|
||||||
|
- [x] 7.4 Criar testes de snapshot para Home, Serviços, Portfólio e Detalhe do portfólio em 1440×1000 e 390×844; gravar baselines versionadas
|
||||||
|
- [x] 7.5 Confirmar que duas execuções consecutivas no mesmo commit não produzem diff
|
||||||
|
- [x] 7.6 Verificar que `composer visual:update` grava baselines e que a suíte padrão roda em modo assertivo
|
||||||
|
|
||||||
|
## 8. Gate de CI e fechamento da fase
|
||||||
|
|
||||||
|
- [x] 8.1 Job `browser` do CI: executar `php artisan db:seed --class=VisualContentSeeder --force` antes da suíte
|
||||||
|
- [x] 8.2 Job `browser` do CI: publicar screenshots, diffs de snapshot, logs da aplicação e logs do browser com `if: failure()`
|
||||||
|
- [ ] 8.3 Confirmar os cinco jobs verdes (`static`, `unit`, `feature`, `browser`, `container`) em pull request
|
||||||
|
- [x] 8.4 Rodar `composer quality` completo e registrar o resultado no PR
|
||||||
|
- [x] 8.5 Revisar o critério de saída da Fase 1 (conteúdo gerenciável no Filament e site público aprovado visualmente) e atualizar `SPEC.md` §18 marcando apenas itens comprovados
|
||||||
59
openspec/specs/container-runtime/spec.md
Normal file
59
openspec/specs/container-runtime/spec.md
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# container-runtime Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
TBD - created by archiving change setup-foundation. Update Purpose after archive.
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Production image uses multi-stage FrankenPHP build
|
||||||
|
|
||||||
|
The system SHALL provide a multi-stage Dockerfile that builds Composer dependencies, frontend assets, and a FrankenPHP runtime image serving `public/`.
|
||||||
|
|
||||||
|
#### Scenario: Image builds reproducibly in CI
|
||||||
|
|
||||||
|
- **WHEN** the `container` CI job builds the Docker image from a clean checkout
|
||||||
|
- **THEN** the build completes successfully and produces a runnable image
|
||||||
|
|
||||||
|
### Requirement: FrankenPHP runs in regular mode only
|
||||||
|
|
||||||
|
The system MUST NOT enable FrankenPHP worker mode in the MVP. The runtime SHALL use FrankenPHP in regular mode (ADR-006).
|
||||||
|
|
||||||
|
#### Scenario: Runtime configuration is regular mode
|
||||||
|
|
||||||
|
- **WHEN** the production image starts the web process
|
||||||
|
- **THEN** FrankenPHP serves requests in regular mode without worker persistence
|
||||||
|
|
||||||
|
### Requirement: Runtime image runs as non-root when supported
|
||||||
|
|
||||||
|
The system SHALL configure the production runtime to run as a non-root user when the base image supports it.
|
||||||
|
|
||||||
|
#### Scenario: Container process is non-root
|
||||||
|
|
||||||
|
- **WHEN** the web container is running in production configuration
|
||||||
|
- **THEN** the primary process MUST NOT run as root
|
||||||
|
|
||||||
|
### Requirement: Same image supports web queue and scheduler processes
|
||||||
|
|
||||||
|
The system SHALL use the same application image for web, queue worker, and scheduler processes with distinct commands (SPEC §15.2).
|
||||||
|
|
||||||
|
#### Scenario: Queue worker starts from application image
|
||||||
|
|
||||||
|
- **WHEN** the queue process is started with `php artisan queue:work`
|
||||||
|
- **THEN** it uses the same built image as the web process
|
||||||
|
|
||||||
|
### Requirement: Production image contains no secrets in layers
|
||||||
|
|
||||||
|
The system MUST NOT embed secrets, credentials, or private keys in Docker image layers.
|
||||||
|
|
||||||
|
#### Scenario: Image inspection finds no embedded secrets
|
||||||
|
|
||||||
|
- **WHEN** the image is built in CI
|
||||||
|
- **THEN** build arguments and layers MUST NOT contain production secrets or `.env` values
|
||||||
|
|
||||||
|
### Requirement: Container healthcheck validates application availability
|
||||||
|
|
||||||
|
The system SHALL define a container healthcheck that verifies application availability via the `/up` endpoint or equivalent boot check.
|
||||||
|
|
||||||
|
#### Scenario: Unhealthy container is detected
|
||||||
|
|
||||||
|
- **WHEN** the application inside the container fails to respond healthy on `/up`
|
||||||
|
- **THEN** the container healthcheck MUST report unhealthy status
|
||||||
|
|
||||||
36
openspec/specs/content-media/spec.md
Normal file
36
openspec/specs/content-media/spec.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# content-media Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Define validation, storage, and accessibility requirements for public content images.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Public content images are validated and stored securely
|
||||||
|
|
||||||
|
The system SHALL validate public content uploads (service covers, portfolio covers/gallery, testimonial photos, site OG image) per SPEC §6.4 and §12.4. Validation MUST enforce MIME allowlist (jpeg, png, webp), matching extensions, maximum size of 10 MB, and mandatory alt text when an image is uploaded.
|
||||||
|
|
||||||
|
#### Scenario: Invalid MIME is rejected
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads a file with disallowed MIME type
|
||||||
|
- **THEN** validation MUST fail with a pt-BR error message
|
||||||
|
|
||||||
|
#### Scenario: Oversized file is rejected
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads an image exceeding 10 MB
|
||||||
|
- **THEN** validation MUST fail
|
||||||
|
|
||||||
|
#### Scenario: Storage path is not derived from original filename
|
||||||
|
|
||||||
|
- **WHEN** an image is stored
|
||||||
|
- **THEN** the physical path MUST be generated (UUID/hash based)
|
||||||
|
- **AND** MUST NOT use the original upload filename as the storage key
|
||||||
|
|
||||||
|
#### Scenario: Alt text required with image
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads a cover or gallery image without alt text
|
||||||
|
- **THEN** validation MUST fail
|
||||||
|
|
||||||
|
#### Scenario: Images are not stored in PostgreSQL
|
||||||
|
|
||||||
|
- **WHEN** content with images is persisted
|
||||||
|
- **THEN** only the filesystem path MUST be stored in the database
|
||||||
|
- **AND** binary image data MUST NOT be written to PostgreSQL columns
|
||||||
32
openspec/specs/design-tokens/spec.md
Normal file
32
openspec/specs/design-tokens/spec.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# design-tokens Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
TBD - created by archiving change setup-foundation. Update Purpose after archive.
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Design tokens are centralized for the public site
|
||||||
|
|
||||||
|
The system SHALL define minimum design tokens in a single source consumed by the public site layout and components. Tokens MUST cover typography families, font scale, spacing, border radius, container width, background/text/border/accent/state colors, shadows, and transition duration/easing.
|
||||||
|
|
||||||
|
#### Scenario: Public layout uses shared tokens
|
||||||
|
|
||||||
|
- **WHEN** a public page is rendered
|
||||||
|
- **THEN** visual properties MUST be derived from the centralized token definitions rather than arbitrary inline values
|
||||||
|
|
||||||
|
### Requirement: Public site respects reduced motion preference
|
||||||
|
|
||||||
|
The system SHALL honor `prefers-reduced-motion` by disabling or minimizing non-essential animations and transitions on the public site.
|
||||||
|
|
||||||
|
#### Scenario: User prefers reduced motion
|
||||||
|
|
||||||
|
- **WHEN** a visitor has `prefers-reduced-motion: reduce` enabled
|
||||||
|
- **THEN** the public site MUST NOT play non-essential motion effects
|
||||||
|
|
||||||
|
### Requirement: Public site meets baseline accessibility contrast
|
||||||
|
|
||||||
|
The system SHALL use color combinations on the public site that meet WCAG AA contrast requirements for text and interactive elements defined in the token palette.
|
||||||
|
|
||||||
|
#### Scenario: Primary text is readable
|
||||||
|
|
||||||
|
- **WHEN** primary body text is rendered on its background color
|
||||||
|
- **THEN** the contrast ratio MUST meet WCAG AA minimums
|
||||||
|
|
||||||
28
openspec/specs/health-check/spec.md
Normal file
28
openspec/specs/health-check/spec.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# health-check Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
TBD - created by archiving change setup-foundation. Update Purpose after archive.
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Public health endpoint responds without authentication
|
||||||
|
|
||||||
|
The system SHALL expose `GET /up` as a public healthcheck endpoint that does not require authentication.
|
||||||
|
|
||||||
|
#### Scenario: Application is healthy
|
||||||
|
|
||||||
|
- **WHEN** a client sends `GET /up` while the application is running normally
|
||||||
|
- **THEN** the system responds with HTTP 200 in a timely manner
|
||||||
|
|
||||||
|
#### Scenario: Health endpoint exposes no secrets
|
||||||
|
|
||||||
|
- **WHEN** a client sends `GET /up`
|
||||||
|
- **THEN** the response MUST NOT include credentials, tokens, stack traces, or environment secrets
|
||||||
|
|
||||||
|
### Requirement: Health endpoint reflects application failure
|
||||||
|
|
||||||
|
The system SHALL return a failure status when the application cannot initialize properly.
|
||||||
|
|
||||||
|
#### Scenario: Application cannot boot
|
||||||
|
|
||||||
|
- **WHEN** the application fails to boot due to misconfiguration or missing dependencies
|
||||||
|
- **THEN** the health endpoint MUST NOT return HTTP 200
|
||||||
|
|
||||||
60
openspec/specs/internal-authentication/spec.md
Normal file
60
openspec/specs/internal-authentication/spec.md
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
# internal-authentication Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
TBD - created by archiving change setup-foundation. Update Purpose after archive.
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Internal users authenticate via Filament panel
|
||||||
|
|
||||||
|
The system SHALL provide authenticated access to the internal panel at `/admin` using Laravel's session-based authentication integrated with Filament 5.
|
||||||
|
|
||||||
|
#### Scenario: Active admin logs in successfully
|
||||||
|
|
||||||
|
- **WHEN** an active user with role `admin` submits valid credentials on the login page
|
||||||
|
- **THEN** the system authenticates the user and redirects to the Filament dashboard
|
||||||
|
|
||||||
|
#### Scenario: Active assistant logs in successfully
|
||||||
|
|
||||||
|
- **WHEN** an active user with role `assistant` submits valid credentials on the login page
|
||||||
|
- **THEN** the system authenticates the user and redirects to the Filament dashboard
|
||||||
|
|
||||||
|
#### Scenario: Inactive user is denied panel access
|
||||||
|
|
||||||
|
- **WHEN** a user with `is_active` set to false submits valid credentials
|
||||||
|
- **THEN** the system MUST NOT grant access to the Filament panel
|
||||||
|
|
||||||
|
### Requirement: User roles are limited to admin and assistant
|
||||||
|
|
||||||
|
The system SHALL store user roles using the `UserRole` enum with exactly two cases: `admin` and `assistant`. The system MUST NOT implement a granular permission system in the MVP.
|
||||||
|
|
||||||
|
#### Scenario: User is created with a valid role
|
||||||
|
|
||||||
|
- **WHEN** an administrator creates a user with role `admin` or `assistant`
|
||||||
|
- **THEN** the role is persisted and enforced on subsequent authorization checks
|
||||||
|
|
||||||
|
### Requirement: Email addresses are unique per user
|
||||||
|
|
||||||
|
The system SHALL enforce a unique constraint on user email addresses.
|
||||||
|
|
||||||
|
#### Scenario: Duplicate email rejected
|
||||||
|
|
||||||
|
- **WHEN** a user is created or updated with an email already assigned to another user
|
||||||
|
- **THEN** the system MUST reject the operation with a validation error
|
||||||
|
|
||||||
|
### Requirement: Password reset is available for internal users
|
||||||
|
|
||||||
|
The system SHALL support secure password reset for internal users using Laravel's built-in reset flow.
|
||||||
|
|
||||||
|
#### Scenario: User requests password reset
|
||||||
|
|
||||||
|
- **WHEN** a user submits a registered email on the password reset form
|
||||||
|
- **THEN** the system sends a reset link without revealing whether the email exists
|
||||||
|
|
||||||
|
### Requirement: Only admin manages internal users
|
||||||
|
|
||||||
|
The system SHALL restrict user management (create, update, deactivate) to users with role `admin`. Users with role `assistant` MUST NOT manage other users.
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot access user management
|
||||||
|
|
||||||
|
- **WHEN** an authenticated assistant attempts to access user management in the panel
|
||||||
|
- **THEN** the system MUST deny access via authorization policy
|
||||||
|
|
||||||
35
openspec/specs/portfolio-cases/spec.md
Normal file
35
openspec/specs/portfolio-cases/spec.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# portfolio-cases Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Define editorial, publication, authorization, and gallery behavior for portfolio cases.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Portfolio cases support editorial content and ordered gallery
|
||||||
|
|
||||||
|
The system SHALL allow admins to manage portfolio cases (SPEC WEB-03) with title, unique slug, summary, event type, optional city/venue/event date, challenge, solution, optional result, cover image with alt text, featured flag, sort order, `published_at`, and optional SEO meta fields. Each case MUST support an ordered gallery via `portfolio_images` (path, alt text, optional caption, sort order).
|
||||||
|
|
||||||
|
#### Scenario: Draft case is not publicly visible
|
||||||
|
|
||||||
|
- **WHEN** a portfolio case has `published_at` null
|
||||||
|
- **THEN** the `published()` scope MUST exclude it
|
||||||
|
|
||||||
|
#### Scenario: Published case meets acceptance criteria
|
||||||
|
|
||||||
|
- **WHEN** an admin fills required fields and sets `published_at`
|
||||||
|
- **THEN** the case MUST be included in the `published()` scope
|
||||||
|
- **AND** cover and gallery images MUST have alt text when present
|
||||||
|
|
||||||
|
#### Scenario: Gallery images maintain order
|
||||||
|
|
||||||
|
- **WHEN** an admin reorders gallery images in Filament
|
||||||
|
- **THEN** `sort_order` MUST reflect the chosen order per `portfolio_case_id`
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot manage portfolio
|
||||||
|
|
||||||
|
- **WHEN** an assistant attempts to access portfolio cases
|
||||||
|
- **THEN** access MUST be denied with HTTP 403
|
||||||
|
|
||||||
|
#### Scenario: Cascade delete removes gallery images
|
||||||
|
|
||||||
|
- **WHEN** a portfolio case is deleted
|
||||||
|
- **THEN** associated `portfolio_images` records MUST be removed (FK cascade)
|
||||||
60
openspec/specs/quality-gates/spec.md
Normal file
60
openspec/specs/quality-gates/spec.md
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
# quality-gates Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
TBD - created by archiving change setup-foundation. Update Purpose after archive.
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Standardized Composer test scripts exist
|
||||||
|
|
||||||
|
The system SHALL expose Composer scripts equivalent to `test:unit`, `test:feature`, `test:browser`, `test`, and `quality` with the composition defined in SPEC §13.9.
|
||||||
|
|
||||||
|
#### Scenario: Developer runs full quality gate locally
|
||||||
|
|
||||||
|
- **WHEN** a developer runs `composer quality`
|
||||||
|
- **THEN** the command executes static analysis, audits, and the applicable test suites
|
||||||
|
|
||||||
|
### Requirement: Architecture tests enforce domain boundaries
|
||||||
|
|
||||||
|
The system SHALL include Pest architecture tests that verify `App\Domain` uses strict types and does not depend on `App\Filament` or `App\Livewire`.
|
||||||
|
|
||||||
|
#### Scenario: Domain layer violates boundary
|
||||||
|
|
||||||
|
- **WHEN** code in `App\Domain` imports from `App\Filament` or `App\Livewire`
|
||||||
|
- **THEN** the architecture test suite MUST fail
|
||||||
|
|
||||||
|
### Requirement: CI pipeline blocks merge on five jobs
|
||||||
|
|
||||||
|
The system SHALL run a CI pipeline with blocking jobs named `static`, `unit`, `feature`, `browser`, and `container` as defined in SPEC §14.1.
|
||||||
|
|
||||||
|
#### Scenario: Static analysis fails on pull request
|
||||||
|
|
||||||
|
- **WHEN** a pull request introduces a Pint, PHPStan/Larastan, or Composer audit failure
|
||||||
|
- **THEN** the `static` job MUST fail and block merge
|
||||||
|
|
||||||
|
#### Scenario: Feature tests use PostgreSQL
|
||||||
|
|
||||||
|
- **WHEN** the `feature` CI job runs integration tests
|
||||||
|
- **THEN** the job MUST use PostgreSQL and MUST NOT substitute SQLite
|
||||||
|
|
||||||
|
### Requirement: Local feature tests use PostgreSQL
|
||||||
|
|
||||||
|
The system SHALL configure `phpunit.xml` so that the Feature test suite uses PostgreSQL with the same connection parameters as CI (`DB_CONNECTION=pgsql`, host, port, database `amare_test`, credentials). Local feature tests MUST NOT default to SQLite `:memory:`.
|
||||||
|
|
||||||
|
#### Scenario: Developer runs feature tests locally
|
||||||
|
|
||||||
|
- **WHEN** a developer runs `composer test:feature` with PostgreSQL available
|
||||||
|
- **THEN** tests MUST execute against PostgreSQL
|
||||||
|
- **AND** MUST NOT silently fall back to SQLite
|
||||||
|
|
||||||
|
#### Scenario: Feature tests exercise PostgreSQL-specific types
|
||||||
|
|
||||||
|
- **WHEN** feature tests persist records with jsonb columns (e.g., `social_links`)
|
||||||
|
- **THEN** migrations and constraints MUST be validated against PostgreSQL semantics
|
||||||
|
|
||||||
|
### Requirement: Browser tests run against FrankenPHP-served application
|
||||||
|
|
||||||
|
The system SHALL execute browser tests using Pest Browser/Playwright against an application served by FrankenPHP in CI.
|
||||||
|
|
||||||
|
#### Scenario: Browser job validates served application
|
||||||
|
|
||||||
|
- **WHEN** the `browser` CI job runs
|
||||||
|
- **THEN** tests execute against the built application artifact or equivalent production-like image
|
||||||
34
openspec/specs/service-catalog/spec.md
Normal file
34
openspec/specs/service-catalog/spec.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# service-catalog Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Define service catalog management, publication, and authorization behavior.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Services are managed in Filament with publication control
|
||||||
|
|
||||||
|
The system SHALL allow admins to create, update, and delete services (SPEC WEB-02). Each service MUST have title, unique slug, summary, description, optional cover image with alt text, sort order, featured flag, and `published_at`.
|
||||||
|
|
||||||
|
#### Scenario: Unpublished service is not publicly visible
|
||||||
|
|
||||||
|
- **WHEN** a service has `published_at` null
|
||||||
|
- **THEN** the `published()` scope MUST exclude it from public queries
|
||||||
|
|
||||||
|
#### Scenario: Published service is queryable
|
||||||
|
|
||||||
|
- **WHEN** an admin sets `published_at` on a service with required fields
|
||||||
|
- **THEN** the service MUST be included in the `published()` scope
|
||||||
|
|
||||||
|
#### Scenario: Slug uniqueness is enforced
|
||||||
|
|
||||||
|
- **WHEN** an admin attempts to save two services with the same slug
|
||||||
|
- **THEN** validation or database constraint MUST reject the duplicate
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot manage services
|
||||||
|
|
||||||
|
- **WHEN** an assistant attempts to access the services Resource
|
||||||
|
- **THEN** access MUST be denied with HTTP 403
|
||||||
|
|
||||||
|
#### Scenario: Delete requires confirmation
|
||||||
|
|
||||||
|
- **WHEN** an admin deletes a service in Filament
|
||||||
|
- **THEN** the UI MUST require explicit confirmation before deletion
|
||||||
32
openspec/specs/site-settings/spec.md
Normal file
32
openspec/specs/site-settings/spec.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# site-settings Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Define the typed site-wide settings singleton and its administration rules.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Site settings singleton is manageable by admin only
|
||||||
|
|
||||||
|
The system SHALL persist site-wide settings in a `site_settings` table as a typed singleton (SPEC WEB-06, §8.2). Fields MUST include brand name, hero copy (eyebrow, title, subtitle, CTA label), about summary, contact email/phone/city, social links (jsonb), default meta title/description, default OG image path and alt text, and optional analytics fields disabled by default.
|
||||||
|
|
||||||
|
#### Scenario: Admin updates site settings
|
||||||
|
|
||||||
|
- **WHEN** an admin saves the site settings form in Filament
|
||||||
|
- **THEN** the singleton record is updated
|
||||||
|
- **AND** labels and validation messages are in pt-BR
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot access site settings
|
||||||
|
|
||||||
|
- **WHEN** an assistant navigates to site settings in Filament
|
||||||
|
- **THEN** access MUST be denied with HTTP 403
|
||||||
|
|
||||||
|
#### Scenario: Default OG image requires alt text
|
||||||
|
|
||||||
|
- **WHEN** an admin uploads a default OG image without alt text
|
||||||
|
- **THEN** validation MUST fail with a pt-BR error message
|
||||||
|
- **AND** alt text MUST remain optional when no default OG image is present
|
||||||
|
|
||||||
|
#### Scenario: Singleton avoids generic key-value store
|
||||||
|
|
||||||
|
- **WHEN** site settings are stored
|
||||||
|
- **THEN** the system MUST use typed columns on `site_settings`
|
||||||
|
- **AND** MUST NOT introduce a generic key/value configuration table
|
||||||
29
openspec/specs/testimonials/spec.md
Normal file
29
openspec/specs/testimonials/spec.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# testimonials Specification
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Define testimonial management, publication, authorization, and featured filtering behavior.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
### Requirement: Testimonials are managed with publication control
|
||||||
|
|
||||||
|
The system SHALL allow admins to manage testimonials (SPEC WEB-04) with quote text, author name, optional context, optional photo with alt text, sort order, featured flag, and `published_at`.
|
||||||
|
|
||||||
|
#### Scenario: Unpublished testimonial is excluded
|
||||||
|
|
||||||
|
- **WHEN** a testimonial has `published_at` null
|
||||||
|
- **THEN** the `published()` scope MUST exclude it
|
||||||
|
|
||||||
|
#### Scenario: Published testimonial is queryable
|
||||||
|
|
||||||
|
- **WHEN** an admin sets `published_at` with required quote and author name
|
||||||
|
- **THEN** the testimonial MUST be included in the `published()` scope
|
||||||
|
|
||||||
|
#### Scenario: Assistant cannot manage testimonials
|
||||||
|
|
||||||
|
- **WHEN** an assistant attempts to access the testimonials Resource
|
||||||
|
- **THEN** access MUST be denied with HTTP 403
|
||||||
|
|
||||||
|
#### Scenario: Featured testimonials are filterable
|
||||||
|
|
||||||
|
- **WHEN** content is queried with featured filter
|
||||||
|
- **THEN** records with `is_featured` true MUST be retrievable independently of sort order
|
||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-foundation",
|
"name": "site-amare",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
User-agent: *
|
|
||||||
Disallow:
|
|
||||||
@@ -59,6 +59,17 @@
|
|||||||
color: var(--amare-color-text);
|
color: var(--amare-color-text);
|
||||||
font-family: var(--amare-font-sans);
|
font-family: var(--amare-font-sans);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a:focus-visible,
|
||||||
|
button:focus-visible,
|
||||||
|
summary:focus-visible,
|
||||||
|
input:focus-visible,
|
||||||
|
textarea:focus-visible,
|
||||||
|
select:focus-visible,
|
||||||
|
[tabindex]:focus-visible {
|
||||||
|
outline: 2px solid var(--amare-color-accent);
|
||||||
|
outline-offset: 3px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@utility container-amare {
|
@utility container-amare {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
:root {
|
:root {
|
||||||
/* Typography */
|
/* Typography */
|
||||||
--amare-font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
|
--amare-font-sans: var(--font-instrument-sans, 'Instrument Sans'), sans-serif;
|
||||||
--amare-font-serif: 'Georgia', 'Times New Roman', serif;
|
--amare-font-serif: var(--font-instrument-sans, 'Instrument Sans'), sans-serif;
|
||||||
|
|
||||||
/* Font scale */
|
/* Font scale */
|
||||||
--amare-text-xs: 0.75rem;
|
--amare-text-xs: 0.75rem;
|
||||||
@@ -40,9 +40,9 @@
|
|||||||
--amare-color-text: #1a1410;
|
--amare-color-text: #1a1410;
|
||||||
--amare-color-text-muted: #4a4038;
|
--amare-color-text-muted: #4a4038;
|
||||||
--amare-color-border: #d9cfc0;
|
--amare-color-border: #d9cfc0;
|
||||||
--amare-color-accent: #b8860b;
|
--amare-color-accent: #8a6500;
|
||||||
--amare-color-accent-hover: #996f00;
|
--amare-color-accent-hover: #6f5200;
|
||||||
--amare-color-accent-text: #1a1410;
|
--amare-color-accent-text: #fffdf8;
|
||||||
--amare-color-success: #166534;
|
--amare-color-success: #166534;
|
||||||
--amare-color-warning: #92400e;
|
--amare-color-warning: #92400e;
|
||||||
--amare-color-error: #991b1b;
|
--amare-color-error: #991b1b;
|
||||||
|
|||||||
37
resources/views/components/fonts.blade.php
Normal file
37
resources/views/components/fonts.blade.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
@php
|
||||||
|
$manifestPath = public_path('build/fonts-manifest.json');
|
||||||
|
$hotManifestPath = public_path('hot') !== '' && is_file(public_path('build/fonts-manifest.dev.json'))
|
||||||
|
? public_path('build/fonts-manifest.dev.json')
|
||||||
|
: null;
|
||||||
|
|
||||||
|
$manifestFile = is_file($manifestPath) ? $manifestPath : $hotManifestPath;
|
||||||
|
$manifest = is_string($manifestFile) && is_file($manifestFile)
|
||||||
|
? json_decode((string) file_get_contents($manifestFile), true)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
$cssFile = is_array($manifest) ? ($manifest['style']['file'] ?? null) : null;
|
||||||
|
$preloads = is_array($manifest) ? ($manifest['preloads'] ?? []) : [];
|
||||||
|
$familyStyles = is_array($manifest) ? ($manifest['style']['familyStyles'] ?? []) : [];
|
||||||
|
$variables = is_array($manifest) ? ($manifest['style']['variables'] ?? []) : [];
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@if (is_array($manifest))
|
||||||
|
@foreach ($preloads as $preload)
|
||||||
|
<link
|
||||||
|
rel="preload"
|
||||||
|
as="{{ $preload['as'] ?? 'font' }}"
|
||||||
|
href="{{ asset('build/'.$preload['file']) }}"
|
||||||
|
type="{{ $preload['type'] ?? 'font/woff2' }}"
|
||||||
|
crossorigin="{{ $preload['crossorigin'] ?? 'anonymous' }}"
|
||||||
|
>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
@if (filled($cssFile))
|
||||||
|
<link rel="stylesheet" href="{{ asset('build/'.$cssFile) }}">
|
||||||
|
@elseif ($familyStyles !== [])
|
||||||
|
<style>
|
||||||
|
{!! implode("\n", array_values($variables)) !!}
|
||||||
|
{!! implode("\n", array_values($familyStyles)) !!}
|
||||||
|
</style>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
37
resources/views/components/home/cases.blade.php
Normal file
37
resources/views/components/home/cases.blade.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
@props([
|
||||||
|
'cases',
|
||||||
|
])
|
||||||
|
|
||||||
|
@if ($cases->isNotEmpty())
|
||||||
|
<section aria-labelledby="cases-heading" class="border-b border-amare-border py-16">
|
||||||
|
<div class="container-amare space-y-8">
|
||||||
|
<div class="max-w-2xl space-y-3">
|
||||||
|
<h2 id="cases-heading" class="text-3xl font-semibold text-amare-text">Casos selecionados</h2>
|
||||||
|
<p class="text-amare-text-muted">Histórias recentes de celebrações conduzidas pela Amare.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid gap-8">
|
||||||
|
@foreach ($cases as $case)
|
||||||
|
<article class="grid gap-4 border-t border-amare-border pt-6 md:grid-cols-[200px_minmax(0,1fr)]">
|
||||||
|
@if (filled($case->cover_image_path))
|
||||||
|
<x-media.image
|
||||||
|
:path="$case->cover_image_path"
|
||||||
|
:alt="$case->cover_image_alt ?: $case->title"
|
||||||
|
sizes="200px"
|
||||||
|
class="aspect-square w-full object-cover"
|
||||||
|
/>
|
||||||
|
@endif
|
||||||
|
<div class="space-y-2">
|
||||||
|
<h3 class="text-2xl font-semibold text-amare-text">{{ $case->title }}</h3>
|
||||||
|
<p class="text-sm text-amare-text-muted">{{ $case->event_type }}@if($case->city) · {{ $case->city }}@endif</p>
|
||||||
|
<p class="text-amare-text-muted">{{ $case->summary }}</p>
|
||||||
|
<a href="{{ url('/portfolio/'.$case->slug) }}" class="inline-flex text-sm font-semibold text-amare-accent hover:text-amare-accent-hover">
|
||||||
|
Ver caso
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endif
|
||||||
20
resources/views/components/home/final-cta.blade.php
Normal file
20
resources/views/components/home/final-cta.blade.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
@props([
|
||||||
|
'settings',
|
||||||
|
])
|
||||||
|
|
||||||
|
<section aria-labelledby="final-cta-heading" class="py-16">
|
||||||
|
<div class="container-amare rounded-xl border border-amare-border bg-amare-bg-muted px-8 py-12 text-center">
|
||||||
|
<h2 id="final-cta-heading" class="text-3xl font-semibold text-amare-text">Vamos planejar o seu evento?</h2>
|
||||||
|
<p class="mx-auto mt-3 max-w-2xl text-amare-text-muted">
|
||||||
|
Conte um pouco do que você imagina. A próxima conversa começa no briefing.
|
||||||
|
</p>
|
||||||
|
<div class="mt-8">
|
||||||
|
<a
|
||||||
|
href="{{ route('contact') }}"
|
||||||
|
class="inline-flex items-center rounded-md bg-amare-accent px-5 py-3 text-sm font-semibold text-amare-accent-text transition-colors duration-(--amare-duration-normal) ease-(--amare-ease-standard) hover:bg-amare-accent-hover"
|
||||||
|
>
|
||||||
|
{{ $settings->hero_cta_label }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
43
resources/views/components/home/hero.blade.php
Normal file
43
resources/views/components/home/hero.blade.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
@props([
|
||||||
|
'settings',
|
||||||
|
])
|
||||||
|
|
||||||
|
<section aria-labelledby="hero-heading" class="relative overflow-hidden border-b border-amare-border bg-amare-bg">
|
||||||
|
<div class="container-amare grid gap-10 py-16 md:grid-cols-[minmax(0,1.1fr)_minmax(0,0.9fr)] md:items-center md:py-24">
|
||||||
|
<div class="space-y-6">
|
||||||
|
@if (filled($settings->hero_eyebrow))
|
||||||
|
<p class="text-sm font-medium uppercase tracking-[0.18em] text-amare-accent">{{ $settings->hero_eyebrow }}</p>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<h1 id="hero-heading" class="max-w-3xl text-4xl font-semibold tracking-tight text-amare-text md:text-5xl">
|
||||||
|
{{ $settings->hero_title }}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
@if (filled($settings->hero_subtitle))
|
||||||
|
<p class="max-w-2xl text-lg text-amare-text-muted">{{ $settings->hero_subtitle }}</p>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<a
|
||||||
|
href="{{ route('contact') }}"
|
||||||
|
data-testid="home-primary-cta"
|
||||||
|
class="inline-flex items-center rounded-md bg-amare-accent px-5 py-3 text-sm font-semibold text-amare-accent-text transition-colors duration-(--amare-duration-normal) ease-(--amare-ease-standard) hover:bg-amare-accent-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-3 focus-visible:outline-amare-accent"
|
||||||
|
>
|
||||||
|
{{ $settings->hero_cta_label }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (filled($settings->default_og_image_path))
|
||||||
|
<div class="min-h-72 overflow-hidden rounded-xl bg-amare-bg-muted">
|
||||||
|
<x-media.image
|
||||||
|
:path="$settings->default_og_image_path"
|
||||||
|
:alt="$settings->default_og_image_alt ?: $settings->brand_name"
|
||||||
|
loading="eager"
|
||||||
|
sizes="(max-width: 768px) 100vw, 40vw"
|
||||||
|
class="h-full w-full object-cover"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
21
resources/views/components/home/method.blade.php
Normal file
21
resources/views/components/home/method.blade.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
@props([
|
||||||
|
'settings',
|
||||||
|
])
|
||||||
|
|
||||||
|
<section aria-labelledby="method-heading" class="border-b border-amare-border bg-amare-bg-muted py-16">
|
||||||
|
<div class="container-amare grid gap-8 md:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)] md:items-start">
|
||||||
|
<div class="space-y-3">
|
||||||
|
<h2 id="method-heading" class="text-3xl font-semibold text-amare-text">Método de trabalho</h2>
|
||||||
|
<p class="text-amare-text-muted">Do briefing ao dia do evento, com clareza e acompanhamento próximo.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="space-y-4 text-amare-text-muted">
|
||||||
|
<p>{{ $settings->about_summary }}</p>
|
||||||
|
<ol class="grid gap-3">
|
||||||
|
<li>1. Escuta e briefing inicial</li>
|
||||||
|
<li>2. Planejamento e curadoria</li>
|
||||||
|
<li>3. Coordenação no dia do evento</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
31
resources/views/components/home/proof.blade.php
Normal file
31
resources/views/components/home/proof.blade.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
@props([
|
||||||
|
'cases',
|
||||||
|
])
|
||||||
|
|
||||||
|
@if ($cases->isNotEmpty())
|
||||||
|
<section aria-labelledby="proof-heading" class="border-b border-amare-border bg-amare-bg-muted py-16">
|
||||||
|
<div class="container-amare space-y-8">
|
||||||
|
<div class="max-w-2xl space-y-3">
|
||||||
|
<h2 id="proof-heading" class="text-3xl font-semibold text-amare-text">Prova visual</h2>
|
||||||
|
<p class="text-amare-text-muted">Eventos em destaque que mostram o cuidado com cada celebração.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
|
||||||
|
@foreach ($cases as $case)
|
||||||
|
<article class="space-y-3">
|
||||||
|
@if (filled($case->cover_image_path))
|
||||||
|
<x-media.image
|
||||||
|
:path="$case->cover_image_path"
|
||||||
|
:alt="$case->cover_image_alt ?: $case->title"
|
||||||
|
sizes="(max-width: 768px) 100vw, 33vw"
|
||||||
|
class="aspect-[4/3] w-full object-cover"
|
||||||
|
/>
|
||||||
|
@endif
|
||||||
|
<h3 class="text-xl font-semibold text-amare-text">{{ $case->title }}</h3>
|
||||||
|
<p class="text-sm text-amare-text-muted">{{ $case->summary }}</p>
|
||||||
|
</article>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endif
|
||||||
29
resources/views/components/home/services.blade.php
Normal file
29
resources/views/components/home/services.blade.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
@props([
|
||||||
|
'services',
|
||||||
|
])
|
||||||
|
|
||||||
|
@if ($services->isNotEmpty())
|
||||||
|
<section aria-labelledby="services-heading" class="border-b border-amare-border py-16">
|
||||||
|
<div class="container-amare space-y-8">
|
||||||
|
<div class="max-w-2xl space-y-3">
|
||||||
|
<h2 id="services-heading" class="text-3xl font-semibold text-amare-text">Serviços</h2>
|
||||||
|
<p class="text-amare-text-muted">Um resumo do que a assessoria pode conduzir com você.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
|
||||||
|
@foreach ($services as $service)
|
||||||
|
<article class="space-y-3 border-t border-amare-border pt-4">
|
||||||
|
<h3 class="text-xl font-semibold text-amare-text">{{ $service->title }}</h3>
|
||||||
|
<p class="text-amare-text-muted">{{ $service->summary }}</p>
|
||||||
|
</article>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="{{ url('/servicos') }}" class="text-sm font-semibold text-amare-accent transition-colors hover:text-amare-accent-hover">
|
||||||
|
Ver todos os serviços
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endif
|
||||||
28
resources/views/components/home/testimonials.blade.php
Normal file
28
resources/views/components/home/testimonials.blade.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
@props([
|
||||||
|
'testimonials',
|
||||||
|
])
|
||||||
|
|
||||||
|
@if ($testimonials->isNotEmpty())
|
||||||
|
<section aria-labelledby="testimonials-heading" class="border-b border-amare-border bg-amare-bg-muted py-16">
|
||||||
|
<div class="container-amare space-y-8">
|
||||||
|
<div class="max-w-2xl space-y-3">
|
||||||
|
<h2 id="testimonials-heading" class="text-3xl font-semibold text-amare-text">Depoimentos</h2>
|
||||||
|
<p class="text-amare-text-muted">Quem celebrou com a Amare conta como foi a experiência.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid gap-6 md:grid-cols-2">
|
||||||
|
@foreach ($testimonials as $testimonial)
|
||||||
|
<blockquote class="space-y-4 border-t border-amare-border pt-4">
|
||||||
|
<p class="text-lg text-amare-text">“{{ $testimonial->quote }}”</p>
|
||||||
|
<footer class="text-sm text-amare-text-muted">
|
||||||
|
<cite class="not-italic font-semibold text-amare-text">{{ $testimonial->author_name }}</cite>
|
||||||
|
@if (filled($testimonial->context))
|
||||||
|
<span> — {{ $testimonial->context }}</span>
|
||||||
|
@endif
|
||||||
|
</footer>
|
||||||
|
</blockquote>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endif
|
||||||
47
resources/views/components/media/image.blade.php
Normal file
47
resources/views/components/media/image.blade.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
@props([
|
||||||
|
'path',
|
||||||
|
'alt',
|
||||||
|
'sizes' => '(max-width: 768px) 100vw, 960px',
|
||||||
|
'loading' => 'lazy',
|
||||||
|
'width' => null,
|
||||||
|
'height' => null,
|
||||||
|
'disk' => null,
|
||||||
|
'class' => null,
|
||||||
|
])
|
||||||
|
|
||||||
|
@php
|
||||||
|
use App\Support\PublicImageUploadRules;
|
||||||
|
use App\Support\ResponsiveImage;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
$diskName = $disk ?? PublicImageUploadRules::disk();
|
||||||
|
$filesystem = Storage::disk($diskName);
|
||||||
|
$src = $filesystem->url($path);
|
||||||
|
$variants = ResponsiveImage::availableVariants($path, $diskName);
|
||||||
|
$srcset = collect($variants)
|
||||||
|
->map(fn (array $variant): string => $filesystem->url($variant['path']).' '.$variant['width'].'w')
|
||||||
|
->implode(', ');
|
||||||
|
|
||||||
|
if ($srcset === '' && $filesystem->exists($path)) {
|
||||||
|
$srcset = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dimensions = ($width === null || $height === null)
|
||||||
|
? ResponsiveImage::dimensions($path, $diskName)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
$resolvedWidth = $width ?? $dimensions['width'] ?? null;
|
||||||
|
$resolvedHeight = $height ?? $dimensions['height'] ?? null;
|
||||||
|
$loadingValue = $loading === 'eager' ? 'eager' : 'lazy';
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<img
|
||||||
|
src="{{ $src }}"
|
||||||
|
@if ($srcset) srcset="{{ $srcset }}" sizes="{{ $sizes }}" @endif
|
||||||
|
alt="{{ $alt }}"
|
||||||
|
@if ($resolvedWidth) width="{{ $resolvedWidth }}" @endif
|
||||||
|
@if ($resolvedHeight) height="{{ $resolvedHeight }}" @endif
|
||||||
|
loading="{{ $loadingValue }}"
|
||||||
|
@if ($class) class="{{ $class }}" @endif
|
||||||
|
{{ $attributes->except(['path', 'alt', 'sizes', 'loading', 'width', 'height', 'disk', 'class']) }}
|
||||||
|
>
|
||||||
21
resources/views/components/seo/meta.blade.php
Normal file
21
resources/views/components/seo/meta.blade.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
@props([
|
||||||
|
'pageMeta',
|
||||||
|
])
|
||||||
|
|
||||||
|
<meta name="description" content="{{ $pageMeta->description }}">
|
||||||
|
<link rel="canonical" href="{{ $pageMeta->canonical }}">
|
||||||
|
|
||||||
|
<meta property="og:title" content="{{ $pageMeta->title }}">
|
||||||
|
<meta property="og:description" content="{{ $pageMeta->description }}">
|
||||||
|
<meta property="og:type" content="{{ $pageMeta->ogType }}">
|
||||||
|
<meta property="og:url" content="{{ $pageMeta->canonical }}">
|
||||||
|
@if ($pageMeta->ogImageUrl)
|
||||||
|
<meta property="og:image" content="{{ $pageMeta->ogImageUrl }}">
|
||||||
|
@if ($pageMeta->ogImageAlt)
|
||||||
|
<meta property="og:image:alt" content="{{ $pageMeta->ogImageAlt }}">
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($pageMeta->jsonLd)
|
||||||
|
<script type="application/ld+json">{!! json_encode($pageMeta->jsonLd, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) !!}</script>
|
||||||
|
@endif
|
||||||
14
resources/views/errors/404.blade.php
Normal file
14
resources/views/errors/404.blade.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
@extends('layouts.public')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-amare max-w-2xl space-y-6 py-8 text-center">
|
||||||
|
<p class="text-sm uppercase tracking-[0.18em] text-amare-accent">Erro 404</p>
|
||||||
|
<h1 class="text-4xl font-semibold text-amare-text">Página não encontrada</h1>
|
||||||
|
<p class="text-amare-text-muted">O endereço que você tentou abrir não existe ou foi movido.</p>
|
||||||
|
<p>
|
||||||
|
<a href="{{ route('home') }}" class="inline-flex rounded-md bg-amare-accent px-5 py-3 text-sm font-semibold text-amare-accent-text hover:bg-amare-accent-hover">
|
||||||
|
Voltar para a home
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
14
resources/views/errors/500.blade.php
Normal file
14
resources/views/errors/500.blade.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
@extends('layouts.public')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-amare max-w-2xl space-y-6 py-8 text-center">
|
||||||
|
<p class="text-sm uppercase tracking-[0.18em] text-amare-accent">Erro 500</p>
|
||||||
|
<h1 class="text-4xl font-semibold text-amare-text">Algo deu errado</h1>
|
||||||
|
<p class="text-amare-text-muted">Não foi possível concluir o pedido agora. Tente novamente em instantes.</p>
|
||||||
|
<p>
|
||||||
|
<a href="{{ route('home') }}" class="inline-flex rounded-md bg-amare-accent px-5 py-3 text-sm font-semibold text-amare-accent-text hover:bg-amare-accent-hover">
|
||||||
|
Voltar para a home
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -5,8 +5,10 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="color-scheme" content="light">
|
<meta name="color-scheme" content="light">
|
||||||
|
|
||||||
<title>@yield('title', config('app.name'))</title>
|
<title>{{ $pageMeta->title }}</title>
|
||||||
|
<x-seo.meta :page-meta="$pageMeta" />
|
||||||
|
|
||||||
|
<x-fonts />
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
</head>
|
</head>
|
||||||
<body class="min-h-screen antialiased">
|
<body class="min-h-screen antialiased">
|
||||||
@@ -15,10 +17,18 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<header class="border-b border-amare-border bg-amare-bg">
|
<header class="border-b border-amare-border bg-amare-bg">
|
||||||
<div class="container-amare flex items-center justify-between py-4">
|
<div class="container-amare flex items-center justify-between gap-6 py-4">
|
||||||
<a href="{{ url('/') }}" class="text-lg font-semibold text-amare-text transition-colors duration-(--amare-duration-normal) ease-(--amare-ease-standard) hover:text-amare-accent">
|
<a href="{{ url('/') }}" class="text-lg font-semibold text-amare-text transition-colors duration-(--amare-duration-normal) ease-(--amare-ease-standard) hover:text-amare-accent">
|
||||||
{{ config('app.name') }}
|
{{ $siteSettings->brand_name }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<nav aria-label="Principal" class="flex flex-wrap items-center gap-4 text-sm text-amare-text-muted">
|
||||||
|
<a href="{{ route('home') }}" class="transition-colors hover:text-amare-accent">Início</a>
|
||||||
|
<a href="{{ route('services.index') }}" class="transition-colors hover:text-amare-accent">Serviços</a>
|
||||||
|
<a href="{{ route('portfolio.index') }}" class="transition-colors hover:text-amare-accent">Portfólio</a>
|
||||||
|
<a href="{{ route('about') }}" class="transition-colors hover:text-amare-accent">Sobre</a>
|
||||||
|
<a href="{{ route('contact') }}" class="transition-colors hover:text-amare-accent">Contato</a>
|
||||||
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -27,9 +37,40 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="border-t border-amare-border bg-amare-bg-muted">
|
<footer class="border-t border-amare-border bg-amare-bg-muted">
|
||||||
<div class="container-amare py-8 text-sm text-amare-text-muted">
|
<div class="container-amare flex flex-col gap-4 py-8 text-sm text-amare-text-muted md:flex-row md:items-start md:justify-between">
|
||||||
<p>© {{ now()->year }} {{ config('app.name') }}. Todos os direitos reservados.</p>
|
<div class="space-y-2">
|
||||||
|
<p class="font-medium text-amare-text">{{ $siteSettings->brand_name }}</p>
|
||||||
|
@if ($siteSettings->email)
|
||||||
|
<p>
|
||||||
|
<a href="mailto:{{ $siteSettings->email }}" class="transition-colors hover:text-amare-accent">{{ $siteSettings->email }}</a>
|
||||||
|
</p>
|
||||||
|
@endif
|
||||||
|
@if ($siteSettings->phone)
|
||||||
|
<p>{{ $siteSettings->phone }}</p>
|
||||||
|
@endif
|
||||||
|
@if ($siteSettings->city)
|
||||||
|
<p>{{ $siteSettings->city }}</p>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="space-y-2">
|
||||||
|
<p class="font-medium text-amare-text">Links</p>
|
||||||
|
<p><a href="{{ route('privacy') }}" class="transition-colors hover:text-amare-accent">Política de privacidade</a></p>
|
||||||
|
@foreach ($siteSettings->social_links ?? [] as $network => $url)
|
||||||
|
@if (filled($url))
|
||||||
|
<p>
|
||||||
|
<a href="{{ $url }}" class="transition-colors hover:text-amare-accent" rel="noopener noreferrer" target="_blank">{{ ucfirst((string) $network) }}</a>
|
||||||
|
</p>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>© {{ now()->year }} {{ $siteSettings->brand_name }}. Todos os direitos reservados.</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
@if ($siteSettings->analytics_enabled && filled($siteSettings->analytics_script))
|
||||||
|
{!! $siteSettings->analytics_script !!}
|
||||||
|
@endif
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
12
resources/views/pages/about.blade.php
Normal file
12
resources/views/pages/about.blade.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
@extends('layouts.public')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-amare max-w-3xl space-y-6">
|
||||||
|
<h1 class="text-4xl font-semibold text-amare-text">Sobre</h1>
|
||||||
|
<p class="text-lg text-amare-text-muted">{{ $siteSettings->about_summary }}</p>
|
||||||
|
<p class="text-amare-text-muted">
|
||||||
|
A {{ $siteSettings->brand_name }} atua em {{ $siteSettings->city }} com foco em planejamento completo,
|
||||||
|
presença no dia do evento e uma condução serena do início ao fim.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
28
resources/views/pages/contact.blade.php
Normal file
28
resources/views/pages/contact.blade.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
@extends('layouts.public')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-amare space-y-6">
|
||||||
|
<h1 class="text-4xl font-semibold text-amare-text">Contato</h1>
|
||||||
|
<p class="max-w-2xl text-amare-text-muted">
|
||||||
|
Em breve você poderá enviar um briefing por aqui. Enquanto isso, fale conosco pelos canais abaixo.
|
||||||
|
</p>
|
||||||
|
<div class="space-y-2 text-amare-text-muted">
|
||||||
|
@if ($siteSettings->email)
|
||||||
|
<p><a href="mailto:{{ $siteSettings->email }}" class="text-amare-accent hover:text-amare-accent-hover">{{ $siteSettings->email }}</a></p>
|
||||||
|
@endif
|
||||||
|
@if ($siteSettings->phone)
|
||||||
|
<p>{{ $siteSettings->phone }}</p>
|
||||||
|
@endif
|
||||||
|
@if ($siteSettings->city)
|
||||||
|
<p>{{ $siteSettings->city }}</p>
|
||||||
|
@endif
|
||||||
|
@foreach ($siteSettings->social_links ?? [] as $network => $url)
|
||||||
|
@if (filled($url))
|
||||||
|
<p>
|
||||||
|
<a href="{{ $url }}" class="text-amare-accent hover:text-amare-accent-hover" rel="noopener noreferrer" target="_blank">{{ ucfirst((string) $network) }}</a>
|
||||||
|
</p>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -1,20 +1,11 @@
|
|||||||
@extends('layouts.public')
|
@extends('layouts.public')
|
||||||
|
|
||||||
@section('title', config('app.name'))
|
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container-amare">
|
<x-home.hero :settings="$content->settings" />
|
||||||
<section class="rounded-xl border border-amare-border bg-amare-bg-muted p-8 shadow-amare-md">
|
<x-home.proof :cases="$content->featuredCases" />
|
||||||
<p class="mb-3 text-sm font-medium uppercase tracking-wide text-amare-accent">Assessoria de eventos</p>
|
<x-home.services :services="$content->featuredServices" />
|
||||||
<h1 class="mb-4 text-4xl font-semibold text-amare-text">Em breve</h1>
|
<x-home.method :settings="$content->settings" />
|
||||||
<p class="max-w-2xl text-lg text-amare-text-muted">
|
<x-home.cases :cases="$content->featuredCases" />
|
||||||
Estamos preparando a nova presença digital da assessoria. Em breve você poderá conhecer nossos serviços e solicitar um briefing.
|
<x-home.testimonials :testimonials="$content->testimonials" />
|
||||||
</p>
|
<x-home.final-cta :settings="$content->settings" />
|
||||||
<div class="mt-8">
|
|
||||||
<span class="inline-flex items-center rounded-full border border-amare-border bg-amare-bg px-4 py-2 text-sm text-amare-text">
|
|
||||||
Fase 0 — Fundação concluída
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
39
resources/views/pages/portfolio/index.blade.php
Normal file
39
resources/views/pages/portfolio/index.blade.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
@extends('layouts.public')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-amare space-y-10">
|
||||||
|
<div class="max-w-2xl space-y-3">
|
||||||
|
<h1 class="text-4xl font-semibold text-amare-text">Portfólio</h1>
|
||||||
|
<p class="text-lg text-amare-text-muted">Casos reais de celebrações conduzidas com atenção a cada detalhe.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if ($cases->isEmpty())
|
||||||
|
<p class="text-amare-text-muted">Em breve publicaremos novos casos.</p>
|
||||||
|
@else
|
||||||
|
<div class="grid gap-8 md:grid-cols-2 lg:grid-cols-3">
|
||||||
|
@foreach ($cases as $case)
|
||||||
|
<article class="space-y-3">
|
||||||
|
@if (filled($case->cover_image_path))
|
||||||
|
<a href="{{ route('portfolio.show', $case->slug) }}">
|
||||||
|
<x-media.image
|
||||||
|
:path="$case->cover_image_path"
|
||||||
|
:alt="$case->cover_image_alt ?: $case->title"
|
||||||
|
sizes="(max-width: 768px) 100vw, 33vw"
|
||||||
|
class="aspect-[4/3] w-full object-cover"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
<h2 class="text-xl font-semibold text-amare-text">
|
||||||
|
<a href="{{ route('portfolio.show', $case->slug) }}" class="hover:text-amare-accent">{{ $case->title }}</a>
|
||||||
|
</h2>
|
||||||
|
<p class="text-sm text-amare-text-muted">{{ $case->summary }}</p>
|
||||||
|
</article>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{{ $cases->links() }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
64
resources/views/pages/portfolio/show.blade.php
Normal file
64
resources/views/pages/portfolio/show.blade.php
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
@extends('layouts.public')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<article class="container-amare space-y-10">
|
||||||
|
<header class="max-w-3xl space-y-4">
|
||||||
|
<p class="text-sm uppercase tracking-[0.18em] text-amare-accent">{{ $case->event_type }}</p>
|
||||||
|
<h1 class="text-4xl font-semibold text-amare-text">{{ $case->title }}</h1>
|
||||||
|
<p class="text-lg text-amare-text-muted">{{ $case->summary }}</p>
|
||||||
|
<p class="text-sm text-amare-text-muted">
|
||||||
|
@if ($case->city){{ $case->city }}@endif
|
||||||
|
@if ($case->venue) · {{ $case->venue }}@endif
|
||||||
|
@if ($case->event_date) · {{ $case->event_date->format('d/m/Y') }}@endif
|
||||||
|
</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
@if (filled($case->cover_image_path))
|
||||||
|
<x-media.image
|
||||||
|
:path="$case->cover_image_path"
|
||||||
|
:alt="$case->cover_image_alt ?: $case->title"
|
||||||
|
loading="eager"
|
||||||
|
sizes="(max-width: 1024px) 100vw, 72rem"
|
||||||
|
class="aspect-[16/9] w-full object-cover"
|
||||||
|
/>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="grid gap-8 md:grid-cols-3">
|
||||||
|
<section class="space-y-2">
|
||||||
|
<h2 class="text-xl font-semibold text-amare-text">Desafio</h2>
|
||||||
|
<p class="text-amare-text-muted">{!! nl2br(e($case->challenge)) !!}</p>
|
||||||
|
</section>
|
||||||
|
<section class="space-y-2">
|
||||||
|
<h2 class="text-xl font-semibold text-amare-text">Solução</h2>
|
||||||
|
<p class="text-amare-text-muted">{!! nl2br(e($case->solution)) !!}</p>
|
||||||
|
</section>
|
||||||
|
@if (filled($case->result))
|
||||||
|
<section class="space-y-2">
|
||||||
|
<h2 class="text-xl font-semibold text-amare-text">Resultado</h2>
|
||||||
|
<p class="text-amare-text-muted">{!! nl2br(e($case->result)) !!}</p>
|
||||||
|
</section>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if ($case->images->isNotEmpty())
|
||||||
|
<section aria-labelledby="gallery-heading" class="space-y-6">
|
||||||
|
<h2 id="gallery-heading" class="text-2xl font-semibold text-amare-text">Galeria</h2>
|
||||||
|
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||||
|
@foreach ($case->images as $image)
|
||||||
|
<figure class="space-y-2">
|
||||||
|
<x-media.image
|
||||||
|
:path="$image->path"
|
||||||
|
:alt="$image->alt_text"
|
||||||
|
sizes="(max-width: 768px) 100vw, 33vw"
|
||||||
|
class="aspect-square w-full object-cover"
|
||||||
|
/>
|
||||||
|
@if (filled($image->caption))
|
||||||
|
<figcaption class="text-sm text-amare-text-muted">{{ $image->caption }}</figcaption>
|
||||||
|
@endif
|
||||||
|
</figure>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endif
|
||||||
|
</article>
|
||||||
|
@endsection
|
||||||
15
resources/views/pages/privacy.blade.php
Normal file
15
resources/views/pages/privacy.blade.php
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
@extends('layouts.public')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-amare max-w-3xl space-y-6">
|
||||||
|
<h1 class="text-4xl font-semibold text-amare-text">Política de privacidade</h1>
|
||||||
|
<p class="text-amare-text-muted">
|
||||||
|
A {{ $siteSettings->brand_name }} trata dados pessoais com responsabilidade e somente para finalidades
|
||||||
|
relacionadas ao atendimento de interessados e à operação do site.
|
||||||
|
</p>
|
||||||
|
<p class="text-amare-text-muted">
|
||||||
|
Para dúvidas sobre privacidade, escreva para
|
||||||
|
<a href="mailto:{{ $siteSettings->email }}" class="text-amare-accent hover:text-amare-accent-hover">{{ $siteSettings->email }}</a>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
36
resources/views/pages/services/index.blade.php
Normal file
36
resources/views/pages/services/index.blade.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
@extends('layouts.public')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-amare space-y-10">
|
||||||
|
<div class="max-w-2xl space-y-3">
|
||||||
|
<h1 class="text-4xl font-semibold text-amare-text">Serviços</h1>
|
||||||
|
<p class="text-lg text-amare-text-muted">Assessoria completa para casamentos e eventos corporativos.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if ($services->isEmpty())
|
||||||
|
<p class="text-amare-text-muted">Em breve publicaremos o catálogo de serviços.</p>
|
||||||
|
@else
|
||||||
|
<div class="grid gap-8 md:grid-cols-2">
|
||||||
|
@foreach ($services as $service)
|
||||||
|
<article class="space-y-3 border-t border-amare-border pt-6">
|
||||||
|
@if (filled($service->cover_image_path))
|
||||||
|
<x-media.image
|
||||||
|
:path="$service->cover_image_path"
|
||||||
|
:alt="$service->cover_image_alt ?: $service->title"
|
||||||
|
sizes="(max-width: 768px) 100vw, 50vw"
|
||||||
|
class="aspect-[16/10] w-full object-cover"
|
||||||
|
/>
|
||||||
|
@endif
|
||||||
|
<h2 class="text-2xl font-semibold text-amare-text">{{ $service->title }}</h2>
|
||||||
|
<p class="text-amare-text-muted">{{ $service->summary }}</p>
|
||||||
|
@if (filled($service->description))
|
||||||
|
<div class="prose prose-amare max-w-none text-amare-text-muted">
|
||||||
|
{!! nl2br(e($service->description)) !!}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</article>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
11
resources/views/pages/sitemap.blade.php
Normal file
11
resources/views/pages/sitemap.blade.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{!! '<'.'?xml version="1.0" encoding="UTF-8"?>' !!}
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
@foreach ($entries as $entry)
|
||||||
|
<url>
|
||||||
|
<loc>{{ $entry['loc'] }}</loc>
|
||||||
|
@if (! empty($entry['lastmod']))
|
||||||
|
<lastmod>{{ $entry['lastmod'] }}</lastmod>
|
||||||
|
@endif
|
||||||
|
</url>
|
||||||
|
@endforeach
|
||||||
|
</urlset>
|
||||||
@@ -2,6 +2,21 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use App\Http\Controllers\PublicSite\HomeController;
|
||||||
|
use App\Http\Controllers\PublicSite\PageController;
|
||||||
|
use App\Http\Controllers\PublicSite\PortfolioController;
|
||||||
|
use App\Http\Controllers\PublicSite\RobotsController;
|
||||||
|
use App\Http\Controllers\PublicSite\ServiceController;
|
||||||
|
use App\Http\Controllers\PublicSite\SitemapController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
Route::view('/', 'pages.home')->name('home');
|
Route::get('/', HomeController::class)->name('home');
|
||||||
|
|
||||||
|
Route::get('/servicos', [ServiceController::class, 'index'])->name('services.index');
|
||||||
|
Route::get('/portfolio', [PortfolioController::class, 'index'])->name('portfolio.index');
|
||||||
|
Route::get('/portfolio/{slug}', [PortfolioController::class, 'show'])->name('portfolio.show');
|
||||||
|
Route::get('/sobre', [PageController::class, 'about'])->name('about');
|
||||||
|
Route::get('/privacidade', [PageController::class, 'privacy'])->name('privacy');
|
||||||
|
Route::get('/contato', [PageController::class, 'contact'])->name('contact');
|
||||||
|
Route::get('/sitemap.xml', SitemapController::class)->name('sitemap');
|
||||||
|
Route::get('/robots.txt', RobotsController::class)->name('robots');
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user