# 🚀 LuSar Web Application

> **Moderna Laravel aplikacija sa Tabler.io Premium dizajnom, razvijena uz pomoć AI tehnologije**

[![Laravel](https://img.shields.io/badge/Laravel-13.1.1-FF2D20?style=for-the-badge&logo=laravel&logoColor=white)](https://laravel.com)
[![PHP](https://img.shields.io/badge/PHP-8.3-777BB4?style=for-the-badge&logo=php&logoColor=white)](https://php.net)
[![Tabler](https://img.shields.io/badge/Tabler-1.4.0_Premium-0054A6?style=for-the-badge)](https://tabler.io)
[![Pest](https://img.shields.io/badge/Pest-4.4.3-FF6384?style=for-the-badge)](https://pestphp.com)

## 📋 O Projektu

**LuSar Web** je profesionalna web aplikacija razvijena za **LuSar d.o.o.**, izgrađena na najnovijoj verziji Laravel frameworka sa integriranim **Tabler.io Premium** admin template dizajnom. Aplikacija je hostana na **Hetzner Cloud** serveru uz **CWP Pro** (CentOS Web Panel) za upravljanje infrastrukturom.

### ✨ Posebnost Projekta

Ovaj projekt je razvijen uz **AI-assisted development** pristup koristeći **Laravel Boost** i **Laravel MCP** (Model Context Protocol) tehnologije, omogućavajući brži i kvalitetniji development proces uz pomoć naprednih AI agenata.

## 🎯 Ključne Značajke

- 🎨 **Tabler.io Premium 1.4.0** - Moderan i responsive admin dashboard
- � **Page CMS Sustav** - Full-featured stranice sa Markdown → HTML konverzijom
- 📚 **WordPress Import** - 14 stranica automatski importovano iz WordPress + Elementor
- ⚡ **Livewire 4** - Dinamički UI bez Javascript frameworka
- 🔐 **Laravel UI autentifikacija** - Kompletna auth infrastruktura sa Tabler dizajnom
- 🤖 **AI-Powered Development** - Laravel Boost & MCP integracija
- 🧪 **Pest Testing Framework** - Moderna PHP testna infrastruktura
- 🎯 **PSR-12 Code Style** - Automatsko formatiranje sa Laravel Pint
- 🌍 **Multi-language Ready** - Laravel Localization za /hr i /en

### 📄 Page CMS Features

Sustav za upravljanje stranicama:
- ✅ **Page Model** sa statusom (draft/published) i SEO poljima
- ✅ **WordPress Import** - Automatski import iz Markdown fajlova (YAML front matter)
- ✅ **Markdown → HTML** konverzija s GitHub Flavored Markdown
- ✅ **Featured images** i meta description podrška
- ✅ **Dynamic routing** - `/{slug}` automatski prikazuje stranicu
- ✅ **14 stranica** importovano: naslovna, usluge, proizvodi, kontakt, itd.

**Importovane stranice:**
- Naslovna (naslovna-2)
- LED Film, Smart Film, Ultratanki prozirni zaslon
- Usluge, Montaža, Servis, Pozivni centar
- Kontakt, Partneri, Društvene mreže
- Politika privatnosti, Opći uvjeti poslovanja

## 🛠️ Technology Stack

### Core Framework
```
🔹 Laravel Framework       13.1.1
🔹 PHP                     8.3.21
🔹 MySQL                   Latest
🔹 Livewire                4.2.1    - Full-stack framework for dynamic UIs
```

### Frontend & UI
```
🔹 Tabler.io Premium       1.4.0
🔹 Bootstrap               5.2.3
🔹 SweetAlert2             Latest   - Beautiful alert modals
🔹 Laravel UI              4.6.3
🔹 Vite                    8.0.0
```

### Development & AI Tools
```
🔹 Laravel Boost           2.3.4    - AI development tools (15+ agent skills)
🔹 Laravel MCP             0.6.3    - Model Context Protocol server
🔹 Laravel Pail            1.2.6    - Real-time log viewer
🔹 Laravel Pint            1.29.0   - Code style fixer
🔹 Laravel Tinker          3.0.0    - REPL interface
```

### Testing Framework
```
🔹 Pest                    4.4.3    - Modern testing framework
🔹 Pest Laravel Plugin     4.1.0    - Laravel integration
🔹 PHPUnit                 12.5.14  - Base testing framework
🔹 Mockery                 1.6.12   - Mocking framework
```

### Additional Packages
```
🔹 League CommonMark        2.8.2    - Markdown parser (GFM)
🔹 Spatie YAML Front Matter 2.1.1    - YAML + Markdown parser
🔹 Faker                    1.24.1   - Test data generator
🔹 Collision                8.9.1    - Error reporting
```

### Production Packages
```
🔹 opcodesio/log-viewer              3.24.0   - Web-based log viewer
🔹 spatie/laravel-backup             10.2.0   - Database & file backups
🔹 spatie/laravel-honeypot           4.7.1    - Form spam protection
🔹 spatie/laravel-sitemap            8.0.0    - XML sitemap generator
🔹 spatie/laravel-cookie-consent     3.4.0    - GDPR cookie consent
🔹 mcamara/laravel-localization      2.4.0    - Multi-language routing (/hr, /en)
```

### Laravel 13 Compatibility Status

> ⚠️ **Note:** Laravel 13 is cutting-edge. Some popular packages await updates:
> - ❌ `artesaos/seotools` - SEO meta tags (max Laravel 12)
> - ❌ `anhskohbo/no-captcha` - reCAPTCHA (max Laravel 12)
> - ✅ Using alternatives: Manual meta tags, Honeypot for spam protection
>
> See [`docs/packages.md`](docs/packages.md) for complete package recommendations.

## 🏗️ Infrastruktura

### Hosting
- **Provider:** Hetzner Cloud
- **Control Panel:** CWP Pro (CentOS Web Panel)
- **Web Server:** Apache 2 (port 8181) + Nginx Reverse Proxy (443)
- **SSL:** Let's Encrypt (via CWP)
- **Firewall:** ModSecurity WAF enabled

### Domain
- **Production:** https://nova.lusar.hr
- **Environment:** Production
- **Session Name:** `lusar-doo-laravel-web-app-session`

## 📂 Struktura Projekta

```
lusar-web/
├── app/
│   ├── Http/Controllers/
│   │   ├── HomeController.php
│   │   └── DocsController.php          # Documentation system
│   └── Models/
│       └── User.php
├── docs/                                # WordPress export content
│   ├── pages/                          # 14 pages
│   ├── posts/                          # 2 posts
│   ├── images/                         # Media files
│   └── dashboard/                      # Tabler.io Premium source
├── public/
│   └── tabler/                         # 47MB Tabler assets
│       ├── css/
│       ├── js/
│       ├── libs/
│       └── img/
├── resources/
│   ├── views/
│   │   ├── layouts/
│   │   │   ├── tabler.blade.php       # Base Tabler layout
│   │   │   └── app.blade.php          # Auth layout (full Tabler)
│   │   ├── docs/
│   │   │   ├── index.blade.php        # Docs listing
│   │   │   └── show.blade.php         # Markdown viewer
│   │   ├── welcome.blade.php          # Landing page
│   │   └── errors/
│   │       └── minimal.blade.php      # Error layout
│   ├── css/
│   └── js/
├── routes/
│   └── web.php                         # Routes (docs.*, auth, home)
├── tests/
│   ├── Feature/
│   └── Unit/
└── vendor/
```

## 🚀 Installation & Setup

### Prerequisites
```bash
PHP >= 8.3
Composer 2.x
Node.js >= 18.x
MySQL/MariaDB
```

### Installation Steps

1. **Clone repository**
```bash
git clone https://github.com/mkopcic/lusar-web.git
cd lusar-web
```

2. **Install PHP dependencies**
```bash
composer install
```

3. **Install NPM dependencies**
```bash
npm install
```

4. **Environment setup**
```bash
cp .env.example .env
php artisan key:generate
```

5. **Configure database** in `.env`
```env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=lusar_web
DB_USERNAME=your_username
DB_PASSWORD=your_password
```

6. **Run migrations**
```bash
php artisan migrate
```

7. **Build assets**
```bash
npm run build
# Or for development with hot reload:
npm run dev
```

8. **Start development server**
```bash
php artisan serve
```

Visit: http://localhost:8000

## 🧪 Testing

This project uses **Pest 4** testing framework:

```bash
# Run all tests
php artisan test --compact

# Run specific test
php artisan test --compact --filter=ExampleTest

# Run with coverage
php artisan test --coverage

# Run Pest directly
vendor/bin/pest
```

## 🎨 Code Style

Automatsko formatiranje sa **Laravel Pint**:

```bash
# Format all files
vendor/bin/pint

# Format specific file
vendor/bin/pint path/to/file.php

# Dry run (test without changes)
vendor/bin/pint --test

# Agent format (for AI tools)
vendor/bin/pint --format agent
```

## 🤖 AI Development

Ovaj projekt koristi **Laravel Boost** za AI-assisted development:

### Available AI Tools
- `application-info` - Application metadata
- `database-schema` - Database structure inspector
- `database-query` - Query executor
- `search-docs` - Version-specific documentation search
- `last-error` - Recent error logs
- `read-log-entries` - Application logs
- `browser-logs` - Frontend console logs
- `get-absolute-url` - URL generation

### Usage
```bash
# Check application info
php artisan boost:info

# Search Laravel documentation
php artisan tinker --execute "app('boost')->searchDocs(['routing', 'middleware'])"
```

## 📚 Documentation System

Aplikacija ima integrirani **markdown viewer** za WordPress export dokumentaciju:

- **Route:** `/docs` - Lista svih dokumenata
- **Route:** `/docs/show?path={file}` - Prikaz pojedinačnog dokumenta
- **Features:**
  - GitHub Flavored Markdown (GFM)
  - Automatsko ekstraktovanje naslova
  - Path traversal zaštita
  - Custom CSS styling
  - Kategorizacija (pages, posts, root docs)

### Dostupna Dokumentacija
- 14 WordPress stranica u `docs/pages/`
- 2 WordPress posta u `docs/posts/`
- README_HR.md, INDEX.md, AGENT_IMPORT_GUIDE.md

## 🔐 Authentication

Laravel UI authentication sa Tabler dizajnom:

- `/login` - Login stranica
- `/register` - Registration
- `/password/reset` - Password reset
- `/home` - Dashboard (authenticated)

## 📝 Git Configuration

```bash
# Project owner
git config user.name "Marijan Kopčić"
git config user.email "mkopcic@gmail.com"

# Repository
Repository: mkopcic/lusar-web
Branch: main
```

## 🔗 Useful Links

- **Production:** https://nova.lusar.hr
- **Laravel Docs:** https://laravel.com/docs/13.x
- **Tabler Docs:** https://tabler.io/docs
- **Pest Docs:** https://pestphp.com/docs
- **Laravel Boost:** https://laravel.com/docs/ai

## 📄 License

Proprietary - © 2026 LuSar d.o.o. All rights reserved.

---

<p align="center">
  <strong>Made with ❤️ by LuSar d.o.o.</strong><br>
  <em>Powered by Laravel 13 • Enhanced by AI • Hosted on Hetzner Cloud</em>
</p>
