Skip to content

battuto/EtfManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ˆ ETF Portfolio Manager

Node.js Express SQLite Docker Bootstrap Chart.js

🎯 Piattaforma Professionale Multi-Utente per la Gestione di Portafogli ETF

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!


✨ Caratteristiche Principali

πŸ” Sistema Multi-Utente Completo

  • 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

🎯 Gestione Sessioni Guest Avanzata

  • 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

πŸ“Š Gestione Portfolio Avanzata

  • 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

πŸ“ˆ Analytics Avanzate

  • 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

πŸ‘¨β€πŸ’Ό Dashboard Amministrativo

  • 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

🚨 Sistema Alert Intelligente

  • Alert Prezzi: Notifiche personalizzate per target prices
  • Soglie Performance: Alert per guadagni o perdite significative
  • Rebalancing Portfolio: Suggerimenti per allocazione asset ottimale

🐳 Enterprise Ready

  • Containerizzazione Docker: Deployment completo con Docker Compose

🐳 Enterprise Ready

  • 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

πŸš€ Quick Start

🎯 Accesso Immediato con Utenti Demo

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

πŸ› οΈ Setup Locale (Raccomandato)

Prerequisites

  • Node.js (v18 or higher)
  • npm (Node Package Manager)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/EtfManager.git
    cd EtfManager
  2. Install dependencies

    npm install
  3. Initialize database and demo users

    node fix_users.js
  4. Start the application

    npm start
    # or
    node server.js
  5. Access the application

    • Main app: http://localhost:3000
    • Login: Use demo credentials above
    • Create portfolio as guest: Access homepage without login

🐳 Option 2: Docker Deployment

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

οΏ½ Guest to User Flow

  1. πŸ“‚ Create Portfolio as Guest: Access http://localhost:3000 without login

  2. πŸ’° Add Investments: Create investments in your guest portfolio

  3. πŸ” Register/Login: Use the register form or demo credentials

  4. ✨ Automatic Association: Your guest portfolio becomes linked to your account

    npm install
  5. Setup environment (copy and modify)

    cp .env.docker .env
  6. Run database migration (if migrating from SQLite)

    npm run migrate
  7. Start the application

    npm start

Access


πŸ—οΈ Struttura del Progetto

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

πŸ’‘ Tecnologie Core

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

πŸ“Š Panoramica FunzionalitΓ 

Gestione Investimenti

  • βœ… Aggiungi/Modifica/Elimina investimenti ETF
  • βœ… Importa/Esporta dati CSV
  • βœ… Aggiornamenti automatici prezzi
  • βœ… Storico transazioni dettagliato

Dashboard Analytics

  • πŸ“ˆ Grafico Composizione: Visualizzazione allocazione portfolio
  • πŸ“Š Grafico Performance: Tracking performance storica
  • πŸ“‰ Timeline Chart: Analisi timeline investimenti
  • 🎯 Allocation Chart: Raccomandazioni allocazione asset

Gestione Rischio

  • πŸ›‘οΈ Analisi VolatilitΓ : Calcoli deviazione standard
  • πŸ“Š Sharpe Ratio: Metriche rendimento aggiustato per rischio
  • 🎯 Diversification Score: Valutazione bilanciamento portfolio
  • ⚠️ Alert Rischio: Notifiche automatiche rischio

πŸ“Š Panoramica FunzionalitΓ  (English)

Investment Management

  • βœ… Add/Edit/Delete ETF investments
  • βœ… CSV Import/Export functionality
  • βœ… Automatic price updates
  • βœ… Detailed transaction history

Analytics Dashboard

  • πŸ“ˆ Composition Chart: Portfolio allocation visualization
  • πŸ“Š Performance Chart: Historical performance tracking
  • πŸ“‰ Timeline Chart: Investment timeline analysis
  • 🎯 Allocation Chart: Asset allocation recommendations

Risk Management

  • πŸ›‘οΈ Volatility Analysis: Standard deviation calculations
  • πŸ“Š Sharpe Ratio: Risk-adjusted return metrics
  • 🎯 Diversification Score: Portfolio balance assessment
  • ⚠️ Risk Alerts: Automated risk notifications

πŸ”§ Configuration

Environment Variables

Create a .env file in the root directory:

NODE_ENV=production
PORT=3000
DATABASE_PATH=./data/portfolio.db

Database Setup

The application automatically creates and configures the SQLite database on first run.


πŸ“± Screenshots

Dashboard Overview

Professional portfolio overview with real-time data and interactive charts

Analytics Dashboard

Comprehensive analytics with performance metrics and visualizations

Investment Management

Intuitive investment tracking with detailed transaction history


🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add some amazing feature'
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • 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

🌟 Star this repository if you find it helpful!

Made with ❀️ for investors who want to optimize their ETF portfolios

πŸ“Š View Demo | πŸ› Report Bug | πŸ’‘ Request Feature

About

EtfManager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published