Un'applicazione web completa e enterprise-ready per il tracking, l'analisi e l'ottimizzazione degli investimenti in Exchange-Traded Fund (ETF) con supporto multi-utente completo e gestione sessioni guest avanzata.
π Versione 3.0 Multi-User Ready: Sistema di autenticazione completo, separazione dati utente, associazione automatica portfolio guest e architettura scalabile!
- Autenticazione Sicura: Login/registrazione con bcrypt e express-session
- Separazione Dati: Ogni utente vede solo i propri portfolio e investimenti
- Utenti Demo: Accesso immediato con credenziali predefinite
- Gestione Ruoli: Amministratori e utenti standard con permessi differenziati
- Access Senza Registrazione: Gli utenti possono creare portfolio come guest
- Associazione Automatica: Portfolio guest vengono associati dopo login/registrazione
- Migrazione Seamless: Transizione trasparente da guest a utente autenticato
- Preservazione Dati: Nessuna perdita di portfolio o investimenti durante la migrazione
- Supporto Multi-Portfolio: Creazione e gestione di portafogli multipli per utente
- Aggiornamenti Real-Time: Recupero automatico prezzi ETF dalle API finanziarie
- Tracking Investimenti: Storico dettagliato acquisti con calcoli profit/loss
- Trasferimenti Portfolio: Spostamento seamless investimenti tra portfolio
- Metriche Performance: Sharpe ratio, volatilitΓ , e valutazione del rischio
- Analisi Storica: Performance tracking 30-giorni, 90-giorni, e annuale
- Diversification Score: Analisi automatica diversificazione portfolio
- Grafici Interattivi: Visualizzazioni avanzate powered by Chart.js
- Gestione Utenti: CRUD completo utenti con controlli permessi
- Monitoraggio Sistema: Statistiche real-time e health monitoring
- Analytics Sistema: Metriche performance e utilizzo risorse
- Audit Logging: Tracciamento completo operazioni amministrative
- Alert Prezzi: Notifiche personalizzate per target prices
- Soglie Performance: Alert per guadagni o perdite significative
- Rebalancing Portfolio: Suggerimenti per allocazione asset ottimale
- Containerizzazione Docker: Deployment completo con Docker Compose
- Architettura Scalabile: Supporto SQLite (attuale) e PostgreSQL (futuro)
- Sicurezza Avanzata: Password hashing bcrypt e sessioni sicure
- Containerizzazione Docker: Deployment completo con Docker Compose
- Migration Tools: Strumenti automatici per upgrade e migrazione dati
Il sistema include utenti demo preconfigurati per test immediato:
| π€ Username | π Password | π‘οΈ Ruolo | π Descrizione |
|---|---|---|---|
admin |
Admin123! |
Amministratore | Accesso completo al sistema |
demo_user |
DemoUser123! |
Utente Standard | Accesso funzionalitΓ base |
- Node.js (v18 or higher)
- npm (Node Package Manager)
-
Clone the repository
git clone https://github.com/yourusername/EtfManager.git cd EtfManager -
Install dependencies
npm install
-
Initialize database and demo users
node fix_users.js
-
Start the application
npm start # or node server.js -
Access the application
- Main app: http://localhost:3000
- Login: Use demo credentials above
- Create portfolio as guest: Access homepage without login
For production deployment with PostgreSQL:
# Clone the repository
git clone https://github.com/yourusername/EtfManager.git
cd EtfManager
# Start with Docker Compose
docker-compose up -d
# Access the application
# Main app: http://localhost:3000
# Adminer (DB admin): http://localhost:8080-
π Create Portfolio as Guest: Access http://localhost:3000 without login
-
π° Add Investments: Create investments in your guest portfolio
-
π Register/Login: Use the register form or demo credentials
-
β¨ Automatic Association: Your guest portfolio becomes linked to your account
npm install
-
Setup environment (copy and modify)
cp .env.docker .env
-
Run database migration (if migrating from SQLite)
npm run migrate
-
Start the application
npm start
- Main Application: http://localhost:3000
- Admin Dashboard: http://localhost:3000/admin (admin users only)
ETF-Portfolio-Manager/
βββ π config/ # Configurazione database
β βββ database.js # Config SQLite/PostgreSQL
β βββ postgresql.js # Setup PostgreSQL + Sequelize
βββ π controllers/ # Controller business logic
β βββ alertController.js # Gestione alert
β βββ analyticsController.js # Analytics portfolio
β βββ authController.js # Autenticazione utenti
β βββ investmentController.js # CRUD investimenti
β βββ portfolioController.js # Gestione portfolio
β βββ admin/
β βββ adminController.js # Dashboard amministrativo
βββ π data/ # File database SQLite
βββ π docker/ # Configurazioni Docker
β βββ nginx/ # Config Nginx
β βββ postgres/ # Init scripts PostgreSQL
β βββ README.md # Guida deployment
βββ π middleware/ # Middleware Express
β βββ auth.js # Autenticazione JWT
βββ π models/ # Modelli dati Sequelize
βββ π public/ # Assets statici
β βββ css/ # Stylesheet
β βββ js/ # JavaScript frontend
βββ π routes/ # Definizioni route Express
β βββ index.js # Route principali
β βββ admin/ # Route amministrative
βββ π scripts/ # Script utilitΓ
β βββ migrate.js # Script migrazione DB
βββ π utils/ # Funzioni utility
βββ π views/ # Template EJS
β βββ layouts/ # Layout principali
β βββ partials/ # Componenti riutilizzabili
β βββ admin/ # Template admin
βββ π³ docker-compose.yml # Orchestrazione Docker
βββ π³ Dockerfile # Container applicazione
βββ π§ server.js # Entry point applicazione
βββ π package.json # Dipendenze e script
| Tecnologia | Scopo | Versione |
|---|---|---|
| Node.js | Runtime Environment | Latest LTS |
| Express.js | Web Framework | ^4.18.0 |
| PostgreSQL | Database Produzione | ^8.11.0 |
| SQLite | Database Sviluppo | ^5.1.0 |
| Sequelize | ORM Database | ^6.35.0 |
| EJS | Template Engine | ^3.1.0 |
| Chart.js | Visualizzazione Dati | ^4.0.0 |
| Bootstrap | UI Framework | ^5.3.0 |
| Docker | Containerizzazione | Latest |
| JWT | Autenticazione | ^9.0.2 |
- β Aggiungi/Modifica/Elimina investimenti ETF
- β Importa/Esporta dati CSV
- β Aggiornamenti automatici prezzi
- β Storico transazioni dettagliato
- π Grafico Composizione: Visualizzazione allocazione portfolio
- π Grafico Performance: Tracking performance storica
- π Timeline Chart: Analisi timeline investimenti
- π― Allocation Chart: Raccomandazioni allocazione asset
- π‘οΈ Analisi VolatilitΓ : Calcoli deviazione standard
- π Sharpe Ratio: Metriche rendimento aggiustato per rischio
- π― Diversification Score: Valutazione bilanciamento portfolio
β οΈ Alert Rischio: Notifiche automatiche rischio
- β Add/Edit/Delete ETF investments
- β CSV Import/Export functionality
- β Automatic price updates
- β Detailed transaction history
- π Composition Chart: Portfolio allocation visualization
- π Performance Chart: Historical performance tracking
- π Timeline Chart: Investment timeline analysis
- π― Allocation Chart: Asset allocation recommendations
- π‘οΈ Volatility Analysis: Standard deviation calculations
- π Sharpe Ratio: Risk-adjusted return metrics
- π― Diversification Score: Portfolio balance assessment
β οΈ Risk Alerts: Automated risk notifications
Create a .env file in the root directory:
NODE_ENV=production
PORT=3000
DATABASE_PATH=./data/portfolio.dbThe application automatically creates and configures the SQLite database on first run.
Professional portfolio overview with real-time data and interactive charts
Comprehensive analytics with performance metrics and visualizations
Intuitive investment tracking with detailed transaction history
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add some amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Financial Data APIs for real-time ETF pricing
- Chart.js Community for excellent visualization libraries
- Bootstrap Team for responsive UI components
- Node.js Community for robust backend ecosystem
Made with β€οΈ for investors who want to optimize their ETF portfolios