Update documentation for hybrid setup approach
This commit is contained in:
@@ -1,112 +1,119 @@
|
||||
# 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
|
||||
|
||||
- Docker & Docker Compose
|
||||
- Git
|
||||
- Make (optional, but recommended)
|
||||
|
||||
## Quick Start (5 minutes)
|
||||
## Quick Start (2 minutes)
|
||||
|
||||
**Everything is pre-installed!** Just clone and run:
|
||||
|
||||
```bash
|
||||
# 1. Clone the template
|
||||
git clone https://github.com/your-repo/Laravel-Docker-Dev-Template.git my-project
|
||||
cd my-project
|
||||
|
||||
# 2. Copy environment file
|
||||
cp .env.example .env
|
||||
# 2. Run setup (MySQL is default)
|
||||
./setup.sh # Linux/Mac
|
||||
setup.bat # Windows
|
||||
|
||||
# 3. Choose your database and start
|
||||
make install DB=mysql # or: pgsql, sqlite
|
||||
# Or choose a different database:
|
||||
./setup.sh pgsql # PostgreSQL
|
||||
./setup.sh sqlite # SQLite
|
||||
|
||||
# 4. Run setup scripts (interactive)
|
||||
make setup-tools # Flare, Pint, error pages
|
||||
make setup-laravel # Auth, Filament, modules, audit trail
|
||||
|
||||
# 5. Access your app
|
||||
# 3. Access your app
|
||||
# Laravel: http://localhost:8080
|
||||
# Admin: http://localhost:8080/admin
|
||||
# Admin: http://localhost:8080/admin (admin@example.com / password)
|
||||
# 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
|
||||
|
||||
### 1. Clone and Configure
|
||||
### 1. Clone the Repository
|
||||
|
||||
```bash
|
||||
git clone https://github.com/your-repo/Laravel-Docker-Dev-Template.git my-project
|
||||
cd my-project
|
||||
|
||||
# Remove template git history and start fresh
|
||||
# Optional: Remove template git history and start fresh
|
||||
rm -rf .git
|
||||
git init
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
```
|
||||
|
||||
### 2. Choose Database
|
||||
### 2. Choose Your Database
|
||||
|
||||
| Database | Best For | Command |
|
||||
|----------|----------|---------|
|
||||
| **MySQL** | Most projects, production parity | `make install DB=mysql` |
|
||||
| **PostgreSQL** | Advanced features, JSON, full-text search | `make install DB=pgsql` |
|
||||
| **SQLite** | Simple apps, quick prototyping | `make install DB=sqlite` |
|
||||
| **MySQL** | Most projects, production parity | `./setup.sh mysql` |
|
||||
| **PostgreSQL** | Advanced features, JSON, full-text search | `./setup.sh pgsql` |
|
||||
| **SQLite** | Simple apps, quick prototyping | `./setup.sh sqlite` |
|
||||
|
||||
### 3. Install Laravel
|
||||
### 3. Run Setup Script
|
||||
|
||||
```bash
|
||||
# Start containers and create Laravel project
|
||||
make install DB=mysql
|
||||
|
||||
# This will:
|
||||
# - Build Docker images
|
||||
# - Start containers
|
||||
# - Run composer create-project laravel/laravel
|
||||
# - Copy appropriate .env file
|
||||
# - Generate app key
|
||||
# - Run initial migrations
|
||||
./setup.sh mysql # Linux/Mac
|
||||
setup.bat mysql # Windows
|
||||
```
|
||||
|
||||
### 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
|
||||
make setup-tools
|
||||
```
|
||||
Your application is now ready! The setup script created an admin user for you:
|
||||
|
||||
Installs:
|
||||
- ✅ Spatie Ignition (dev error pages)
|
||||
- ✅ Spatie Flare (production error tracking)
|
||||
- ✅ Laravel Pint (code style)
|
||||
- ✅ Custom error pages (404, 500, 503)
|
||||
- ❓ Laravel Telescope (optional debugging)
|
||||
**Admin Login:**
|
||||
- Email: `admin@example.com`
|
||||
- Password: `password`
|
||||
|
||||
#### Laravel Base Setup
|
||||
**Access Points:**
|
||||
- Public site: http://localhost:8080
|
||||
- Admin panel: http://localhost:8080/admin
|
||||
- Email testing: http://localhost:8025
|
||||
|
||||
```bash
|
||||
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
|
||||
## Common Commands
|
||||
|
||||
```bash
|
||||
# Shell into container
|
||||
|
||||
Reference in New Issue
Block a user