98 lines
2.9 KiB
Markdown
98 lines
2.9 KiB
Markdown
# Smart Roots — Sito Web
|
||
|
||
Stack: **Astro 4** (static output) · CSS custom · Font: **Playfair Display** (Google Fonts) + IBM Plex · Deploy su **IIS 10 / Windows Server 2016**
|
||
|
||
---
|
||
|
||
## Struttura del progetto
|
||
|
||
```
|
||
/
|
||
├── docs/
|
||
│ └── INFRA.md ← documentazione infrastruttura IIS e deploy
|
||
├── public/
|
||
│ ├── assets/ ← immagini, loghi (copiati as-is nel build)
|
||
│ └── web.config ← configurazione IIS (copiata as-is nel build)
|
||
├── src/
|
||
│ ├── components/
|
||
│ │ ├── Layout.astro ← head HTML, meta SEO, font
|
||
│ │ ├── Nav.astro ← navbar completa (class="site-nav", tutte le pagine)
|
||
│ │ └── Footer.astro ← footer con dati societari
|
||
│ ├── pages/
|
||
│ │ ├── index.astro ← Home / Landing page
|
||
│ │ ├── contatti.astro ← Form contatti → WebAPI
|
||
│ │ ├── privacy.astro ← Privacy Policy
|
||
│ │ └── termini.astro ← Termini e condizioni
|
||
│ └── styles/
|
||
│ └── global.css ← CSS variables, nav, footer, form, responsive
|
||
├── astro.config.mjs
|
||
└── package.json
|
||
```
|
||
|
||
---
|
||
|
||
## Setup locale
|
||
|
||
### Prerequisiti
|
||
- Node.js 18+ (solo per sviluppo/build, non necessario in produzione)
|
||
|
||
```bash
|
||
npm install
|
||
npm run dev # avvia dev server su http://localhost:4321
|
||
npm run build # genera cartella /dist pronta per il deploy
|
||
```
|
||
|
||
---
|
||
|
||
## Deploy su IIS 10
|
||
|
||
```powershell
|
||
npm run build
|
||
Copy-Item -Path "dist\*" -Destination "C:\inetpub\wwwroot\smartroots-site\" -Recurse -Force
|
||
```
|
||
|
||
Il `web.config` viene copiato automaticamente da Astro durante la build.
|
||
|
||
Per la configurazione IIS completa (Virtual Applications, Virtual Directories, note critiche sul `web.config`) vedere **[docs/INFRA.md](docs/INFRA.md)**.
|
||
|
||
### Prerequisiti IIS
|
||
- Application Pool: **.NET CLR version = No Managed Code**
|
||
- Modulo **URL Rewrite** installato (https://www.iis.net/downloads/microsoft/url-rewrite)
|
||
|
||
---
|
||
|
||
## Form contatti — WebAPI
|
||
|
||
Il form invia a `https://api.smart-roots.net/api/contatti` via `fetch` POST JSON.
|
||
|
||
Payload inviato:
|
||
```json
|
||
{
|
||
"nome": "Mario Rossi",
|
||
"azienda": "Acme S.r.l.",
|
||
"email": "mario@azienda.it",
|
||
"ambito": "smartdb",
|
||
"messaggio": "..."
|
||
}
|
||
```
|
||
|
||
Controller: `SmartRootsServices/SRServices/Controllers/SmartRootsSite/ContattiController.cs`
|
||
CORS abilitato per `https://www.smart-roots.net`. Validazione lato server: campi obbligatori,
|
||
lunghezza minima messaggio (10 caratteri), rate limiting (3 invii/ora per IP), honeypot anti-bot.
|
||
|
||
---
|
||
|
||
## Aggiungere nuove pagine
|
||
|
||
1. Creare `src/pages/nuova-pagina.astro`
|
||
2. Usare il componente `Layout` con titolo e descrizione
|
||
3. `npm run build` e rideploy della cartella `/dist`
|
||
|
||
---
|
||
|
||
## TODO
|
||
|
||
- [ ] Aggiungere immagine `og-image.jpg` in `/public/assets/` (1200×630px)
|
||
- [x] Integrare hCaptcha nel form contatti (frontend + verifica backend)
|
||
- [x] Privacy Policy e Termini e Condizioni con testo completo
|