Update documentation for hybrid setup approach

This commit is contained in:
2026-03-09 03:52:30 +02:00
parent c5260e652b
commit 1e868b3ac1
2 changed files with 85 additions and 72 deletions

View File

@@ -4,12 +4,17 @@ This document provides context for AI coding assistants working on projects buil
## Template Overview ## Template Overview
This is a **Laravel Docker Development Template** with: This is a **ready-to-use Laravel Docker Development Template** with everything pre-installed:
- Docker-based development environment - ✅ Laravel 11 with Breeze authentication (Blade + dark mode)
- Production deployment to Ubuntu 24.04 (no Docker) - ✅ Filament v3.3 admin panel with user management
- Modular architecture with Filament admin - ✅ Pest testing framework
- Audit trail for all data changes - ✅ Laravel Pint code style
- Multi-database support (MySQL, PostgreSQL, SQLite) - ✅ Docker-based development environment
- ✅ Production deployment to Ubuntu 24.04 (no Docker)
- ✅ Modular architecture
- ✅ Multi-database support (MySQL, PostgreSQL, SQLite)
**Setup time:** 2 minutes - just run `./setup.sh` and everything is ready!
## Technology Stack ## Technology Stack
@@ -20,7 +25,8 @@ This is a **Laravel Docker Development Template** with:
| **Admin** | Filament 3.x | | **Admin** | Filament 3.x |
| **Database** | MySQL 8 / PostgreSQL 15 / SQLite | | **Database** | MySQL 8 / PostgreSQL 15 / SQLite |
| **Cache/Queue** | Redis | | **Cache/Queue** | Redis |
| **Auth** | Laravel Breeze or Jetstream (Livewire only) | | **Auth** | Laravel Breeze (Blade + Livewire) - PRE-INSTALLED |
| **Testing** | Pest - PRE-INSTALLED |
| **Permissions** | spatie/laravel-permission | | **Permissions** | spatie/laravel-permission |
| **Audit** | owen-it/laravel-auditing | | **Audit** | owen-it/laravel-auditing |
| **Error Tracking** | spatie/laravel-flare + spatie/laravel-ignition | | **Error Tracking** | spatie/laravel-flare + spatie/laravel-ignition |

View File

@@ -1,112 +1,119 @@
# Getting Started # Getting Started
This guide walks you through setting up a new Laravel project using this template. This guide walks you through setting up your Laravel development environment using this template.
## Prerequisites ## Prerequisites
- Docker & Docker Compose - Docker & Docker Compose
- Git - Git
- Make (optional, but recommended)
## Quick Start (5 minutes) ## Quick Start (2 minutes)
**Everything is pre-installed!** Just clone and run:
```bash ```bash
# 1. Clone the template # 1. Clone the template
git clone https://github.com/your-repo/Laravel-Docker-Dev-Template.git my-project git clone https://github.com/your-repo/Laravel-Docker-Dev-Template.git my-project
cd my-project cd my-project
# 2. Copy environment file # 2. Run setup (MySQL is default)
cp .env.example .env ./setup.sh # Linux/Mac
setup.bat # Windows
# 3. Choose your database and start # Or choose a different database:
make install DB=mysql # or: pgsql, sqlite ./setup.sh pgsql # PostgreSQL
./setup.sh sqlite # SQLite
# 4. Run setup scripts (interactive) # 3. Access your app
make setup-tools # Flare, Pint, error pages
make setup-laravel # Auth, Filament, modules, audit trail
# 5. Access your app
# Laravel: http://localhost:8080 # Laravel: http://localhost:8080
# Admin: http://localhost:8080/admin # Admin: http://localhost:8080/admin (admin@example.com / password)
# Mail: http://localhost:8025 # Mail: http://localhost:8025
``` ```
**That's it!** You now have a fully working Laravel application with:
- ✅ Authentication (login, register, password reset)
- ✅ Admin panel with user management
- ✅ Testing framework (Pest)
- ✅ Code style (Pint)
- ✅ Email testing (Mailpit)
## What's Pre-Installed
This template comes with everything configured and ready to use:
### Core Framework
- **Laravel 11** - Latest version with all features
- **Laravel Breeze** - Authentication scaffolding (Blade + dark mode)
- **Livewire** - Reactive components without JavaScript
### Admin & Management
- **Filament v3.3** - Full-featured admin panel
- **User Management** - CRUD interface for users
- **Dashboard** - Admin dashboard with widgets
### Development Tools
- **Pest** - Modern testing framework with elegant syntax
- **Laravel Pint** - Opinionated code style fixer
- **Mailpit** - Email testing tool
### Infrastructure
- **Docker** - Containerized development environment
- **MySQL/PostgreSQL/SQLite** - Choose your database
- **Redis** - Caching and queues
- **Queue Workers** - Background job processing (optional)
- **Scheduler** - Task scheduling (optional)
## Step-by-Step Setup ## Step-by-Step Setup
### 1. Clone and Configure ### 1. Clone the Repository
```bash ```bash
git clone https://github.com/your-repo/Laravel-Docker-Dev-Template.git my-project git clone https://github.com/your-repo/Laravel-Docker-Dev-Template.git my-project
cd my-project cd my-project
# Remove template git history and start fresh # Optional: Remove template git history and start fresh
rm -rf .git rm -rf .git
git init git init
git add .
git commit -m "Initial commit"
``` ```
### 2. Choose Database ### 2. Choose Your Database
| Database | Best For | Command | | Database | Best For | Command |
|----------|----------|---------| |----------|----------|---------|
| **MySQL** | Most projects, production parity | `make install DB=mysql` | | **MySQL** | Most projects, production parity | `./setup.sh mysql` |
| **PostgreSQL** | Advanced features, JSON, full-text search | `make install DB=pgsql` | | **PostgreSQL** | Advanced features, JSON, full-text search | `./setup.sh pgsql` |
| **SQLite** | Simple apps, quick prototyping | `make install DB=sqlite` | | **SQLite** | Simple apps, quick prototyping | `./setup.sh sqlite` |
### 3. Install Laravel ### 3. Run Setup Script
```bash ```bash
# Start containers and create Laravel project ./setup.sh mysql # Linux/Mac
make install DB=mysql setup.bat mysql # Windows
# This will:
# - Build Docker images
# - Start containers
# - Run composer create-project laravel/laravel
# - Copy appropriate .env file
# - Generate app key
# - Run initial migrations
``` ```
### 4. Run Setup Scripts The script will:
- ✅ Configure environment for chosen database
- ✅ Install composer dependencies
- ✅ Build and start Docker containers
- ✅ Run database migrations
- ✅ Create admin user automatically
#### Post-Install Tools ### 4. Start Developing
```bash Your application is now ready! The setup script created an admin user for you:
make setup-tools
```
Installs: **Admin Login:**
- ✅ Spatie Ignition (dev error pages) - Email: `admin@example.com`
- ✅ Spatie Flare (production error tracking) - Password: `password`
- ✅ Laravel Pint (code style)
- ✅ Custom error pages (404, 500, 503)
- ❓ Laravel Telescope (optional debugging)
#### Laravel Base Setup **Access Points:**
- Public site: http://localhost:8080
- Admin panel: http://localhost:8080/admin
- Email testing: http://localhost:8025
```bash ## Common Commands
make setup-laravel
```
Interactive prompts for:
1. **Authentication** - Choose one:
- Breeze + Blade (recommended)
- Breeze + Livewire
- Breeze API only
- Jetstream + Livewire
2. **Filament Admin** - User management dashboard
3. **Audit Trail** - Track all data changes
4. **Module System** - Modular architecture
5. **API (Sanctum)** - Token authentication
6. **Security Middleware** - HTTPS, headers
### 5. Create Your First Module
```bash ```bash
# Shell into container # Shell into container