netgescon-day0/docs/00-MASTER-DOCS-UNIFICATI/02-ARCHITETTURA-SISTEMA/README.md

94 lines
2.3 KiB
Markdown
Executable File

# 🏛️ ARCHITETTURA SISTEMA - NetGescon
## Database, Modelli Laravel e Strutture
### 📋 CONTENUTI CATEGORIA:
#### 🗄️ **DATABASE E RELAZIONI**
- **Modelli Laravel**: Stabile, TabellaMillesimale, VoceSpesa
- **Relazioni**: hasMany con eager loading corretto
- **Migrazioni**: Colonne ordinamento, chiavi esterne
- **Strutture**: MySQL ottimizzato per performance
#### 📊 **TECHNICAL_SPECS.md** - ⭐ DOCUMENTO MASTER
- Architettura completa sistema
- Specifiche tecniche dettagliate
- Performance requirements
- Stack tecnologico unificato
#### 🔧 **CONTROLLER E ROUTING**
- **StabileController**: Eager loading corretto
- **Routing**: Sistema modulare
- **Middleware**: Autenticazione e permessi
- **API**: Endpoint REST pianificati
#### 🚧 **MIGRATIONS E STRUTTURE**
- Schema database completo
- Seeder per dati di test
- Colonne ordinamento
- Indici performance
---
## 🎯 STACK TECNOLOGICO
### ✅ AMBIENTE PRODUZIONE:
- **Framework**: Laravel 10.x
- **Database**: MySQL 8.0
- **PHP**: 8.3.6
- **Web Server**: Apache2 + SSL
- **Frontend**: Tailwind CSS + Vite
- **Node.js**: Per build assets
### 🏗️ ARCHITETTURA:
```php
// Relazioni Corrette (FUNZIONANTE)
public function tabelleMillesimali() {
return $this->hasMany(TabellaMillesimale::class, 'stabile_id', 'id')
->orderBy('ordinamento')->orderBy('nome_tabella');
}
// Controller con Eager Loading
$stabile->load([
'tabelleMillesimali',
'vociSpesa',
'unitaImmobiliari',
'palazzine',
'amministratore'
]);
```
---
## 📊 PERFORMANCE METRICS
### Database Records (Stabile ID: 1):
- **Tabelle Millesimali**: 24 records
- **Voci di Spesa**: 30 records
- **Unità Immobiliari**: 50+ records
- **Query Time**: < 100ms
### Load Performance:
- **Page Load**: < 500ms
- **Database**: Ottimizzato con indici
- **Memory**: Efficient eager loading
---
## 🔗 FILE PRINCIPALI
### Modelli:
- `/var/www/netgescon/app/Models/Stabile.php`
- `/var/www/netgescon/app/Models/TabellaMillesimale.php`
- `/var/www/netgescon/app/Models/VoceSpesa.php`
### Controller:
- `/var/www/netgescon/app/Http/Controllers/Admin/StabileController.php`
### Migrations:
- `/var/www/netgescon/database/migrations/`
---
**📅 ULTIMO AGGIORNAMENTO: 28 Luglio 2025**
**🎯 STATUS: ARCHITETTURA STABILE**