# CafeNaija — Foundation Slice: Setup Instructions

This delivers the **Identity module** (auth + roles/permissions) and the **base design system**
(layout + design tokens + first reusable components). Run these on a machine with internet
access (your laptop, or later, staging).

## 1. Create the base Laravel project

```bash
composer create-project laravel/laravel cafenaija "^11.0"
cd cafenaija
```

(Laravel 11 targets PHP 8.2+; it runs cleanly on your confirmed PHP 8.4.24. If you'd rather pin
to the newest Laravel release available at the time you actually run this, that's fine too —
nothing in this Foundation slice is version-specific.)

## 2. Require the packages this slice depends on

```bash
composer require spatie/laravel-permission
composer require laravel/breeze --dev
php artisan breeze:install blade
```

We use Breeze only to scaffold auth *routes/controllers* quickly — its default Tailwind views
are being replaced entirely with our own Blade/Bootstrap 5 views per the design system below,
so don't worry about Breeze's default look.

## 3. Publish and run the permission package's own migration

```bash
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
php artisan migrate
```

We deliberately do **not** hand-write the roles/permissions migration ourselves — it's the
package's own, generated fresh from `vendor:publish` so it always matches the installed
package version exactly. Hand-copying it risks drift.

## 4. Drop in the files from this delivery

Copy each file below into the matching path in your `cafenaija/` project (same relative path
shown in each file's header comment). Where a file already exists (e.g. `routes/web.php`),
replace it — these are the intended final versions for this slice, not patches.

## 5. Install frontend tooling

```bash
npm install
npm install bootstrap @popperjs/core
```

`resources/css/app.css` and `resources/js/app.js` (provided) wire Bootstrap 5 in via Vite —
no CDN dependency, matches the stack direction (Vite + npm, not CDN links).

## 6. Seed roles

```bash
php artisan db:seed --class=RoleSeeder
```

## 7. Serve and check

```bash
npm run dev    # in one terminal
php artisan serve   # in another
```

Visit `/register`, create an account, then in `php artisan tinker`:
`\App\Domain\Identity\Models\User::first()->assignRole('customer')` to confirm roles work.

---

**What's in this slice:** Identity (users/roles/permissions), the design-token CSS layer, the
base site layout, and two starter Blade components (Button, Card) matching the mockup's visual
language. **Not yet in this slice:** CMS, Commerce, Workspace, or any other domain module —
those come in the following implementation steps per the blueprint's §23 sequence.
