mantenimento-app 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fabio Vacchino
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # Calcolatore Mantenimento Figli
2
+
3
+ Applicazione web per il calcolo orientativo dell'assegno di mantenimento con architettura separata frontend/backend.
4
+
5
+ ## Nuova architettura
6
+ - `frontend/public/index.html`: UI
7
+ - `frontend/public/app.js`: logica frontend (render, eventi, PDF)
8
+ - `backend/server.js`: server Node/Express
9
+ - `backend/calculate-model.js`: formula di calcolo server-side (`/api/calculate`)
10
+ - `scripts/build-frontend.mjs`: minificazione frontend (`app.min.js`)
11
+ - `supabase_schema.sql`: schema DB per KeyLock
12
+
13
+ ## Perche questa separazione
14
+ - Il frontend non contiene piu la formula principale in chiaro: il calcolo viene fatto da backend via API.
15
+ - Il JS client e modulare (non inline) e puo essere minificato per distribuzione.
16
+
17
+ Nota importante:
18
+ Nessuna applicazione web puo essere resa "non copiabile" al 100% lato browser. La protezione reale si ottiene spostando la logica sensibile sul server e distribuendo solo client minimizzato.
19
+
20
+ ## Avvio locale
21
+ 1. Installa dipendenze:
22
+
23
+ ```bash
24
+ npm install
25
+ ```
26
+
27
+ 2. Avvio sviluppo:
28
+
29
+ ```bash
30
+ npm run dev
31
+ ```
32
+
33
+ 3. Apri:
34
+
35
+ ```text
36
+ http://localhost:3000
37
+ ```
38
+
39
+ ## Build frontend minificato
40
+
41
+ ```bash
42
+ npm run build:frontend
43
+ ```
44
+
45
+ Il server serve automaticamente `app.min.js` se presente, altrimenti `app.js`.
46
+
47
+ ## Avvio produzione locale
48
+
49
+ ```bash
50
+ npm start
51
+ ```
52
+
53
+ `npm start` esegue build frontend + avvio server.
54
+
55
+ ## Endpoint backend
56
+ - `POST /api/calculate`: calcolo modello mantenimento
57
+ - `GET /api/health`: health check
58
+
59
+ ## KeyLock multi-device (Supabase)
60
+ Il login cloud resta lato frontend e usa `supabase-config.js` (chiave anon pubblica).
61
+ Non inserire nel frontend segreti server o credenziali DB.
62
+
63
+ Per la registrazione utente:
64
+ - l'utente inserisce `username + email + password`
65
+ - Supabase invia email di verifica
66
+ - il login diventa disponibile dopo conferma email
67
+
68
+ In Supabase `Authentication > Providers > Email` mantieni attiva la conferma email.
69
+
70
+ ## SEO e visibilita web
71
+ Sono inclusi:
72
+ - meta tag SEO/OG/Twitter in `frontend/public/index.html`
73
+ - dati strutturati JSON-LD `SoftwareApplication`
74
+ - `frontend/public/robots.txt`
75
+ - `frontend/public/sitemap.xml`
76
+
77
+ Se pubblichi su un dominio diverso da GitHub Pages, aggiorna URL canonico, `og:url`, `robots.txt` e `sitemap.xml`.
78
+
79
+ ## Deploy
80
+ Con la nuova architettura non e piu un sito statico puro: serve un runtime Node.js.
81
+
82
+ Opzioni tipiche:
83
+ - Render
84
+ - Railway
85
+ - Fly.io
86
+ - VPS con Node + reverse proxy
87
+
88
+ ## Note
89
+ - Strumento orientativo: non sostituisce valutazione legale/professionale.
90
+ - Per ulteriore hardening: rate limit API, auth server-side, logging audit, WAF/CDN.